HumbleUI / HumbleUI/JWM

"empty" example crashes using LayerRasterSkija in Linux

Open
#315 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
643
Forks
51
PR merge metrics
No merged PRs in 30d

Description

When on Linux box, and using the `LayerRasterSkija`, rather than the default `LayerGLSkija` class, the "empty" example crashes at runtime.

Here are the relevant code of the "empty" example:
https://github.com/HumbleUI/JWM/blob/d5fe7cb75892280b58fd39c93374fe81a1326939/examples/empty/java/Example.java#L18-L22

The above code is working fine in Linux, because the `LayerGLSkija` class works fine so the `LayerRasterSkija` never has a chance to be used.

But when you deliberately force the `LayerRasterSkija` class to be used, like this change:
```java
// try {
// window.setLayer(new LayerGLSkija());
// } catch (Throwable e) {
window.setLayer(new LayerRasterSkija());
// }
```
then the JVM would crash at runtime when trying to create a new instance of `LayerRasterSkija` class (?), and produce a crash log file.

The relevant info in the crash's log are here:
```
...
Stack: [0x00007e67a4f00000,0x00007e67a5000000], sp=0x00007e67a4ffde58, free space=1015k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libX11.so.6+0x282b4] XInitImage+0x4
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j io.github.humbleui.jwm.LayerRaster._nResize(II)V+0
j io.github.humbleui.jwm.LayerRaster.resize(II)V+35
j io.github.humbleui.jwm.skija.LayerRasterSkija.resize(II)V+22
j io.github.humbleui.jwm.Window.accept(Lio/github/humbleui/jwm/Event;)V+50
j io.github.humbleui.jwm.Window.accept(Lio/github/humbleui/jwm/Event;)V+115
j io.github.humbleui.jwm.Window.setLayer(Lio/github/humbleui/jwm/Layer;)Lio/github/humbleui/jwm/Window;+63
j io.github.humbleui.jwm.examples.Example.()V+41
j io.github.humbleui.jwm.examples.Example.lambda$main$0()V+4
j io.github.humbleui.jwm.examples.Example$$Lambda+0x0000000064041578.run()V+0
j io.github.humbleui.jwm.App.lambda$start$1(Ljava/lang/ClassLoader;Ljava/lang/Runnable;)V+43
j io.github.humbleui.jwm.App$$Lambda+0x00000000640491e0.run()V+8
v ~StubRoutines::call_stub 0x00007e678f85ffa6
j io.github.humbleui.jwm.App._nStart(Ljava/lang/Runnable;)V+0
j io.github.humbleui.jwm.App.start(Ljava/lang/Runnable;)V+17
j io.github.humbleui.jwm.examples.Example.main([Ljava/lang/String;)V+5
v ~StubRoutines::call_stub 0x00007e678f85ffa6

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000028
...
```

Any idea what happens? This crash only happens in Linux; the Windows box works fine for both `LayerRasterSkija` and `LayerGLSkija` classes.

(I don't know about the Mac box.)

In fact, the issue happens to all/any subclass of `LayerRaster`, not just the Skija one. This is how I discovered the issue which happened in my "graphics2d" example in Linux :-(

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with examples/empty/java/Example.java and reproduce the crash while forcing LayerRasterSkija. Trace LayerRaster._nResize through LayerRaster.resize and LayerRasterSkija.resize, using the Linux X11 crash log as the entry point. Done means LayerRaster subclasses no longer crash on Linux when the empty example creates and resizes a layer.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, linux
Domain
computer-graphics, desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.