Graal: java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader [aarch64]

Created on 27 Jun 2020  路  10Comments  路  Source: oracle/graal

When compiling TruffleSqueak for aarch64, I get the following UnsatisfiedLinkError when the JPEG plugin is used:

ERROR: java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader()J [symbol: Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader or Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader__]
org.graalvm.polyglot.PolyglotException: java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader()J [symbol: Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader or Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader__]
    at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:153)
    at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:57)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader(JPEGImageReader.java)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.<init>(JPEGImageReader.java:232)
    at com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi.createReaderInstance(JPEGImageReaderSpi.java:85)
    at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:532)
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:516)
    at javax.imageio.ImageIO.read(ImageIO.java:1463)
    at javax.imageio.ImageIO.read(ImageIO.java:1363)
    at de.hpi.swa.trufflesqueak.nodes.plugins.JPEGReadWriter2Plugin$PrimJPEGReadHeaderfromByteArrayerrorMgrNode.doReadHeader(JPEGReadWriter2Plugin.java:113)
    ...

Tested with GraalVM CE 20.1.0 on Raspberry Pi OS (aarch64).

bug native-image

Most helpful comment

We have a fix for this in the pipeline. It should be in by 20.3.

All 10 comments

I'm getting this similar error on Centos 7.x but at runtime and on amd64:
java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader()J [symbol: Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader or Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader__]
at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:145)
at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:57)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader(JPEGImageReader.java)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.(JPEGImageReader.java:232)
at com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi.createReaderInstance(JPEGImageReaderSpi.java:85)
at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:532)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:516)
at javax.imageio.ImageIO.read(ImageIO.java:1463)
at javax.imageio.ImageIO.read(ImageIO.java:1363)

With the change in GraalVM 20.2 that many JDK classes are no longer initialized at build time, this might work now already.

It's unfortunately still an issue on 20.2:

$ ./graalvm-ce-java11-20.2.0/bin/trufflesqueak
[trufflesqueak] Running Squeak/Smalltalk on GraalVM CE...
[trufflesqueak] Image loaded in 808ms.
ERROR: java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader()J [symbol: Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader or Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader__]
org.graalvm.polyglot.PolyglotException: java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader()J [symbol: Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader or Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader__]
    at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:153)
    at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:57)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader(JPEGImageReader.java)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.<init>(JPEGImageReader.java:232)
    at com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi.createReaderInstance(JPEGImageReaderSpi.java:85)
    at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:532)
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:516)
    at javax.imageio.ImageIO.read(ImageIO.java:1463)
    at javax.imageio.ImageIO.read(ImageIO.java:1363)
    at de.hpi.swa.trufflesqueak.nodes.plugins.JPEGReadWriter2Plugin$PrimJPEGReadHeaderfromByteArrayerrorMgrNode.readImageOrPrimFail(JPEGReadWriter2Plugin.java:119)
    at de.hpi.swa.trufflesqueak.nodes.plugins.JPEGReadWriter2Plugin$PrimJPEGReadHeaderfromByteArrayerrorMgrNode.doReadHeader(JPEGReadWriter2Plugin.java:110)
    at de.hpi.swa.trufflesqueak.nodes.plugins.JPEGReadWriter2PluginFactory$PrimJPEGReadHeaderfromByteArrayerrorMgrNodeFactory$PrimJPEGReadHeaderfromByteArrayerrorMgrNodeGen.executeAndSpecialize(JPEGReadWriter2PluginFactory.java:852)
    at de.hpi.swa.trufflesqueak.nodes.plugins.JPEGReadWriter2PluginFactory$PrimJPEGReadHeaderfromByteArrayerrorMgrNodeFactory$PrimJPEGReadHeaderfromByteArrayerrorMgrNodeGen.executePrimitive(JPEGReadWriter2PluginFactory.java:839)
    at de.hpi.swa.trufflesqueak.nodes.dispatch.CachedDispatchNode$CachedDispatchPrimitiveNode.execute(CachedDispatchNode.java:108)
...

We have a fix for this in the pipeline. It should be in by 20.3.

@vjovanov has this issue already been fixed?

I think JPEG had issues and this PR ought to address them:

https://github.com/oracle/graal/pull/3032#issuecomment-736515615

I think JPEG had issues and this PR ought to address them:

#3032 (comment)

I concur. It should be fixed with that PR.

This should be fixed with latest graal master.

Thaks @jerboaa!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johanvos picture johanvos  路  3Comments

igor-ramazanov picture igor-ramazanov  路  3Comments

koduki picture koduki  路  3Comments

helloguo picture helloguo  路  3Comments

schneidersteve picture schneidersteve  路  3Comments