~adnano/wmenu-devel

3 2

Segfault using wmenu 0.1.7

Details
Message ID
<aecd59d2-096a-4ed3-ae2b-7b035a312963@sydneymeyer.net>
DKIM signature
pass
Download raw message
Hello all,

i might be running into the same/similar issue.

I'm running NixOS, i.e. retaining debug symbols is a bit of an issue for 
me. Nonetheless, i managed to save the following coredump and debug 
output from wmenu. Perhaps there is useful information in there.

This is with Linux 6.8-rc7, Mesa 24.0.2, Wayland 1.22, Sway 1.9, wlroots 
0.17.1. Downgrading to wmenu 0.1.6 also remediates the issue here.

This is 100% reproducible at the start of a session, and _always_ goes 
away/starts working after some time into the session, but i'm unable to 
tell what it is, (tried fiddeling with enabling/disabling outputs, 
re-importing dbus-variables, etc.) that makes it work correctly again 
after some "time".


### Coredump:

Process 50889 (wmenu) of user 1000 dumped core.

                 Module libbrotlicommon.so.1 without build-id.
                 Module libgraphite2.so.3 without build-id.
                 Module libdatrie.so.1 without build-id.
                 Module libselinux.so.1 without build-id.
                 Module libpcre2-8.so.0 without build-id.
                 Module libXdmcp.so.6 without build-id.
                 Module libXau.so.6 without build-id.
                 Module libexpat.so.1 without build-id.
                 Module libbrotlidec.so.1 without build-id.
                 Module libbz2.so.1 without build-id.
                 Module libpangoft2-1.0.so.0 without build-id.
                 Module libffi.so.8 without build-id.
                 Module libharfbuzz.so.0 without build-id.
                 Module libthai.so.0 without build-id.
                 Module libfribidi.so.0 without build-id.
                 Module libxcb-shm.so.0 without build-id.
                 Module libxcb-render.so.0 without build-id.
                 Module libxcb.so.1 without build-id.
                 Module libXrender.so.1 without build-id.
                 Module libXext.so.6 without build-id.
                 Module libX11.so.6 without build-id.
                 Module libfreetype.so.6 without build-id.
                 Module libfontconfig.so.1 without build-id.
                 Module libpng16.so.16 without build-id.
                 Module libz.so.1 without build-id.
                 Module libxkbcommon.so.0 without build-id.
                 Module libpangocairo-1.0.so.0 without build-id.
                 Module libpango-1.0.so.0 without build-id.
                 Module wmenu without build-id.
                 Stack trace of thread 50889:
                 #0  0x00007fda65fbf820 wl_proxy_get_version 
(libwayland-client.so.0 + 0x8820)
                 #1  0x0000000000404b23 wl_data_offer_destroy (wmenu + 
0x4b23)
                 #2  0x00000000004059b1 menu_destroy (wmenu + 0x59b1)
                 #3  0x000000000040437f main (wmenu + 0x437f)
                 #4  0x00007fda65db00ce __libc_start_call_main 
(libc.so.6 + 0x280ce)
                 #5  0x00007fda65db0189 __libc_start_main@@GLIBC_2.34 
(libc.so.6 + 0x28189)
                 #6  0x00000000004036d5 _start (wmenu + 0x36d5)
                 ELF object binary architecture: AMD x86-64

GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
     <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from 
/nix/store/am782yq34dadxp2wnkq68ys935c82w5r-wmenu-0.1.7/bin/wmenu...

warning: Can't open file /dev/shm/wmenu-eBJPfN (deleted) during 
file-backed mapping note processing

