dmenu-wayland icon indicating copy to clipboard operation
dmenu-wayland copied to clipboard

Dmenu-wl crashes with mmap failed, but not dmenu

Open jthulhu opened this issue 2 years ago • 5 comments

When executing dmenu-wl with some input, it crashes with mmap failed: Invalid argument. However, this is not the case of dmenu, which runs fine.

I read the documentation of mmap, and it may fail with this error code when len is 0. I have probably located the mmap call that crashes. It's in draw.c, and len corresponds to size, which is (I suppose) the size of the menu to be drawn. This size is computed with informations that come from monitors. Thus, I suppose the problem might come from the fact that dmenu achieves to retrieve information about the monitors, but not dmenu-wl (which is strange if you ask me, why the version made for xorg should work on wayland, but not the version made for wayland...). Hope it helps.

jthulhu avatar Aug 25 '21 15:08 jthulhu

I suppose that depends on your compositor. WFM.

keithbowes avatar Mar 03 '22 19:03 keithbowes

That was quite some time ago, I don't remember which compositor I used then (probably Gnome or Sway). Anyways, now it works for me too (currently using Sway).

jthulhu avatar Mar 05 '22 12:03 jthulhu

I am using Mutter and I have found that monitor->logical_width is used before being set thereby causing factor and width in dmenu_create_buffer to be 0

rakusan2 avatar May 27 '22 18:05 rakusan2

At least for me (Mutter v42.0) the bug looks to stem from in handle_global() panel->display_info.xdg_output_manager never being anything other than 0

rakusan2 avatar May 27 '22 21:05 rakusan2

panel->display_info.xdg_output_manager is set in a later call to handle_global than monitors

rakusan2 avatar May 27 '22 22:05 rakusan2