https://kotlinlang.org logo
Title
y

Yan Pujante

02/16/2021, 6:48 PM
I am seeing this exception (seems to depend on which build I am using)
Cause: cannot assign instance of java.util.Collections$EmptyList to field java.lang.StackTraceElement.moduleVersion of type java.lang.String in instance of java.lang.StackTraceElement
Any idea? I am using java15 / kotlin 1.4.30 / compose 0.3.0-build154. Is this combination the problem?
k

Kirill Grouchnikov

02/16/2021, 7:10 PM
Build time, run time, something else?
y

Yan Pujante

02/16/2021, 7:11 PM
run time. the window appears very briefly and the application stops and generates 3 files (Snap.xxx, javacore.xxx and another one)
i

Igor Demin

02/16/2021, 7:26 PM
On my machine with this configuration there is no error. Can you attach the full stacktrace? And the minimal reproducer?
y

Yan Pujante

02/16/2021, 7:32 PM
I just tried with a different configuration (java 15/ kotlin 1.4.21 / compose 0.3.0-build141) and I accidentally introduced a compilation error in my code (
@Composable invocations can only happen from the context of a @Composable function
) after which I get the same
cannot assign instance of java.util.Collections$EmptyList to field ...
error. That being said I just realized that this secondary exception happen ONLY in IDEA (Ultimate). It does NOT happen on the command line.
i

Igor Demin

02/16/2021, 7:39 PM
secondary exception happen ONLY in IDEA
So, it is not runtime? It is the error? https://youtrack.jetbrains.com/issue/IDEA-225881 If it is, can you update your IDEA, and Kotlin Plugin for IDEA?
y

Yan Pujante

02/16/2021, 7:42 PM
So I first saw the issue at runtime (with config1) then I saw the issue at compilation time (with config2 and error in my code). It is not an android project. It is a compose app. I am using the latest available version of IDE Ultimate (2020.3.2) which has the Kotlin plugin version 203-1.4.30-release-IJ7148.5
I am using java15 (openjdk version "15.0.2" 2021-01-19). I have not tried with oracle jdk. I am wondering if that could be an issue
So this is really weird. I tried again on the command line, outside the IDE and what I am seeing is a crash of the java vm! I tried with bot openjdk and the "source of truth" oracle jdk (java version "15.0.2" 2021-01-19), and both generates a hard crash of the java VM with core dump and all that... The fact that there is a stack trace is understandable. It is a little weird that it triggers a core dump of the VM... the latest stack trace I got was:
Current thread (0x00007fb186802600):  JavaThread "AWT-EventQueue-0" [_thread_in_native, id=121607, stack(0x000070000a0a0000,0x000070000a1a0000)]

