Skip to content

Internal GraalVM Error, on OpenJDK 17 trying to run Python #7750

@niclash

Description

@niclash

Describe GraalVM and your environment :

  • GraalVM version 23.1.1
  • CE
  • JDK version: OpenJDK 17
  • OS and OS Version: Linux Debian testing
  • Architecture: amd64
  • The output of java -Xinternalversion:
OpenJDK 64-Bit Server VM (17.0.9+9-Debian-1) for linux-amd64 JRE (17.0.9+9-Debian-1), built on Oct 18 2023 09:00:53 by "buildd" with gcc 13.2.0

Have you verified this issue still happens when using the latest snapshot?

I am not yet at a point where I can verify execution outside Unit Tests, and they are driven by Gradle and expects Maven repositories. IF you have SNAPSHOT repositories and not only the zip files, then I can test it, but asking me to make major changes to the build system is a bit too much.

Describe the issue
I have testcases for Javascript, Ruby and Python. The JS and Ruby ones works but the Python one fails with the exception below when calling context.getBindings( "python" );

It is quite obviously related to Java Module system and that BouncyCastle isn't modularized. And for similar issues in unrelated libraries, my whole application is not modularized. The solution might lie in some clever module-info magic either in GraalVM jar or in my application. It is not a field that I have much experience.

Code snippet or code repository that reproduces the issue

                Source compiledScript = fetchCompiledScript( language, scriptName, script );
                if( compiledScript == null )
                {
                    return; // nothing to do, if we can't compile it.
                }

                Context context = getContextForOrg( orgId, language );

                Value bindings = context.getPolyglotBindings();
                bindings.putMember( "ts", tsValue );
                bindings = context.getBindings( language );
                bindings.putMember( "ts", tsValue );
                Value v = context.eval( compiledScript );
                result[0] = interpretOutput( orgId, key, tsValue, v );
import polyglot

ts = polyglot.import_value('ts')

if ts.value > 100:
    result = '{"type": "alarm", "state":"on", "name":"' + ts.name + '","tsvalue":"' + str(
        ts.value) + '","message": "Value exceeding 100."}'
else:
    result = '{"type": "alarm", "state":"off", "name":"' + ts.name + '","tsvalue":"' + str(
        ts.value) + '","message": "Value below 100."}'
result

Steps to reproduce the issue
Please include both build steps as well as run steps

  1. Step one [e.g.: git clone --depth 1 https://git.myrepo.com/projectone ]
  2. Step two [e.g.: mvn clean package]

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here. Specially important are stack traces or log output. Feel free to link to gists or to screenshots if necesary

Details
org.graalvm.polyglot.PolyglotException: java.lang.IllegalAccessError: class org.bouncycastle.jce.provider.BouncyCastleProvider (in module org.bouncycastle.provider) cannot access class java.util.logging.Logger (in module java.logging) because module org.bouncycastle.provider does not read module java.logging
	at org.bouncycastle.provider/org.bouncycastle.jce.provider.BouncyCastleProvider.<clinit>(BouncyCastleProvider.java:75)
	at org.graalvm.py/com.oracle.graal.python.builtins.objects.ssl.CertUtils.<clinit>(CertUtils.java:118)
	at org.graalvm.py/com.oracle.graal.python.builtins.modules.hashlib.HashlibModuleBuiltins.<clinit>(HashlibModuleBuiltins.java:141)
	at org.graalvm.py/com.oracle.graal.python.builtins.Python3Core.initializeBuiltins(Python3Core.java:639)
	at org.graalvm.py/com.oracle.graal.python.builtins.Python3Core.<init>(Python3Core.java:783)
	at org.graalvm.py/com.oracle.graal.python.runtime.PythonContext.<init>(PythonContext.java:1109)
	at org.graalvm.py/com.oracle.graal.python.PythonLanguage.createContext(PythonLanguage.java:410)
	at org.graalvm.py/com.oracle.graal.python.PythonLanguage.createContext(PythonLanguage.java:134)
	at org.graalvm.truffle/com.oracle.truffle.api.LanguageAccessor$LanguageImpl.createEnvContext(LanguageAccessor.java:270)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.ensureCreated(PolyglotLanguageContext.java:652)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotLanguageContext.ensureInitialized(PolyglotLanguageContext.java:731)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.getBindings(PolyglotContextImpl.java:1402)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.getBindings(PolyglotContextDispatch.java:95)
	at org.graalvm.polyglot.impl.UnnamedToModuleContextDispatchGen.getBindings(UnnamedToModuleContextDispatchGen.java:89)
	at org.graalvm.polyglot.Context.getBindings(Context.java:563)
	at com.sensetif.pipes.fx.conditions.ConditionExecutor.lambda$executeConditionScripts$2(ConditionExecutor.java:227)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.lambda$entryConsumer$0(Collections.java:1625)
	at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1850)
	at java.base/java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntrySetSpliterator.forEachRemaining(Collections.java:1650)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at com.sensetif.cassandra.model.mock.MockKeyValues.select(MockKeyValues.java:29)
	at com.sensetif.pipes.fx.conditions.ConditionExecutor.executeConditionScripts(ConditionExecutor.java:204)
	at com.sensetif.pipes.fx.conditions.ConditionExecutor.lambda$apply$1(ConditionExecutor.java:176)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at com.sensetif.cassandra.model.mock.MockDatapoints.select(MockDatapoints.java:56)
	at com.sensetif.pipes.fx.conditions.ConditionExecutor.apply(ConditionExecutor.java:169)
	at com.sensetif.pipes.fx.conditions.ConditionExecutor.apply(ConditionExecutor.java:58)
	at com.sensetif.pipes.fx.PipeMultiResultFunction.handleMessage(PipeMultiResultFunction.java:21)
	at com.sensetif.pipes.fx.PipeFunction.messageReceived(PipeFunction.java:98)
	at com.sensetif.pipes.messaging.TestMessenger$Subscription.receiveAll(TestMessenger.java:166)
	at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:807)
	at com.sensetif.pipes.messaging.TestMessenger$ConsumerThread.run(TestMessenger.java:198)
	at java.base/java.lang.Thread.run(Thread.java:840)
	Suppressed: Attached Guest Language Frames (0)
Internal GraalVM error, please report at https://github.com/oracle/graal/issues/.
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions