question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rare SIGSEGV on Linux in `todoapp` example

See original GitHub issue

I accidentally found a rare bug while running the todoapp example. It may not be related to compose or skia, but I still think it might be useful for users who have the same problem.

All tests were done inside VirtualBox, so they should be reproducible.

Bug (only in todoapp example)

Bug happens when ./gradlew :desktop:run called, web works fine.

Error message (may vary depending on the JDK):

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f7d4fa364b8, pid=5292, tid=5293
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (16.0.1+9) (build 16.0.1+9)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (16.0.1+9, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, serial gc, linux-amd64)
# Problematic frame:
# C  0x00007f7d4fa364b8
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/composetest/Downloads/compose-jb-master/examples/todoapp/desktop/core.5292)
#
# An error report file with more information is saved as:
# /home/composetest/Downloads/compose-jb-master/examples/todoapp/desktop/hs_err_pid5292.log
#
# 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.
#

Bug happens in EndeavourOS (arch distro) only in Cinnamon desktop environment (potentially in all GNOME environments) only using OpenJDK/AdoptOpenJDK 16.

Bug DOES NOT happen (tested in VirtualBox) in

  • Ubuntu 20.04.3
  • Linux Mint 20.3 (Cinnamon)
  • EndeavourOS KDE Plasma
  • EndeavourOS Cinnamon using OpenJDK 17 or using Zulu, Corretto, Liberica JDK 16

Other arch distros with GNOME environments were not tested. So the issue can be broader.

I attached some logs produced in EndeavourOS Cinnamon using OpenJDK (16.0.1 and 16.0.2), AdoptOpenJDK (16.0.1, hs and j9). endeavouros-cinnamon-error.zip

How to reproduce:

  1. latest EndeavourOS image should be chosen cinnamon during the installment.
  2. OpenJDK 16 or AdoptOpenJDK 16 (can easily be installed using https://sdkman.io/). For example:
    • sdk install java 16.0.2-open
    • sdk install java 16.0.1.hs-adpt
    • sdk install java 16.0.1.j9-adpt
  3. download and run todoapp example: ./gradlew :desktop:run

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
olonhocommented, Jan 21, 2022

Crash looks like this on JVM side

j  com.sun.java.swing.plaf.gtk.GTKStyle.nativeGetXThickness(I)I+0 java.desktop@16.0.1
j  com.sun.java.swing.plaf.gtk.GTKStyle.<init>(Ljava/awt/Font;Lcom/sun/java/swing/plaf/gtk/GTKEngine$WidgetType;)V+24 java.desktop@16.0.1
j  com.sun.java.swing.plaf.gtk.GTKStyleFactory.getStyle(Ljavax/swing/JComponent;Ljavax/swing/plaf/synth/Region;)Ljavax/swing/plaf/synth/SynthStyle;+310 java.desktop@16.0.1
j  com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initSystemColorDefaults(Ljavax/swing/UIDefaults;)V+53 java.desktop@16.0.1
j  com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getDefaults()Ljavax/swing/UIDefaults;+33 java.desktop@16.0.1
j  javax.swing.UIManager.setLookAndFeel(Ljavax/swing/LookAndFeel;)V+66 java.desktop@16.0.1
j  javax.swing.UIManager.setLookAndFeel(Ljava/lang/String;)V+34 java.desktop@16.0.1
j  org.jetbrains.skiko.Setup.init(ZZZZZ)V+58
j  org.jetbrains.skiko.Setup.init$default(Lorg/jetbrains/skiko/Setup;ZZZZZILjava/lang/Object;)V+126
j  org.jetbrains.skiko.Library.load()V+27
j  org.jetbrains.skia.impl.Library$Companion.staticLoad()V+15
j  androidx.compose.ui.ConfigureSwingGlobalsForCompose_desktopKt.configureSwingGlobalsForCompose(ZZZ)V+33
j  androidx.compose.ui.ConfigureSwingGlobalsForCompose_desktopKt.configureSwingGlobalsForCompose$default(ZZZILjava/lang/Object;)V+60
j  androidx.compose.ui.window.Application_desktopKt.application(ZLkotlin/jvm/functions/Function3;)V+27
j  androidx.compose.ui.window.Application_desktopKt.application$default(ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)V+10
j  example.todo.desktop.MainKt.main()V+67
j  example.todo.desktop.MainKt.main([Ljava/lang/String;)V+0
v  ~StubRoutines::call_stub

and native has

stack at sp + 0 slots: 0x00007fd5548f4f97: hb_face_reference_table+0x0000000000000017 in /home/composetest/.sdkman/candidates/java/16.0.1-open/lib/libharfbuzz.so at 0x00007fd5548c6000

so could be an issue with two libharfbuzz.so (/home/composetest/.sdkman/candidates/java/16.0.1-open/lib/libharfbuzz.so vs /usr/lib/libharfbuzz.so.0).

@AzimMuradov could you try to run with property skiko.rendering.laf.global set to false?

0reactions
AzimMuradovcommented, Jan 25, 2022

Thanks for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SIGSEGV: Linux Segmentation Fault | Signal 11, Exit code 139
SIGSEGV, also known as a segmentation violation or segmentation fault, is a signal used by Unix-based operating systems (such as Linux).
Read more >
How to catch segmentation fault in Linux? - Stack Overflow
Normally, when your program performs a segmentation fault, it is sent a SIGSEGV signal. You can set up your own ... Here's an...
Read more >
Segmentation Fault in Linux Containers (exit code 139)
The SIGSEGV Linux signal denotes a segmentation violation within a running process. Segmentation errors occur when a program tries to access memory that ......
Read more >
Segmentation Fault in Linux | Baeldung on Linux
In a nutshell, segmentation fault refers to errors due to a process's attempts to access memory regions that it shouldn't. When the kernel ......
Read more >
Why Does The Segmentation Fault Occur on Linux / UNIX ...
Further readings: Read about the Segmentation fault in Wikipedia. Signal 11 while compiling the kernel. Example Debugging Session: Segmentation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found