Closed tonsky closed 10 months ago
This isn't actually AppX11::getScale
's fault. It's the fault of getScreen checking the bounding box, which apparently causes a crash.
Another stack trace, from a different library utilizing JWM
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ff4600bcf97, pid=17104, tid=17128
#
# JRE version: OpenJDK Runtime Environment (11.0.21+9) (build 11.0.21+9)
# Java VM: OpenJDK 64-Bit Server VM (11.0.21+9, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libjwm_x64.so+0x1bf97] jwm::WindowX11::getContentPosition(int&, int&)+0x27
#
# 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/bulby/Documents/GitHub/ModestUI/sample/core.17104)
#
# 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.
#
--------------- S U M M A R Y ------------
Command Line: Main
Host: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz, 8 cores, 7G, EndeavourOS Linux
Time: Mon Nov 27 17:22:43 2023 EST elapsed time: 148.441363 seconds (0d 0h 2m 28s)
--------------- T H R E A D ---------------
Current thread (0x00007ff478761000): JavaThread "io-compute-3" daemon [_thread_in_native, id=17128, stack(0x00007ff44a5ff000,0x00007ff44a6ff000)]
Stack: [0x00007ff44a5ff000,0x00007ff44a6ff000], sp=0x00007ff44a6fc2a0, free space=1012k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libjwm_x64.so+0x1bf97] jwm::WindowX11::getContentPosition(int&, int&)+0x27
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 1851 io.github.humbleui.jwm.WindowX11._nGetScreen()Lio/github/humbleui/jwm/Screen; (0 bytes) @ 0x00007ff46819e5f8 [0x00007ff46819e5c0+0x0000000000000038]
J 1766 c1 io.github.humbleui.jwm.WindowX11.getScreen()Lio/github/humbleui/jwm/Screen; (25 bytes) @ 0x00007ff460ecd454 [0x00007ff460ecd3c0+0x0000000000000094]
J 1811 c2 cats.effect.IOFiber.runLoop(Lcats/effect/IO;II)V (4067 bytes) @ 0x00007ff468182dbc [0x00007ff4681812a0+0x0000000000001b1c]
J 1699 c1 cats.effect.IOFiber.execR()V (96 bytes) @ 0x00007ff460ea302c [0x00007ff460ea2b40+0x00000000000004ec]
J 1624 c1 cats.effect.IOFiber.run()V (113 bytes) @ 0x00007ff460e85f1c [0x00007ff460e85880+0x000000000000069c]
v ~StubRoutines::call_stub
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 gay.menkissing.modestui.App$.start$$anonfun$1$$anonfun$1(Lcats/effect/kernel/Resource;Lcats/effect/kernel/Async;Lcats/effect/std/Dispatcher;)V+9
j gay.menkissing.modestui.App$.$anonfun$adapted$1(Lcats/effect/kernel/Resource;Lcats/effect/kernel/Async;Lcats/effect/std/Dispatcher;)Ljava/lang/Object;+4
j gay.menkissing.modestui.App$$$Lambda$252.apply()Ljava/lang/Object;+16
j cats.effect.IOFiber.runLoop(Lcats/effect/IO;II)V+1344
j cats.effect.IOFiber.execR()V+92
j cats.effect.IOFiber.run()V+61
j cats.effect.unsafe.WorkerThread.run()V+1385
v ~StubRoutines::call_stub
Thanks! Any ideas how to fix?
I think X11 has a "XGetWindowAttributes" that returns a struct containing a back pointer to the screen. Docs: https://www.x.org/releases/X11R7.7/doc/man/man3/XGetWindowAttributes.3.xhtml
This function also returns the root window, so I think translate coords can still work
Experienced on: