compose-multiplatform
compose-multiplatform copied to clipboard
Fatal error during Windows desktop run
Hi team. I used 0.4.0-build184 build 1.4.32 kotlin version. And in two of three runs have crash.
Crash reports in attachment. Command line part omitted. hs_err_pid6104.log hs_err_pid18996.log Code to reproduce:
@Composable
internal fun HorizontalScrollbarContainer(
modifier: Modifier = Modifier,
content: @Composable (horizontalScrollState: ScrollState) -> Unit
) = Box(
modifier = modifier.fillMaxSize()
) {
val horizontalScrollState = rememberScrollState(0)
content(horizontalScrollState)
HorizontalScrollbar(
modifier = Modifier
.align(Alignment.BottomCenter)
.fillMaxWidth(),
adapter = rememberScrollbarAdapter(horizontalScrollState)
)
}
@Composable
fun Item(index: Int) = Row(
modifier = Modifier
.wrapContentHeight()
.padding(start = 30.dp * index)
.fillMaxWidth()
) {
Text("Item $index")
}
@Composable
fun LazyColumnView(
modifier: Modifier = Modifier.fillMaxSize()
) = HorizontalScrollbarContainer(modifier) { horizontalScrollState ->
LazyColumn(
modifier.horizontalScroll(horizontalScrollState)
) {
items(300) { index ->
Item(index)
}
}
}
fun main() = Window(
"2 of 3"
) {
MaterialTheme {
DesktopTheme {
LazyColumnView()
}
}
}
Seems crash is in
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.makeDirectXRenderTarget(JII)J+0
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.makeRenderTarget(JII)Lorg/jetbrains/skija/BackendRenderTarget;+9
j org.jetbrains.skiko.context.Direct3DContextHandler.initCanvas()V+55
j org.jetbrains.skiko.SkiaLayer.draw()V+83
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.draw()V+4
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.redrawImmediately()V+57
j org.jetbrains.skiko.SkiaLayer.paint(Ljava/awt/Graphics;)V+77
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 java.desktop@15
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+318 java.desktop@15
j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73 java.desktop@15
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 java.desktop@15
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+318 java.desktop@15
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 java.desktop@15
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+318 java.desktop@15
What is your video card?
Intel(R) HD Graphics 4400 But I don't think it connected with card. Cause in one of three runs it run fine.
Try to run your application with OpenGL rendering, example code:
fun main() {
System.setProperty("skiko.renderApi", "OPENGL")
Window(
... // your window settings
) {
... // your content
}
}
Tried. Works cool. I have zero crashes for 7 runs.
Hello,
I also got the same EXCEPTION_UNCAUGHT_CXX_EXCEPTION error when my Composer Desktop program was running with my Intel graphics chipset (Intel HD Graphics 4600 chipset to be precise). During the day, I searched on the internet for the EXCEPTION_UNCAUGHT_CXX_EXCEPTION error code, and I indeed found one (and only one) result that indicated the mood incompatibility between intel chipsets (I say them, but I don't know if all are concerned) and the applications developed with this framework.
I thought I would open an issue if none was already open on this subject, so I searched for "intel" in the already open issues and I found this one.
So I took the opportunity to test @Rsedaikin solution, and yes, it works.
So why this message ?
Several reasons :
- First, to indicate that this problem is still present (and should be fixed, if only by forcing the use of OpenGL by default if the chipset is not compatible)
- Then, to confirm that the solution works for all those who would have the same problem
- And finally to add the code of this error to this issue that simply explains how to solve it, because by just searching with the error code in the issues or on google, we do not come across this topic. And I thought that was a shame. I just hope that the indexing bots will do their job for future people who, like me, have already struggled to find the java runtime error code and want to solve their problem.
Update
v1.2.1 resolved the issue for me (see this pull request and this related issue).
I also have this problem when running the plain compose desktop project created by IntelliJ.
I'm currently using the workaround above suggested by @Rsedaikin.
This is the system the program is running on:
- OS: Windows 10
- Integrated graphics card: Intel® HD Graphics 4600
- Dedicated graphics card: AMD Radeon R7 M265
- Jetbrains compose: 1.0.0
- Kotlin: 1.5.31
- IntelliJ IDEA 2021.3:
IntelliJ IDEA 2021.3 (Community Edition) Build #IC-213.5744.223, built on November 27, 2021 Runtime version: 11.0.13+7-b1751.19 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1469M Cores: 8 Registry: debugger.click.disable.breakpoints=true Non-Bundled Plugins: [...] org.jetbrains.kotlin (213-1.6.10-release-923-IJ5744.223) Kotlin: 213-1.6.10-release-923-IJ5744.223
The error log
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fffddca588c, pid=11104, tid=10656
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.9.1+1) (build 11.0.9.1+1)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (11.0.9.1+1, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [skiko-windows-x64.dll+0x5588c]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
Command Line: -javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3\lib\idea_rt.jar=13471:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3\bin -Dfile.encoding=UTF-8 MainKt
Host: Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz, 8 cores, 7G, Windows 10 , 64 bit Build 19041 (10.0.19041.1348)
--------------- T H R E A D ---------------
Current thread (0x000001d6c540a000): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=10656, stack(0x000000afa5700000,0x000000afa5800000)]
Stack: [0x000000afa5700000,0x000000afa5800000], sp=0x000000afa57f9f10, free space=999k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [skiko-windows-x64.dll+0x5588c]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.makeDirectXSurface(JJIII)J+0
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.makeSurface(JIII)Lorg/jetbrains/skia/Surface;+15
j org.jetbrains.skiko.context.Direct3DContextHandler.initCanvas()V+160
j org.jetbrains.skiko.context.ContextHandler.draw()V+21
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.drawAndSwap(Z)V+27
j org.jetbrains.skiko.redrawer.Direct3DRedrawer.redrawImmediately()V+148
j org.jetbrains.skiko.SkiaLayer.paint(Ljava/awt/Graphics;)V+88
j androidx.compose.ui.awt.ComposeLayer$ComponentImpl.paint(Ljava/awt/Graphics;)V+12
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 [email protected]
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+318 [email protected]
j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73 [email protected]
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 [email protected]
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+318 [email protected]
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 [email protected]
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+318 [email protected]
j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73 [email protected]
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+523 [email protected]
j javax.swing.JComponent.paintToOffscreen(Ljava/awt/Graphics;IIIIII)V+72 [email protected]
j javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(Ljavax/swing/JComponent;Ljava/awt/Image;Ljava/awt/Graphics;IIII)V+163 [email protected]
j javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Ljavax/swing/JComponent;Ljava/awt/Image;Ljava/awt/Graphics;IIII)V+46 [email protected]
j javax.swing.RepaintManager$PaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)Z+128 [email protected]
j javax.swing.RepaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)V+51 [email protected]
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+221 [email protected]
j java.awt.GraphicsCallback$PaintCallback.run(Ljava/awt/Component;Ljava/awt/Graphics;)V+2 [email protected]
j sun.awt.SunGraphicsCallback.runOneComponent(Ljava/awt/Component;Ljava/awt/Rectangle;Ljava/awt/Graphics;Ljava/awt/Shape;I)V+155 [email protected]
j sun.awt.SunGraphicsCallback.runComponents([Ljava/awt/Component;Ljava/awt/Graphics;I)V+157 [email protected]
j java.awt.Container.paint(Ljava/awt/Graphics;)V+58 [email protected]
j java.awt.Window.paint(Ljava/awt/Graphics;)V+68 [email protected]
j javax.swing.RepaintManager$4.run()Ljava/lang/Void;+142 [email protected]
j javax.swing.RepaintManager$4.run()Ljava/lang/Object;+1 [email protected]
v ~StubRoutines::call_stub
j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0 [email protected]
j java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+18 [email protected]
j javax.swing.RepaintManager.paintDirtyRegions(Ljava/util/Map;)V+154 [email protected]
j javax.swing.RepaintManager.paintDirtyRegions()V+46 [email protected]
j javax.swing.RepaintManager.prePaintDirtyRegions()V+73 [email protected]
j javax.swing.RepaintManager$ProcessingRunnable.run()V+37 [email protected]
j java.awt.event.InvocationEvent.dispatch()V+47 [email protected]
j java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+21 [email protected]
j java.awt.EventQueue$4.run()Ljava/lang/Void;+32 [email protected]
j java.awt.EventQueue$4.run()Ljava/lang/Object;+1 [email protected]
v ~StubRoutines::call_stub
j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0 [email protected]
j java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+18 [email protected]
j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46 [email protected]
j java.awt.EventDispatchThread.pumpOneEventForFilters(I)V+78 [email protected]
j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+35 [email protected]
j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11 [email protected]
j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 [email protected]
j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 [email protected]
j java.awt.EventDispatchThread.run()V+9 [email protected]
v ~StubRoutines::call_stub
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000
Register to memory mapping:
[...]
I used to have no problem running my app before version v1.2.0-alpha01-dev770 . When I tried v1.2.0-alpha01-dev770 or now, v1.2.0-alpha01-dev774, the application fails to run with:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffab1886716, pid=1264, tid=9704
#
# JRE version: OpenJDK Runtime Environment (11.0.12+7) (build 11.0.12+7-b1504.28-7817840)
# Java VM: OpenJDK 64-Bit Server VM (11.0.12+7-b1504.28-7817840, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [skiko-windows-x64.dll+0x56716]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
But thankfully, after trying out:
...Try to run your application with OpenGL rendering, example code:
System.setProperty("skiko.renderApi", "OPENGL")
the issue disappeared.