Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraalVM: 'org.sqlite.util.ProcessRunner' was found in the image heap. #1158

Closed
BLCK-B opened this issue Aug 16, 2024 · 2 comments · Fixed by #1159
Closed

GraalVM: 'org.sqlite.util.ProcessRunner' was found in the image heap. #1158

BLCK-B opened this issue Aug 16, 2024 · 2 comments · Fixed by #1159

Comments

@BLCK-B
Copy link

BLCK-B commented Aug 16, 2024

Describe the bug
nativeCompile results in an error. Suggested fix --initialize-at-build-time=org.sqlite.util.ProcessRunner works, so the issue is not breaking.

To Reproduce
https://github.com/BLCK-B/sqlite-graal-issue
GraalVM 24.0.2 - Java 22.0.2

  • cd demo
  • ./gradlew nativeCompile

Logs
Error: An object of type 'org.sqlite.util.ProcessRunner' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

The following detailed trace displays from which field in the code the object was reached.
Detailed message:
Trace: Object was reached by
  reading static field org.sqlite.util.OSInfo.processRunner
    at org.sqlite.util.OSInfo.getHardwareName(OSInfo.java:164)
  parsing method org.sqlite.util.OSInfo.getHardwareName(OSInfo.java:164) reachable via the parsing context
    at org.sqlite.util.OSInfo.resolveArmArchType(OSInfo.java:173)
    at org.sqlite.util.OSInfo.getArchName(OSInfo.java:253)
    at org.sqlite.util.OSInfo.getNativeLibFolderPathForCurrentOS(OSInfo.java:111)
    at org.sqlite.SQLiteJDBCLoader.loadNativeLibrary(SQLiteJDBCLoader.java:273)
    at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:345)
    at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:75)
    at org.sqlite.core.NativeDB.load(NativeDB.java:69)
    at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:280)
    at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:67)
    at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
    at com.oracle.svm.core.code.FactoryMethodHolder.JDBC4Connection_constructor_a84323d33dcdbf5002f28e7925fa38bcccf91d2c(generated:0)
    at org.sqlite.JDBC.createConnection(JDBC.java:106)
    at org.sqlite.JDBC.connect(JDBC.java:79)
    at java.sql.DriverManager.getConnection(DriverManager.java:682)
    at java.sql.DriverManager.getConnection(DriverManager.java:253)
    at com.example.demo.DemoApplication.main(DemoApplication.java:16)
    at com.oracle.svm.core.JavaMainWrapper.invokeMain(JavaMainWrapper.java:182)
    at com.oracle.svm.core.JavaMainWrapper.runCore0(JavaMainWrapper.java:233)
    at com.oracle.svm.core.JavaMainWrapper.doRun(JavaMainWrapper.java:301)
    at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
    at static root method.(Unknown Source)

Environment (please complete the following information):

  • OS: Windows 11
  • CPU architecture: x86_64
  • sqlite-jdbc version: 3.46.0.1
@gotson
Copy link
Collaborator

gotson commented Aug 16, 2024

@kkriske is our resident GraalVM SME, maybe he can have a look at this

@kkriske
Copy link
Contributor

kkriske commented Aug 16, 2024

See #1159 for explanation and fix

@BLCK-B BLCK-B closed this as completed Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants