- Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
Description
Describe the bug
When starting up the Mahogany wayland compositor, I'm getting a segmentation fault within code executed via CFFI. This doesn't occur with SBCL or CCL, so I'm assuming there's something in Clasp that is causing it.
Expected behavior
The application starts up without a segmentation fault. IIRC, mahogany has worked with Clasp in the past, although I'm not sure which version of Mahogany or Clasp it was.
Actual behavior
When running the application, a segmentation fault occurs. Here's the output of lldb when it crashes:
$ LD_LIBRARY_PATH=build/lib/ lldb -- clasp --non-interactive --load run-main.lisp ... Process 595631 stopped * thread #1, name = 'clasp', stop reason = signal SIGSEGV: invalid address (fault address: 0x0) frame #0: 0x00007fffeaf6ec40 libLLVM.so.19.1`llvm::DataLayout::clear() + 128 libLLVM.so.19.1`llvm::DataLayout::clear: -> 0x7fffeaf6ec40 <+128>: movq (%rdi,%r12), %rcx 0x7fffeaf6ec44 <+132>: orq %rax, %rcx 0x7fffeaf6ec47 <+135>: cmpq $-0x1000, %rcx ; imm = 0xF000 0x7fffeaf6ec4e <+142>: jne 0x7fffeaf6ec5b ; <+155> (lldb) bt * thread #1, name = 'clasp', stop reason = signal SIGSEGV: invalid address (fault address: 0x0) * frame #0: 0x00007fffeaf6ec40 libLLVM.so.19.1`llvm::DataLayout::clear() + 128 frame #1: 0x00007ffff70125e9 libclasp.so`llvm::DataLayout::operator=(this=<unavailable>, DL=<unavailable>) at DataLayout.h:205:5 frame #2: 0x00007fffc92fbdab libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol28330 + 539 frame #3: 0x00007fffc92eb6d3 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol28090 + 147 frame #4: 0x00007fffc9227812 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol27146 + 834 frame #5: 0x00007fffc91ae52d libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol26504 + 237 frame #6: 0x00007fffc91b2e13 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol26527 + 2163 frame #7: 0x00007fffc91e5e2e libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol26765 + 126 frame #8: 0x00007fffc91e94c3 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol26780 + 6595 frame #9: 0x00007fffc9835900 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol34625 + 1056 frame #10: 0x00007fffc984cba3 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol34649 + 563 frame #11: 0x00007fffc8f79f40 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol19790 + 12096 frame #12: 0x00007fffc8f7a97b libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol19791 + 443 frame #13: 0x00007fffc8f7b383 libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol19795 + 195 frame #14: 0x00007fffc89814ec libgallium-25.2.8-0ubuntu0.24.04.1.so`___lldb_unnamed_symbol4757 + 76 frame #15: 0x00007fffcc93c0d4 libwlroots-0.19.so`render_pass_submit(wlr_pass=0x0000555568221f80) at pass.c:60:3 frame #16: 0x00007fffcc9369f6 libwlroots-0.19.so`wlr_render_pass_submit(render_pass=0x0000555568221f80) at pass.c:14:9 frame #17: 0x00007fffcc97187b libwlroots-0.19.so`output_acquire_empty_buffer(output=0x0000555568675ca0, state=0x00007fffffffa170) at render.c:71:7 frame #18: 0x00007fffcc971a0a libwlroots-0.19.so`output_ensure_buffer(output=0x0000555568675ca0, state=0x00007fffffffa170, new_buffer=0x00007fffffffa16b) at render.c:124:30 frame #19: 0x00007fffcc970c3c libwlroots-0.19.so`wlr_output_commit_state(output=0x0000555568675ca0, state=0x00007fffffffa288) at output.c:776:7 frame #20: 0x00007ffff7fb4319 libheart.so`handle_new_output(listener=0x000055556327cb38, data=0x0000555568675ca0) at output.c:172:10 frame #21: 0x00007ffff5e8010c libwayland-server.so.0`wl_signal_emit_mutable(signal=<unavailable>, data=0x0000555568675ca0) at wayland-server.c:2332:3 frame #22: 0x00007fffcc95b747 libwlroots-0.19.so`new_output_reemit(listener=0x00005555645a0f78, data=0x0000555568675ca0) at backend.c:189:2 frame #23: 0x00007ffff5e8010c libwayland-server.so.0`wl_signal_emit_mutable(signal=<unavailable>, data=0x0000555568675ca0) at wayland-server.c:2332:3 frame #24: 0x00007fffcc9623e9 libwlroots-0.19.so`output_start(output=0x0000555568675ca0) at output.c:1147:2 frame #25: 0x00007fffcc9627d1 libwlroots-0.19.so`wlr_wl_output_create(wlr_backend=0x000055556593ce60) at output.c:1220:2 frame #26: 0x00007fffcc95d534 libwlroots-0.19.so`backend_start(backend=0x000055556593ce60) at backend.c:466:3 frame #27: 0x00007fffcc94500b libwlroots-0.19.so`wlr_backend_start(backend=0x000055556593ce60) at backend.c:57:10 frame #28: 0x00007fffcc95b0b1 libwlroots-0.19.so`multi_backend_start(wlr_backend=0x0000555568d2fdc0) at backend.c:31:8 frame #29: 0x00007fffcc94500b libwlroots-0.19.so`wlr_backend_start(backend=0x0000555568d2fdc0) at backend.c:57:10 frame #30: 0x00007ffff7fb5ab2 libheart.so`hrt_server_start(server=0x000055556327cae0) at server.c:108:10 frame #31: 0x00007fffd75c93bc JIT(0x555568c85000)`(CHAR (POINTER))-CALLER^KEYWORD^FN^^-lcl at -f89a97.repl-code:999902 frame #32: 0x00007fffd75c94a5 JIT(0x555568c85000)`(CHAR (POINTER))-CALLER^KEYWORD^FN^^-xep2 at -f89a97.repl-code:999909 frame #33: 0x00007fffd76e1c6c JIT(0x5555669b5000)`%%FOREIGN-FUNCALL^CROSS-CLASP.CLASP.CLASP-FFI^FN^^-lcl at -a0f788.fli.lisp:263:2 frame #34: 0x00007fffd76e1cf5 JIT(0x5555669b5000)`%%FOREIGN-FUNCALL^CROSS-CLASP.CLASP.CLASP-FFI^FN^^-xep at -a0f788.fli.lisp:262 Steps to reproduce
- Setup a build environment for the app as described in the readme
- Run it with SBCL just to check that it works: (
make run). Use theC-t qkeybinding to exit, or kill it in the terminal. - Run it with Clasp (
make LISP=clasp runNoExec)
Let me know if I should provide more detailed instructions.
Context
- Clasp commit: ffaf708. All the clasp build options are the defaults.
- Debug:
(declaim (optimize (debug 3))) - OS:
cat /etc/os-release NAME="Pop!_OS" VERSION="24.04 LTS" ID=pop ID_LIKE="ubuntu debian" PRETTY_NAME="Pop!_OS 24.04 LTS" VERSION_ID="24.04" HOME_URL="https://pop.system76.com" SUPPORT_URL="https://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=noble UBUNTU_CODENAME=noble LOGO=distributor-logo-pop-os - LLVM:
dpkg -l llvm-19 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-=========================-============-=========================================== ii llvm-19 1:19.1.1-1ubuntu1~24.04.2 amd64 Modular compiler and toolchain technologies Reactions are currently unavailable