bmc0 / dmenu

https://tools.suckless.org/dmenu/ with some patches
MIT License
0 stars 0 forks source link

segfault when selecting options #1

Open ChenSun-Phys opened 4 years ago

ChenSun-Phys commented 4 years ago

When I use the following command, echo -e "option1\noption2\noption3" | dmenu I can see the menu popping up on my screen. However, if I use the arrow key to select, it immediately crashes giving a segfault. What would be the way to investigate this issue? Thanks.

P.S. This is related to the use case here: https://github.com/dunst-project/dunst/issues/737

bmc0 commented 4 years ago

Are you using this specific fork of dmenu? Upstream is here. Anyway, I can't reproduce the issue with the command given using upstream dmenu or my fork.

ChenSun-Phys commented 4 years ago

It's this fork that i'm using. I can test the upstream as well. Do you know how I can track the origin of the problem?

bmc0 commented 4 years ago

You can try gdb:

$ CFLAGS+=" -ggdb" make
$ gdb ./dmenu
...
(gdb) run
option1
option2
option3
^D

It will tell you where the segfault is happening.

Another thing I'd try is disabling LTO (I added this in 07de9ac). Just delete -flto in config.mk (line 27 and 28).