-
Notifications
You must be signed in to change notification settings - Fork 55
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
Crash at latest under GraalVM #386
Comments
Thanks for such a detailed issue description. I'll follow along at the coroutines issue for now, as I suspect this behavior is entirely out of our control at this layer. |
@JakeWharton I thought initially that Mosaic might be off the hook, but actually this might be multiple issues (or just one really complex one), and at least coroutines thinks it may have to do with Mosaic. I've isolated this to a simple reproducer; see the tracker issue at elide-dev/elide#972. Back on our own codebase, I can isolate this into an interesting stacktrace:
Click to see full stacktraceException in thread "main" java.lang.RuntimeException: Exception while trying to handle coroutine exception at kotlinx.coroutines.CoroutineExceptionHandlerKt.handlerException(CoroutineExceptionHandler.kt:35) at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:26) at kotlinx.coroutines.DispatchedTask.handleFatalException$kotlinx_coroutines_core(DispatchedTask.kt:142) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:111) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at com.jakewharton.mosaic.BlockingKt.runMosaicBlocking(blocking.kt:6) at elide.tool.cli.AbstractToolCommand.call(AbstractToolCommand.kt:260) at elide.tool.cli.AbstractToolCommand.call(AbstractToolCommand.kt:30) at picocli.CommandLine.executeUserObject(CommandLine.java:2045) at picocli.CommandLine.access$1500(CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465) at picocli.CommandLine$RunLast.handle(CommandLine.java:2457) at picocli.CommandLine$RunLast.handle(CommandLine.java:2419) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277) at picocli.CommandLine$RunLast.execute(CommandLine.java:2421) at picocli.CommandLine.execute(CommandLine.java:2174) at elide.tool.cli.Elide$Companion.exec$runtime(Elide.kt:232) at elide.tool.cli.Elide$Companion.entry(Elide.kt:195) at elide.tool.cli.ElideKt.main(Elide.kt:305) Suppressed: kotlinx.coroutines.CoroutinesInternalError: Fatal exception in coroutines machinery for DispatchedContinuation[BlockingEventLoop@4a98064b, Continuation at com.jakewharton.mosaic.MosaicKt$runMosaic$2.invokeSuspend(mosaic.kt)@6732a44]. Please read KDoc to 'handleFatalException' method and report this incident to maintainers at kotlinx.coroutines.DispatchedTask.handleFatalException$kotlinx_coroutines_core(DispatchedTask.kt:140) ... 21 more Caused by: java.lang.IncompatibleClassChangeError at kotlin.coroutines.CombinedContext.get(CoroutineContextImpl.kt:125) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:93) ... 20 more Exception in thread "main" java.lang.IncompatibleClassChangeError at kotlin.coroutines.CombinedContext.fold(CoroutineContextImpl.kt:131) at kotlin.coroutines.CombinedContext.toString(CoroutineContextImpl.kt:174) at kotlinx.coroutines.internal.DiagnosticCoroutineContextException.getLocalizedMessage(CoroutineExceptionHandlerImpl.kt:37) at [email protected]/java.lang.Throwable.toString(Throwable.java:519) at [email protected]/java.lang.String.valueOf(String.java:4507) at [email protected]/java.lang.Throwable.printEnclosedStackTrace(Throwable.java:745) at [email protected]/java.lang.Throwable.lockedPrintStackTrace(Throwable.java:713) at [email protected]/java.lang.Throwable.printStackTrace(Throwable.java:695) at [email protected]/java.lang.Throwable.printStackTrace(Throwable.java:682) at [email protected]/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:698) at [email protected]/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690) at kotlinx.coroutines.internal.CoroutineExceptionHandlerImplKt.propagateExceptionFinalResort(CoroutineExceptionHandlerImpl.kt:31) at kotlinx.coroutines.internal.CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(CoroutineExceptionHandlerImpl.common.kt:48) at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:26) at kotlinx.coroutines.DispatchedTask.handleFatalException$kotlinx_coroutines_core(DispatchedTask.kt:142) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:111) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at com.jakewharton.mosaic.BlockingKt.runMosaicBlocking(blocking.kt:6) at elide.tool.cli.AbstractToolCommand.call(AbstractToolCommand.kt:260) at elide.tool.cli.AbstractToolCommand.call(AbstractToolCommand.kt:30) at picocli.CommandLine.executeUserObject(CommandLine.java:2045) at picocli.CommandLine.access$1500(CommandLine.java:148) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465) at picocli.CommandLine$RunLast.handle(CommandLine.java:2457) at picocli.CommandLine$RunLast.handle(CommandLine.java:2419) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277) at picocli.CommandLine$RunLast.execute(CommandLine.java:2421) at picocli.CommandLine.execute(CommandLine.java:2174) at elide.tool.cli.Elide$Companion.exec$runtime(Elide.kt:232) at elide.tool.cli.Elide$Companion.entry(Elide.kt:195) at elide.tool.cli.ElideKt.main(Elide.kt:305) Does this exception even make any sense to you? I'm in Gradle, and this was against Mosaic latest/coroutines latest. |
Okay, sorry for the volume of comments, but I've been able to work around this for now by restoring to:
|
We have a suite of "self tests" in our binary which use the Jest sample. The output looks like this normally:
Running these at the latest GraalVM release, and release of Mosaic, produces a crash:
After investigating further, I was able to produce an exception:
The snippets of code in question:
AbstractToolCommand.kt
:I have shortened this to use the counter example instead. The code I'm using is:
Versions:
2.0.0
2.0.0
(built-in)0.13.0
1.9.0-RC
0.24.0
The relevant lines from Coroutines show that this is failing at an AtomicFU callsite:
![Screenshot 2024-06-01 at 1 46 23 AM](https://private-user-images.githubusercontent.com/171897/335789405-de6de4a1-a8cd-4d39-9f76-34af3197c6df.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4OTM0MTYsIm5iZiI6MTcxOTg5MzExNiwicGF0aCI6Ii8xNzE4OTcvMzM1Nzg5NDA1LWRlNmRlNGExLWE4Y2QtNGQzOS05Zjc2LTM0YWYzMTk3YzZkZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMlQwNDA1MTZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xMmNkODJmZTNhZTE2NTU1ODY0ZWFmMmFkMWY4ODViNjVjMWRlOGExYTFlODE4NDQzN2NlMzc3MjMzZGQzOWZjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.8MC7FsZ8nuyrzQxRXesXDXbKjB4Pbti0HWPedPr3B-g)
I have tried really hard to debug further and gotten nowhere. Some other details I've been able to confirm:
-O3
and-O4
produce crashes (bus error
orsegmentation fault
)-O2
produces the stacktrace above-O1
and-O0
seem to producebus error
The failure ultimately happens because
System.classData
is called, which is substituted under SVM.AtomicReferenceFieldUpdater
calls this as part ofaccessCheck
, through a failed call toisInstance
; the failedisInstance
check throws withthrowAccessCheckException
, which uses reflection and is present in the stacktrace.Working version matrix (previous):
2.0.0-RC3
1.5.13-dev-k2.0.0-RC1-50f08dfa4b4
(Android)0.11.0
1.8.0
0.23.2
I intend to cross-file with the Coroutines and GraalVM teams. I can supply test binaries, symbols, and a reproducer in-situ.
The text was updated successfully, but these errors were encountered: