1) Compile with :packages:runtime:nativeOptimizedCompile on feat/entrypoint-v2-pt2
2) Run ./packages/runtime/build/native/nativeOptimizedCompile/elide run ./tools/scripts/hello.ts
3) It says a short message and exits without error
Actual Behaviour
1) Compile with :packages:runtime:nativeOptimizedCompile on feat/entrypoint-v2-pt2
2) Run ./packages/runtime/build/native/nativeOptimizedCompile/elide run ./tools/scripts/hello.ts
3) Horrible crash on exit
Stacktrace
Stacktrace (native-only, ClassCastException originating from AtomicFU / coroutines / Mosaic)
java.lang.ClassCastException
at java.base@23/java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.throwAccessCheckException(AtomicReferenceFieldUpdater.java:418)
at java.base@23/java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.accessCheck(AtomicReferenceFieldUpdater.java:409)
at java.base@23/java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.get(AtomicReferenceFieldUpdater.java:466)
at kotlinx.coroutines.CancellableContinuationImpl.getParentHandle(CancellableContinuationImpl.kt:103)
at kotlinx.coroutines.CancellableContinuationImpl.detachChild$kotlinx_coroutines_core(CancellableContinuationImpl.kt:569)
at kotlinx.coroutines.CancellableContinuationImpl.detachChildIfNonResuable(CancellableContinuationImpl.kt:562)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core(CancellableContinuationImpl.kt:503)
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core$default(CancellableContinuationImpl.kt:493)
at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:596)
at kotlinx.coroutines.EventLoopImplBase$DelayedResumeTask.run(EventLoop.common.kt:497)
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 com.example.DemoCommand.run(DemoCommand.kt:24)
at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
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 io.micronaut.configuration.picocli.PicocliRunner.run(PicocliRunner.java:146)
at io.micronaut.configuration.picocli.PicocliRunner.run(PicocliRunner.java:123)
at com.example.DemoCommand$Companion.main(DemoCommand.kt:31)
at com.example.DemoCommand.main(DemoCommand.kt)
Stacktrace (IncompatibleClassChangeError, Exception while trying to handle coroutine exception, originating from Coroutines/Mosaic)
Exception 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 java.base@22.0.1/java.lang.Throwable.toString(Throwable.java:519)
at java.base@22.0.1/java.lang.String.valueOf(String.java:4507)
at java.base@22.0.1/java.lang.Throwable.printEnclosedStackTrace(Throwable.java:745)
at java.base@22.0.1/java.lang.Throwable.lockedPrintStackTrace(Throwable.java:713)
at java.base@22.0.1/java.lang.Throwable.printStackTrace(Throwable.java:695)
at java.base@22.0.1/java.lang.Throwable.printStackTrace(Throwable.java:682)
at java.base@22.0.1/java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:698)
at java.base@22.0.1/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)
Related Issues
Expected Behavior
1) Compile with
:packages:runtime:nativeOptimizedCompile
onfeat/entrypoint-v2-pt2
2) Run./packages/runtime/build/native/nativeOptimizedCompile/elide run ./tools/scripts/hello.ts
3) It says a short message and exits without errorActual Behaviour
1) Compile with
:packages:runtime:nativeOptimizedCompile
onfeat/entrypoint-v2-pt2
2) Run./packages/runtime/build/native/nativeOptimizedCompile/elide run ./tools/scripts/hello.ts
3) Horrible crash on exitStacktrace
Stacktrace (native-only,
ClassCastException
originating from AtomicFU / coroutines / Mosaic)Stacktrace (
IncompatibleClassChangeError
, Exception while trying to handle coroutine exception, originating from Coroutines/Mosaic)Segfault (click to expand)
Steps To Reproduce
See the Reproducers section below, or, to surface the issue in Elide's codebase, perform the following steps:
1)
git clone git@github.com:elide-dev/elide.git -b feat/entrypoint-v2-pt2
2)make -C third_party
3)./gradlew :packages:runtime:nativeOptimizedCompile
4)./packages/runtime/build/native/nativeOptimizedCompile/elide lint
(orelide selftest
)Environment Information
aarch64
(M-series; x86-64 not yet tested)Mainline:
Edge:
1.9.0-RC
1.8.0
1.7.3
0.24.0
0.23.2
(Matching coroutines)nativeOptimizedCompile
,-O3
,-O4
nativeOptimizedCompile
,-O2
nativeOptimizedCompile
,-O0
,-O1
nativeOptimizedCompile
,-O2
nativeCompile
-Ob
Runtime
Native
Language
N/A (Default)
Reproducers
ClassCastException
): coroutines-crash-reproducer-972.zipTo run:
Diagnosis Notes
2.0.0-RC3
1.5.13-dev-k2.0.0-RC1-50f08dfa4b4
(Android)0.11.0
1.8.0
0.23.2
Version
feat/entrypoint-v2-pt2