Stack: [0x000070000a0a0000,0x000070000a1a0000],  sp=0x000070000a19e030,  free space=1016k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libsystem_platform.dylib+0x16f2]  _platform_strlen+0x12
C  [libobjc.A.dylib+0x2389]  objc_opt::objc_stringhash_t::getIndex(char const*) const+0x19
C  [libobjc.A.dylib+0x1f576]  search_builtins(char const*)+0x20
C  [libobjc.A.dylib+0x1f5c6]  __sel_registerName(char const*, bool, bool)+0x26
C  [libobjc.A.dylib+0xfe2a]  fixupMethodList(method_list_t*, bool, bool)+0x64
C  [libobjc.A.dylib+0x4ec5]  prepareMethodLists(objc_class*, method_list_t**, int, bool, bool)+0x88
C  [libobjc.A.dylib+0x18fdf]  realizeClassWithoutSwift(objc_class*)+0x6a2
C  [libobjc.A.dylib+0x1df49]  realizeClassMaybeSwiftMaybeRelock(objc_class*, mutex_tt<false>&, bool)+0x132
C  [libobjc.A.dylib+0x185d0]  initializeAndMaybeRelock(objc_class*, objc_object*, mutex_tt<false>&, bool)+0x5c
C  [libobjc.A.dylib+0x7690]  lookUpImpOrForward+0xe4
C  [libobjc.A.dylib+0x7114]  _objc_msgSend_uncached+0x44
C  [libskiko-macos-x64.dylib+0x6beccf]  Java_org_jetbrains_skiko_HardwareLayer_nativeInit+0x7f
j  org.jetbrains.skiko.HardwareLayer.nativeInit(J)V+0
j  org.jetbrains.skiko.HardwareLayer$init$1.invoke(J)V+8
j  org.jetbrains.skiko.HardwareLayer$init$1.invoke(Ljava/lang/Object;)Ljava/lang/Object;+8
j  org.jetbrains.skiko.AWTKt$useDrawingSurfacePlatformInfo$1.invoke(Lorg/jetbrains/skiko/DrawingSurfaceInfo;)Ljava/lang/Object;+17
j  org.jetbrains.skiko.AWTKt$useDrawingSurfacePlatformInfo$1.invoke(Ljava/lang/Object;)Ljava/lang/Object;+5
j  org.jetbrains.skiko.AWTKt.useDrawingSurfaceInfo(Ljava/awt/Component;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;+87
j  org.jetbrains.skiko.AWTKt.useDrawingSurfacePlatformInfo(Ljava/awt/Component;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;+24
j  org.jetbrains.skiko.HardwareLayer.init()V+15
j  org.jetbrains.skiko.SkiaLayer.init()V+1
j  androidx.compose.desktop.ComposeLayer$Wrapped.init()V+1
j  org.jetbrains.skiko.HardwareLayer.checkIsShowing()V+26
j  org.jetbrains.skiko.HardwareLayer.access$checkIsShowing(Lorg/jetbrains/skiko/HardwareLayer;)V+1
j  org.jetbrains.skiko.HardwareLayer$1.hierarchyChanged(Ljava/awt/event/HierarchyEvent;)V+22
j  java.awt.Component.processHierarchyEvent(Ljava/awt/event/HierarchyEvent;)V+34 java.desktop@15.0.2
j  java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+205 java.desktop@15.0.2
j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+496 java.desktop@15.0.2
j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2 java.desktop@15.0.2
j  java.awt.Component.createHierarchyEvents(ILjava/awt/Component;Ljava/awt/Container;JZ)I+71 java.desktop@15.0.2
j  java.awt.Container.createHierarchyEvents(ILjava/awt/Component;Ljava/awt/Container;JZ)I+48 java.desktop@15.0.2
j  java.awt.Container.createHierarchyEvents(ILjava/awt/Component;Ljava/awt/Container;JZ)I+48 java.desktop@15.0.2
j  java.awt.Container.createHierarchyEvents(ILjava/awt/Component;Ljava/awt/Container;JZ)I+48 java.desktop@15.0.2
j  java.awt.Container.createHierarchyEvents(ILjava/awt/Component;Ljava/awt/Container;JZ)I+48 java.desktop@15.0.2
j  java.awt.Container.createHierarchyEvents(ILjava/awt/Component;Ljava/awt/Container;JZ)I+48 java.desktop@15.0.2
j  java.awt.Component.show()V+57 java.desktop@15.0.2
j  java.awt.Window.show()V+48 java.desktop@15.0.2
j  java.awt.Component.show(Z)V+5 java.desktop@15.0.2
j  java.awt.Component.setVisible(Z)V+2 java.desktop@15.0.2
j  java.awt.Window.setVisible(Z)V+2 java.desktop@15.0.2
j  androidx.compose.desktop.ComposeWindow.setVisible(Z)V+10
j  androidx.compose.desktop.AppWindow.show(Landroidx/compose/runtime/CompositionContext;Lkotlin/jvm/functions/Function2;)V+65
j  androidx.compose.desktop.AppWindow.show$default(Landroidx/compose/desktop/AppWindow;Landroidx/compose/runtime/CompositionContext;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)V+11
j  androidx.compose.desktop.AppWindow_desktopKt$Window$1.run()V+72
j  java.awt.event.InvocationEvent.dispatch()V+47 java.desktop@15.0.2
j  java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+21 java.desktop@15.0.2
j  java.awt.EventQueue$4.run()Ljava/lang/Void;+32 java.desktop@15.0.2
j  java.awt.EventQueue$4.run()Ljava/lang/Object;+1 java.desktop@15.0.2
j  java.security.AccessController.executePrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/lang/Class;)Ljava/lang/Object;+29 java.base@15.0.2
j  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+13 java.base@15.0.2
j  java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+18 java.base@15.0.2
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46 java.desktop@15.0.2
j  java.awt.EventDispatchThread.pumpOneEventForFilters(I)V+78 java.desktop@15.0.2
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+35 java.desktop@15.0.2
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11 java.desktop@15.0.2
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 java.desktop@15.0.2
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 java.desktop@15.0.2
j  java.awt.EventDispatchThread.run()V+9 java.desktop@15.0.2
I suppose the stack trace is showing that it is the jni layer that is crashing and not the vm...
i

Igor Demin

02/18/2021, 4:17 PM
Your version of macOs is not the latest? We recently discovered that our latest build don't work on macOS Mojave. It crashes exactly with this stacktrace. We will fix this. Until then, you can upgrade your OS, or downgrade compose to build149
y

Yan Pujante

02/18/2021, 4:23 PM
that is correct I am on Mojave. I have been using 141 successfully and didn't know which version would be safe. I will try with 149 or just wait for the build that fixes it. Thank you.