warning: Can't open file /dev/shm/wmenu-KLfmiM (deleted) during 
file-backed mapping note processing
[New LWP 50889]
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/nix/store/ksk3rnb0ljx8gngzk19jlmbjyvac4hw6-glibc-2.38-44/lib/libthread_db.so.1".
Core was generated by `./wmenu -i'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fda65fbf820 in wl_proxy_get_version () from 
/nix/store/aw46mj49gr2x97hljgsg9wfizgf9l8is-wayland-1.22.0/lib/libwayland-client.so.0
(gdb) bt full
#0  0x00007fda65fbf820 in wl_proxy_get_version () from 
/nix/store/aw46mj49gr2x97hljgsg9wfizgf9l8is-wayland-1.22.0/lib/libwayland-client.so.0
No symbol table info available.
#1  0x0000000000404b23 in wl_data_offer_destroy (wl_data_offer=0x0) at 
/nix/store/qljvpa4lhj2qsnfsdwbai99lqjs81bqs-wayland-1.22.0-dev/include/wayland-client-protocol.h:2267
No locals.
#2  0x00000000004059b1 in menu_destroy (menu=menu@entry=0x23d9f00) at 
../menu.c:743
No locals.
#3  0x000000000040437f in main (argc=<optimized out>, 
argv=0x7fff402bee88) at ../main.c:319
         menu = 0x23d9f00
         fds = {{fd = 3, events = 1, revents = 1}, {fd = 4, events = 1, 
revents = 0}}
         nfds = 2
         failure = false
(gdb)


### Debug Output (from searching "calc" and executing "gnome-calculator":

[sydney@fw:~/result/bin]$ dmenu_path|./wmenu -i
[4000057.475]  -> wl_display@1.get_registry(new id wl_registry@2)
[4000057.497]  -> wl_display@1.sync(new id wl_callback@3)
[4000057.695] wl_display@1.delete_id(3)
[4000057.715] wl_registry@2.global(1, "wl_shm", 1)
[4000057.726]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@4)
[4000057.734] wl_registry@2.global(2, "wl_drm", 2)
[4000057.741] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[4000057.746] wl_registry@2.global(4, "wl_compositor", 6)
[4000057.754]  -> wl_registry@2.bind(4, "wl_compositor", 4, new id 
[unknown]@5)
[4000057.762] wl_registry@2.global(5, "wl_subcompositor", 1)
[4000057.768] wl_registry@2.global(6, "wl_data_device_manager", 3)
[4000057.776]  -> wl_registry@2.bind(6, "wl_data_device_manager", 3, new 
id [unknown]@6)
[4000057.783] wl_registry@2.global(7, "zwlr_gamma_control_manager_v1", 1)
[4000057.790] wl_registry@2.global(8, "zxdg_output_manager_v1", 3)
[4000057.797] wl_registry@2.global(9, "ext_idle_notifier_v1", 1)
[4000057.804] wl_registry@2.global(10, "zwp_idle_inhibit_manager_v1", 1)
[4000057.813] wl_registry@2.global(11, "zwlr_layer_shell_v1", 4)
[4000057.821]  -> wl_registry@2.bind(11, "zwlr_layer_shell_v1", 1, new 
id [unknown]@7)
[4000057.828] wl_registry@2.global(12, "xdg_wm_base", 2)
[4000057.835] wl_registry@2.global(13, "zwp_tablet_manager_v2", 1)
[4000057.841] wl_registry@2.global(14, 
"org_kde_kwin_server_decoration_manager", 1)
[4000057.848] wl_registry@2.global(15, "zxdg_decoration_manager_v1", 1)
[4000057.854] wl_registry@2.global(16, "zwp_relative_pointer_manager_v1", 1)
[4000057.862] wl_registry@2.global(17, "zwp_pointer_constraints_v1", 1)
[4000057.868] wl_registry@2.global(18, "wp_presentation", 1)
[4000057.874] wl_registry@2.global(19, "zwlr_output_manager_v1", 4)
[4000057.881] wl_registry@2.global(20, "zwlr_output_power_manager_v1", 1)
[4000057.887] wl_registry@2.global(21, "zwp_input_method_manager_v2", 1)
[4000057.893] wl_registry@2.global(22, "zwp_text_input_manager_v3", 1)
[4000057.900] wl_registry@2.global(23, 
"zwlr_foreign_toplevel_manager_v1", 3)
[4000057.909] wl_registry@2.global(24, "ext_session_lock_manager_v1", 1)
[4000057.916] wl_registry@2.global(25, "wp_drm_lease_device_v1", 1)
[4000057.922] wl_registry@2.global(26, "zwlr_export_dmabuf_manager_v1", 1)
[4000057.929] wl_registry@2.global(27, "zwlr_screencopy_manager_v1", 3)
[4000057.938] wl_registry@2.global(28, "zwlr_data_control_manager_v1", 2)
[4000057.945] wl_registry@2.global(29, "wp_security_context_manager_v1", 1)
[4000057.951] wl_registry@2.global(30, "wp_viewporter", 1)
[4000057.958] wl_registry@2.global(31, 
"wp_single_pixel_buffer_manager_v1", 1)
[4000057.966] wl_registry@2.global(32, "wp_content_type_manager_v1", 1)
[4000057.973] wl_registry@2.global(33, "wp_fractional_scale_manager_v1", 1)
[4000057.979] wl_registry@2.global(34, "zxdg_exporter_v1", 1)
[4000058.011] wl_registry@2.global(35, "zxdg_importer_v1", 1)
[4000058.017] wl_registry@2.global(36, "zxdg_exporter_v2", 1)
[4000058.023] wl_registry@2.global(37, "zxdg_importer_v2", 1)
[4000058.029] wl_registry@2.global(38, "xdg_activation_v1", 1)
[4000058.036] wl_registry@2.global(39, "wp_cursor_shape_manager_v1", 1)
[4000058.043] wl_registry@2.global(40, "zwp_virtual_keyboard_manager_v1", 1)
[4000058.050] wl_registry@2.global(41, "zwlr_virtual_pointer_manager_v1", 2)
[4000058.057] wl_registry@2.global(42, "zwlr_input_inhibit_manager_v1", 1)
[4000058.067] wl_registry@2.global(43, 
"zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[4000058.073] wl_registry@2.global(44, "zwp_pointer_gestures_v1", 3)
[4000058.080] wl_registry@2.global(45, "wl_seat", 8)
[4000058.088]  -> wl_registry@2.bind(45, "wl_seat", 4, new id [unknown]@8)
[4000058.097] wl_registry@2.global(47, 
"zwp_primary_selection_device_manager_v1", 1)
[4000058.104] wl_registry@2.global(48, "wl_output", 4)
[4000058.111]  -> wl_registry@2.bind(48, "wl_output", 4, new id [unknown]@9)
[4000058.119] wl_registry@2.global(49, "wl_output", 4)
[4000058.126]  -> wl_registry@2.bind(49, "wl_output", 4, new id 
[unknown]@10)
[4000058.134] wl_callback@3.done(161)
[4000058.141]  -> wl_data_device_manager@6.get_data_device(new id 
wl_data_device@3, wl_seat@8)
[4000058.150]  -> wl_display@1.sync(new id wl_callback@11)
[4000058.368] wl_display@1.delete_id(11)
[4000058.390] wl_seat@8.name("seat0")
[4000058.399] wl_seat@8.capabilities(3)
[4000058.407]  -> wl_seat@8.get_keyboard(new id wl_keyboard@12)
[4000058.497] wl_output@9.geometry(0, 0, 280, 190, 0, "BOE", "0x0BCA", 0)
[4000058.508] wl_output@9.mode(1, 2256, 1504, 59999)
[4000058.516] wl_output@9.scale(2)
[4000058.522] wl_output@9.name("eDP-1")
[4000058.529] wl_output@9.description("BOE 0x0BCA (eDP-1)")
[4000058.535] wl_output@9.done()
[4000058.542] wl_output@10.geometry(0, 0, 600, 340, 0, "Dell Inc.", 
"DELL U2722D", 0)
[4000058.552] wl_output@10.mode(1, 2560, 1440, 59951)
[4000058.559] wl_output@10.scale(1)
[4000058.567] wl_output@10.name("DP-3")
[4000058.573] wl_output@10.description("Dell Inc. DELL U2722D HTL7V83 
(DP-3 via HDMI)")
[4000058.579] wl_output@10.done()
[4000058.585] wl_callback@11.done(161)
[4000058.593]  -> wl_compositor@5.create_surface(new id wl_surface@11)
[4000058.602]  -> zwlr_layer_shell_v1@7.get_layer_surface(new id 
zwlr_layer_surface_v1@13, wl_surface@11, nil, 2, "menu")
[4000058.611]  -> zwlr_layer_surface_v1@13.set_anchor(13)
[4000058.618]  -> zwlr_layer_surface_v1@13.set_size(0, 22)
[4000058.625]  -> zwlr_layer_surface_v1@13.set_exclusive_zone(-1)
[4000058.632]  -> zwlr_layer_surface_v1@13.set_keyboard_interactivity(1)
[4000058.639]  -> wl_surface@11.commit()
[4000058.647]  -> wl_display@1.sync(new id wl_callback@14)
[4000058.889] wl_display@1.delete_id(14)
[4000058.908] wl_keyboard@12.keymap(1, fd 5, 66450)
[4000063.232] wl_keyboard@12.repeat_info(25, 600)
[4000063.250] wl_surface@11.enter(wl_output@10)
[4000063.259] zwlr_layer_surface_v1@13.configure(163, 2560, 22)
[4000063.267]  -> zwlr_layer_surface_v1@13.ack_configure(163)
[4000063.276] zwlr_layer_surface_v1@13.configure(165, 2560, 22)
[4000063.283]  -> zwlr_layer_surface_v1@13.ack_configure(165)
[4000063.290] wl_callback@14.done(165)
[4000063.527]  -> wl_shm@4.create_pool(new id wl_shm_pool@14, fd 6, 225280)
[4000063.540]  -> wl_shm_pool@14.create_buffer(new id wl_buffer@15, 0, 
2560, 22, 10240, 0)
[4000063.550]  -> wl_shm_pool@14.destroy()
[4000063.887]  -> wl_surface@11.set_buffer_scale(1)
[4000063.896]  -> wl_surface@11.attach(wl_buffer@15, 0, 0)
[4000063.904]  -> wl_surface@11.damage(0, 0, 2560, 22)
[4000063.910]  -> wl_surface@11.commit()
[4000093.647]  -> wl_shm@4.create_pool(new id wl_shm_pool@16, fd 7, 225280)
[4000093.693]  -> wl_shm_pool@16.create_buffer(new id wl_buffer@17, 0, 
2560, 22, 10240, 0)
[4000093.702]  -> wl_shm_pool@16.destroy()
[4000095.055]  -> wl_surface@11.set_buffer_scale(1)
[4000095.067]  -> wl_surface@11.attach(wl_buffer@17, 0, 0)
[4000095.075]  -> wl_surface@11.damage(0, 0, 2560, 22)
[4000095.081]  -> wl_surface@11.commit()
[4000095.916] wl_display@1.delete_id(14)
[4000095.941] wl_display@1.delete_id(16)
[4000095.948] zwlr_layer_surface_v1@13.configure(167, 2560, 22)
[4000095.956]  -> zwlr_layer_surface_v1@13.ack_configure(167)
[4000095.963] wl_keyboard@12.enter(170, wl_surface@11, array[4])
[4000095.970] wl_keyboard@12.modifiers(171, 0, 0, 0, 0)
[4000095.979] wl_data_device@3.selection(nil)
[4000095.985] wl_buffer@15.release()
[4000096.009] wl_buffer@17.release()
[4000134.772] wl_keyboard@12.key(172, 15739765, 28, 0)
[4000727.784] wl_keyboard@12.key(173, 15740358, 46, 1)
[4000730.229]  -> wl_surface@11.set_buffer_scale(1)
[4000730.247]  -> wl_surface@11.attach(wl_buffer@15, 0, 0)
[4000730.256]  -> wl_surface@11.damage(0, 0, 2560, 22)
[4000730.263]  -> wl_surface@11.commit()
[4000732.493] wl_buffer@15.release()
[4000856.089] wl_keyboard@12.key(174, 15740486, 30, 1)
[4000858.438]  -> wl_surface@11.set_buffer_scale(1)
[4000858.457]  -> wl_surface@11.attach(wl_buffer@15, 0, 0)
[4000858.466]  -> wl_surface@11.damage(0, 0, 2560, 22)
[4000858.474]  -> wl_surface@11.commit()
[4000860.534] wl_buffer@15.release()
[4000922.885] wl_keyboard@12.key(175, 15740553, 46, 0)
[4000952.936] wl_keyboard@12.key(176, 15740583, 38, 1)
[4000954.518]  -> wl_surface@11.set_buffer_scale(1)
[4000954.535]  -> wl_surface@11.attach(wl_buffer@15, 0, 0)
[4000954.544]  -> wl_surface@11.damage(0, 0, 2560, 22)
[4000954.551]  -> wl_surface@11.commit()
[4000956.889] wl_buffer@15.release()
[4001027.897] wl_keyboard@12.key(177, 15740658, 30, 0)
[4001096.090] wl_keyboard@12.key(178, 15740726, 38, 0)
[4001109.604] wl_keyboard@12.key(179, 15740740, 46, 1)
[4001110.361]  -> wl_surface@11.set_buffer_scale(1)
[4001110.381]  -> wl_surface@11.attach(wl_buffer@15, 0, 0)
[4001110.390]  -> wl_surface@11.damage(0, 0, 2560, 22)
[4001110.400]  -> wl_surface@11.commit()
[4001111.452] wl_buffer@15.release()
[4001291.084] wl_keyboard@12.key(180, 15740921, 46, 0)
[4001621.085] wl_keyboard@12.key(181, 15741251, 106, 1)
[4001621.772]  -> wl_surface@11.set_buffer_scale(1)
[4001621.791]  -> wl_surface@11.attach(wl_buffer@15, 0, 0)
[4001621.801]  -> wl_surface@11.damage(0, 0, 2560, 22)
[4001621.810]  -> wl_surface@11.commit()
[4001623.062] wl_buffer@15.release()
[4001770.689] wl_keyboard@12.key(182, 15741401, 106, 0)
[4002026.085] wl_keyboard@12.key(183, 15741656, 28, 1)
gnome-calculator
[4002026.157]  -> wl_keyboard@12.release()
[4002026.363]  -> wl_surface@11.destroy()
[4002026.372]  -> zwlr_layer_surface_v1@13.destroy()
Segmentation fault (core dumped)
Details
Message ID
<CZVZ5AXCYOX6.3G1H1JXVXT9Y@maolood.com>
In-Reply-To
<aecd59d2-096a-4ed3-ae2b-7b035a312963@sydneymeyer.net> (view parent)
DKIM signature
pass
Download raw message
Hi, that stack trace was pretty useful. Looks like the issue is with calling
wl_data_offer_destroy on a NULL data offer. It's weird that it doesn't segfault
reliably, though.

I pushed a commit which should fix the issue. Could you try building from the
latest commit and seeing if that fixes the issue?
Details
Message ID
<74dda507-266e-41d7-a1ab-8326de419a8d@sydneymeyer.net>
In-Reply-To
<CZVZ5AXCYOX6.3G1H1JXVXT9Y@maolood.com> (view parent)
DKIM signature
pass
Download raw message
Hello Adnan,
> It's weird that it doesn't segfault reliably, though.

Yes, and i still have no idea as to what causes it and what makes it 
"suddenly" go away.

But i'll let you know if i come across anything useful.

> I pushed a commit which should fix the issue. Could you try building from the
> latest commit and seeing if that fixes the issue?
Anyway, i have built 2856dddc and wmenu indeed does not segfault anymore.

Thanks a bunch for your work, Adnan.

And BTW: Thanks for writing wmenu.. love it.

"Write programs that do one thing and do it well." - Doug McIlroy
Details
Message ID
<CZYWCBQF1N24.SE45K339ZD60@maolood.com>
In-Reply-To
<74dda507-266e-41d7-a1ab-8326de419a8d@sydneymeyer.net> (view parent)
DKIM signature
pass
Download raw message
On Mon Mar 18, 2024 at 12:15 PM EDT, Sydney Meyer wrote:
> And BTW: Thanks for writing wmenu.. love it.
>
> "Write programs that do one thing and do it well." - Doug McIlroy

No problem. Glad you like it :)
Reply to thread Export thread (mbox)