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

Getting a segmentation fault #16

Closed
ukch opened this issue Feb 28, 2020 · 13 comments
Closed

Getting a segmentation fault #16

ukch opened this issue Feb 28, 2020 · 13 comments

Comments

@ukch
Copy link

ukch commented Feb 28, 2020

I've just compiled dmenu-wl on my Debian Bullseye system, following the instructions.
I can run the binary (e.g. with --help) but as soon as it receives input, I get a segfault. An example:

$ echo "hi" | dmenu # this works fine
...
$ echo "hi" | ./build/dmenu-wl
wl_registry@2: error 0: invalid version for global wl_output (26): have 2, wanted 3
mmap failed: Invalid argument
[1]    90785 done                echo "hi" | 
       90786 segmentation fault  ./build/dmenu-wl

Please let me know if I can provide any further debugging info.

@nyyManni
Copy link
Owner

Could you tell me which compositor (and which version) are you using. wayland is telling you that your compositor is only providing version 2 of the wl_output protocol, but the application is requesting version 3, and thus returns a null which then causes the segfault.

I will also double-check what functionality we need from version 3 (if any) The version 3 was a copy-paste requirement from swaybar, so it might happen that we can downgrade the version requirement to 2.

@nyyManni
Copy link
Owner

Turns out that the version bump from 2 to 3 happened at 2016, so your compositor is working with a quite old protocol.

However, the change between 2 and 3 was not meaningful for dmenu-wl so I downgraded the requirement. It might be that there will be other issues to come, if other protocols are as out of date as wl_output was.

@ukch
Copy link
Author

ukch commented Mar 2, 2020

@nyyManni Thanks! I don't really understand Wayland, but I'm surprised to hear my compositor is quite old, as I'm on a fresh Debian testing install. I will have another check today and let you know if it works OK now...

@apiraino
Copy link

apiraino commented Mar 2, 2020

I'm surprised to hear my compositor is quite old

@ukch Slightly related, I use the Debian files to build my own Ubuntu packages for everything Sway related (from wl-roots, sway down to the latest utility like waybar and dmenu_wayland).

https://salsa.debian.org/swaywm-team/

Might be interesting for you, too :)

@ukch
Copy link
Author

ukch commented Mar 2, 2020

@nyyManni Unfortunately, it is still segfaulting. Git hash 68e08e8, build dir removed and rebuilt.

@nyyManni
Copy link
Owner

nyyManni commented Mar 2, 2020

Does it give the exact same error about the version, or something else?

@ukch
Copy link
Author

ukch commented Mar 3, 2020

@nyyManni No, this time it doesn't give any output, just "segmentation fault".

@nyyManni
Copy link
Owner

nyyManni commented Mar 3, 2020

Okay, so we are hitting the "other issues to come" now.

So are you using sway or something else? If yes, what version (and what wlroots version) do you have?

@ukch
Copy link
Author

ukch commented Mar 10, 2020

Here's the result of running the above, with WAYLAND_DEBUG=1:

[759779.387]  -> wl_display@1.get_registry(new id wl_registry@2)
[759779.409]  -> wl_display@1.sync(new id wl_callback@3)
[759780.015] wl_display@1.delete_id(3)
[759780.030] wl_registry@2.global(1, "wl_drm", 2)
[759780.039] wl_registry@2.global(2, "wl_compositor", 4)
[759780.047]  -> wl_registry@2.bind(2, "wl_compositor", 4, new id [unknown]@4)
[759780.064] wl_registry@2.global(3, "wl_shm", 1)
[759780.072]  -> wl_registry@2.bind(3, "wl_shm", 1, new id [unknown]@5)
[759780.085] wl_registry@2.global(4, "wl_output", 2)
[759780.095]  -> wl_registry@2.bind(4, "wl_output", 2, new id [unknown]@6)
[759780.109] wl_registry@2.global(5, "zxdg_output_manager_v1", 3)
[759780.116]  -> wl_registry@2.bind(5, "zxdg_output_manager_v1", 2, new id [unknown]@7)
[759780.132] wl_registry@2.global(6, "wl_data_device_manager", 3)
[759780.140] wl_registry@2.global(7, "gtk_primary_selection_device_manager", 1)
[759780.152] wl_registry@2.global(8, "wl_subcompositor", 1)
[759780.164] wl_registry@2.global(9, "xdg_wm_base", 2)
[759780.177] wl_registry@2.global(10, "zxdg_shell_v6", 1)
[759780.192] wl_registry@2.global(11, "wl_shell", 1)
[759780.208] wl_registry@2.global(12, "gtk_shell1", 3)
[759780.222] wl_registry@2.global(13, "wp_viewporter", 1)
[759780.237] wl_registry@2.global(14, "zwp_pointer_gestures_v1", 1)
[759780.252] wl_registry@2.global(15, "zwp_tablet_manager_v2", 1)
[759780.268] wl_registry@2.global(16, "wl_seat", 5)
[759780.282]  -> wl_registry@2.bind(16, "wl_seat", 1, new id [unknown]@8)
[759780.297] wl_registry@2.global(17, "zwp_relative_pointer_manager_v1", 1)
[759780.309] wl_registry@2.global(18, "zwp_pointer_constraints_v1", 1)
[759780.320] wl_registry@2.global(19, "zxdg_exporter_v1", 1)
[759780.332] wl_registry@2.global(20, "zxdg_importer_v1", 1)
[759780.343] wl_registry@2.global(21, "zwp_linux_dmabuf_v1", 3)
[759780.352] wl_registry@2.global(22, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[759780.363] wl_registry@2.global(23, "zwp_text_input_manager_v3", 1)
[759780.375] wl_registry@2.global(24, "gtk_text_input_manager", 1)
[759780.386] wl_callback@3.done(15694)
[759780.393]  -> wl_display@1.sync(new id wl_callback@3)
[759780.483] wl_display@1.delete_id(3)
[759780.493] wl_output@6.geometry(0, 0, 340, 190, 0, "SHP", "0x149a", 0)
[759780.508] wl_output@6.mode(3, 1920, 1080, 59999)
[759780.517] wl_output@6.scale(1)
[759780.520] wl_output@6.done()
[759780.523] wl_seat@8.capabilities(3)
[759780.530]  -> wl_seat@8.get_keyboard(new id wl_keyboard@9)
[759780.538] wl_callback@3.done(15694)
[759780.544]  -> wl_compositor@4.create_surface(new id wl_surface@3)
mmap failed: Invalid argument

I'm not a wayland dev, and I don't really know anything about sway or wlroots. But I checked with my package manager and it looks like neither are installed. Shall I try installing sway and see if that fixes things @nyyManni?

@nyyManni
Copy link
Owner

If you don't have sway/wlroots installed, you are using some other de/wm, which most likely is nolt wlroots-based.

Are you using gnome or kde, perhaps?

@ukch
Copy link
Author

ukch commented Mar 12, 2020

Yes, sorry if I didn't already mention this, but I'm using Gnome.

@nyyManni
Copy link
Owner

nyyManni commented Mar 12, 2020

That explains.

I don't officially support Gnome as it is not based on wlroots. However, I do have Gnome installed as a secondary desktop, so I can try if there is an easy way around that error. But if I hit a roadblock I am afraid there is not much to do.

Closing this.

@ukch
Copy link
Author

ukch commented Mar 17, 2020

Thanks. That explains a few things, and I hope you are able to get something working!

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

No branches or pull requests

3 participants