Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SegFault #123

Open
keshto opened this issue Mar 24, 2023 · 7 comments · May be fixed by #124
Open

SegFault #123

keshto opened this issue Mar 24, 2023 · 7 comments · May be fixed by #124

Comments

@keshto
Copy link

keshto commented Mar 24, 2023

◗ wtype no && slurp
noSegmentation fault

Slurp segfaults when wtype is ran before?

@emersion
Copy link
Owner

Please provide a stack trace. You can do so by compiling from source, reproducing the crash and then running coredumpctl gdb and then bt full.

@keshto
Copy link
Author

keshto commented Mar 25, 2023

I don't touch systemd sorry.
Are you not able to reproduce by running wtype "" && slurp or even wlrctl keyboard type "" && slurp?
Note: running wtype "" && gdb -ex run slurp will not segfault interestingly.

@emersion
Copy link
Owner

Please provide a stack trace. Closing until then.

@keshto
Copy link
Author

keshto commented Mar 26, 2023

Reading symbols from slurp/build/slurp...
Starting program: /home/user/Downloads/slurp/build/slurp 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e3d430 in xkb_state_update_mask ()
   from /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0
A debugging session is active.

	Inferior 1 [process 3391] will be killed.

Quit anyway? (y or n) n
Not confirmed.
(gdb) backtrace
#0  0x00007ffff7e3d430 in xkb_state_update_mask ()
   from /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0
#1  0x0000555555559be5 in keyboard_handle_modifiers (data=0x55555556e1c0, 
    wl_keyboard=0x555555587a50, serial=15271, mods_depressed=0, 
    mods_latched=0, mods_locked=0, group=0) at ../main.c:345
#2  0x00007ffff779bf7a in ?? () from /usr/lib/x86_64-linux-gnu/libffi.so.8
#3  0x00007ffff779b40e in ?? () from /usr/lib/x86_64-linux-gnu/libffi.so.8
#4  0x00007ffff779bb0d in ffi_call ()
   from /usr/lib/x86_64-linux-gnu/libffi.so.8
#5  0x00007ffff7e78761 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libwayland-client.so.0
#6  0x00007ffff7e74aaa in ?? ()
   from /usr/lib/x86_64-linux-gnu/libwayland-client.so.0
#7  0x00007ffff7e7641c in wl_display_dispatch_queue_pending ()
   from /usr/lib/x86_64-linux-gnu/libwayland-client.so.0
#8  0x000055555555b950 in main (argc=1, argv=0x7fffffffe378) at ../main.c:1051

@tmccombs
Copy link
Collaborator

Are you not able to reproduce by running wtype "" && slurp

I am not able to reproduce with that, but I can with wtype "n" && slurp.

From the stack trace, it looks like the segfault is coming from within the call to wl_display_dispatch(state.display). This feels like a bug in libwayland-client to me. But I could be missing something. My guess is it has something to do with receiving a keyboard event before it is ready for it.

Interestingly,

$ (sleep .01; wtype n) & slurp

will segfualt, but

$ (sleep .02; wtype n) & slurp

won't.

@tmccombs tmccombs reopened this Mar 26, 2023
@emersion
Copy link
Owner

Maybe we're trying to xkb_state_update_mask() when there is no keymap or something?

@tmccombs
Copy link
Collaborator

I don't touch systemd sorry.

well, it looks like you were able to figure out how to look at the coredump on whatever system you are using :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants