-
Notifications
You must be signed in to change notification settings - Fork 59
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
Return value is not checked for NULL #4
Comments
Thanks for pointing that out. I guess I should really take the time and go over the files in this repository and fix things (it's been over a year now that I last touched them). |
yeah, it segfaulted on me, which is why I noticed it. Tried running it from the regular Ubuntu desktop (17.04) with the Nvidia drivers installed (384.90) - doesn't work for whatever reason. Not sure how you are supposed to run the application. I was originally interested in this in order to write a custom login application (like lightdm-greeter), but with wayland, is this possible with code such as this? Just asking, because I'm not very experienced in the linux graphics stack. |
I'm not sure the Nvidia closed source drivers supports DRM (some quick googling brought up this link), certainly not GBM (they came up with their own solution called EGLStreams, googling that should bring up quite a few news articles). Does Weston work for you? I don't really know much about login applications but I guess DRM and GBM could be used there. |
Program received signal SIGSEGV, Segmentation fault. xkb_context_ref (ctx=ctx@entry=0x0) at /usr/src/debug/libxkbcommon/0.5.0-r0/libxkbcommon-0.5.0/src/context.c:152 152 ctx->refcnt++; (gdb) bt #0 xkb_context_ref (ctx=ctx@entry=0x0) at /usr/src/debug/libxkbcommon/0.5.0-r0/libxkbcommon-0.5.0/src/context.c:152 eyelash#1 0xb660efb8 in xkb_keymap_new (ctx=0x0, format=format@entry=XKB_KEYMAP_FORMAT_TEXT_V1, flags=XKB_KEYMAP_COMPILE_NO_FLAGS) at /usr/src/debug/libxkbcommon/0.5.0-r0/libxkbcommon-0.5.0/src/keymap-priv.c:65 eyelash#2 0xb660ec42 in xkb_keymap_new_from_buffer (ctx=ctx@entry=0x0, buffer=buffer@entry=0xb605c000 "xkb_keymap {\nxkb_keycodes \"evdev-onemw_aliases(qwerty)\" {\n\tminimum = 8;\n\tmaximum = 446;\n\t<ESC>", ' ' <repeats 16 times>, "= 9;\n\t<AE01>", ' ' <repeats 15 times>, "= 10;\n\t<AE02>", ' ' <repeats 15 times>, "= 11;\n\t<AE03>", ' ' <repeats 15 times>, "= 12;\n\t"..., length=48673, format=format@entry=XKB_KEYMAP_FORMAT_TEXT_V1, flags=flags@entry=XKB_KEYMAP_COMPILE_NO_FLAGS) at /usr/src/debug/libxkbcommon/0.5.0-r0/libxkbcommon-0.5.0/src/keymap.c:191 eyelash#3 0xb660eca2 in xkb_keymap_new_from_string (ctx=0x0, string=0xb605c000 "xkb_keymap {\nxkb_keycodes \"evdev-onemw_aliases(qwerty)\" {\n\tminimum = 8;\n\tmaximum = 446;\n\t<ESC>", ' ' <repeats 16 times>, "= 9;\n\t<AE01>", ' ' <repeats 15 times>, "= 10;\n\t<AE02>", ' ' <repeats 15 times>, "= 11;\n\t<AE03>", ' ' <repeats 15 times>, "= 12;\n\t"..., format=XKB_KEYMAP_FORMAT_TEXT_V1, flags=XKB_KEYMAP_COMPILE_NO_FLAGS) at /usr/src/debug/libxkbcommon/0.5.0-r0/libxkbcommon-0.5.0/src/keymap.c:162 eyelash#4 0x000094ec in keyboard_keymap () eyelash#5 0xb636f718 in ffi_call_VFP () at ../libffi-3.2.1/src/arm/sysv.S:377 eyelash#6 0xb636fd2e in ffi_call (cif=cif@entry=0xbefff714, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0xbefff7d4) at /usr/src/debug/libffi/3.2.1-r0/libffi-3.2.1/src/arm/ffi.c:344 eyelash#7 0xb6630e46 in wl_closure_invoke (closure=closure@entry=0x1be28, flags=flags@entry=1, target=<optimized out>, target@entry=0x1bd58, opcode=opcode@entry=0, data=<optimized out>) at /usr/src/debug/wayland/1.11.0-r0/wayland-1.11.0/src/connection.c:935 #8 0xb662f1fa in dispatch_event (display=display@entry=0x17378, queue=<optimized out>) at /usr/src/debug/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1310 #9 0xb662fc94 in dispatch_queue (queue=0x173e4, display=0x17378) at /usr/src/debug/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1456 #10 wl_display_dispatch_queue_pending (display=display@entry=0x17378, queue=queue@entry=0x173e4) at /usr/src/debug/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1698 #11 0xb662fd6c in wl_display_dispatch_queue (display=0x17378, queue=0x173e4) at /usr/src/debug/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1674 #12 0xb662ff1c in wl_display_roundtrip_queue (display=0x17378, queue=0x173e4) at /usr/src/debug/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1121 #13 0xb662ff44 in wl_display_roundtrip (display=<optimized out>) at /usr/src/debug/wayland/1.11.0-r0/wayland-1.11.0/src/wayland-client.c:1150 #14 0xb6ff5d4c in eglGetDisplay (display_id=<optimized out>) at /usr/src/debug/wayland-egl/rdkv-20180926+gitnightly_master_tag_09262018-r0/git/wayland-egl/wayland-egl.c:522 #15 0x00009a50 in main () (gdb) p ctx $1 = (struct xkb_context *) 0x0
I also have the same problem, and I use AMD. Most of the codes I find are not documented, or are very complex, doing many things at the same time. |
@eyelash I know it seems like a lot to ask. But please, could you refactor the composer for a more current approach? If it is necessary to make a small contribution $$, I am willing. I really want to learn Wayland. |
@Anderson0xFF I haven't really done any Wayland development in the past few years. I would really like to get back to it one day but right now I don't really have the time. I don't think Wayland changed that much over the past years except for adding more additional protocols, so I'm expecting the fix for this issue to be rather simple but as I said I simply don't have the time. What I would recommend you to do is to read the code from different Wayland compositors such as Weston, wlroots, or Mutter, that's how I developed the code in this repo. Maybe use the code in this repo as a guide and grep for certain strings in the above compositors. Using an IDE that supports code navigation can also help a lot in understanding a bigger code base. |
tutorials/drm-gbm.c
Line 47 in 30aaec4
See http://manpages.ubuntu.com/manpages/xenial/man3/drmModeGetResources.3.html - function may return NULL, at which point a segfault will happen a few lines later.
The text was updated successfully, but these errors were encountered: