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

cog segfaults on sway with imx viv gpu #559

Open
russdill opened this issue Apr 25, 2023 · 2 comments
Open

cog segfaults on sway with imx viv gpu #559

russdill opened this issue Apr 25, 2023 · 2 comments

Comments

@russdill
Copy link

russdill commented Apr 25, 2023

cog: 0.16.1
wpebackend-fdo: 1.14.0
wpewebkit: 2.38.2
sway: v1.7
wayland: 1.22
wayland-protocols: 1.25.imx

Looking through libEGL, it looks like it sets up a listener for wl_viv to set a proxy value that's later used in the call to wl_proxy_marshal_constructor in the stack-trace below. The listener never fires so proxy is NULL. The wpebackend-fdo EGL bind call is being made, so wl_viv is added to the list of wayland globals. I'm not sure if this is an issue of the callback needing some additional loops to wait for it to come in, or an ordering issue.

Starting program: /usr/bin/cog file:///home/driver/default.html
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[New Thread 0xffffe57cee80 (LWP 30022)]
[New Thread 0xffffc0fbce80 (LWP 30023)]
[New Thread 0xffffbbffee80 (LWP 30024)]
[New Thread 0xffffbb7eee80 (LWP 30025)]
[New Thread 0xffffbafdee80 (LWP 30034)]
[New Thread 0xffffba7cee80 (LWP 30036)]
[New Thread 0xffffb9fbee80 (LWP 30037)]
[New Thread 0xffffb97aee80 (LWP 30038)]
[Detaching after vfork from child process 30039]
[Detaching after vfork from child process 30040]

(cog:29352): GLib-GIO-WARNING **: 14:50:11.935: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal.  It should do one of these.
[New Thread 0xffffb8f9ee80 (LWP 30041)]
[New Thread 0xffff93ffee80 (LWP 30042)]
Cog-Core-Message: 14:50:12.174: <file:///home/driver/default.html> Load started.

(cog:29352): Cog-Core-WARNING **: 14:50:12.194: <file:///home/driver/default.html> Page load error: Error opening file /home/driver/default.html: No such file or directory
Cog-Core-Message: 14:50:12.195: <> Loaded successfully.

Thread 1 "cog" received signal SIGSEGV, Segmentation fault.
wl_proxy_marshal_constructor (proxy=0x0, opcode=0, interface=0xffffeebdf838 <wl_buffer_interface>) at ../wayland-1.22.0/src/wayland-client.c:967
967             wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature,
(gdb) bt
#0  wl_proxy_marshal_constructor (proxy=0x0, opcode=0, interface=0xffffeebdf838 <wl_buffer_interface>) at ../wayland-1.22.0/src/wayland-client.c:967
#1  0x0000fffff0b0f44c in ?? () from /usr/lib/libEGL.so.1
#2  0x0000fffff0b08adc in eglCreateWaylandBufferFromImageWL () from /usr/lib/libEGL.so.1
#3  0x0000ffffc078cb30 in on_export_wl_egl_image (data=<optimized out>, image=0xaaaaaab95bb0) at ../cog-0.16.1/platform/wayland/cog-platform-wl.c:1680
#4  0x0000fffff0f66550 in ffi_call_SYSV () at ../libffi-3.4.4/src/aarch64/sysv.S:127
#5  0x0000fffff0f65c64 in ffi_call_int (cif=cif@entry=0xfffffffff398, fn=0x6, orig_rvalue=0xaaaaaab82b50, orig_rvalue@entry=0x0,
    avalue=avalue@entry=0xfffffffff468, closure=closure@entry=0x0) at ../libffi-3.4.4/src/aarch64/ffi.c:816
#6  0x0000fffff0f660e0 in ffi_call (cif=cif@entry=0xfffffffff398, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0xfffffffff468)
    at ../libffi-3.4.4/src/aarch64/ffi.c:825
#7  0x0000ffffed91db64 in wl_closure_invoke (closure=closure@entry=0xaaaaaabb3330, flags=flags@entry=2, target=<optimized out>, opcode=6,
    data=<optimized out>, data@entry=0xaaaaaab82b50) at ../wayland-1.22.0/src/connection.c:1025
#8  0x0000ffffed918758 in wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0xaaaaaab82b50)
    at ../wayland-1.22.0/src/wayland-server.c:438
#9  0x0000ffffed91ba58 in wl_event_loop_dispatch (loop=0xaaaaaab6f0d0, timeout=<optimized out>) at ../wayland-1.22.0/src/event-loop.c:1027
#10 0x0000ffffc075a1b0 in operator() (__closure=0x0, base=0xaaaaaab6f1c0) at ../wpebackend-fdo-1.14.0/src/ws.cpp:77
#11 _FUN () at ../wpebackend-fdo-1.14.0/src/ws.cpp:86
#12 0x0000fffff2c27820 in g_main_dispatch (context=0xaaaaaaae2f90) at ../glib-2.72.3/glib/gmain.c:3417
#13 g_main_context_dispatch (context=0xaaaaaaae2f90) at ../glib-2.72.3/glib/gmain.c:4135
#14 0x0000fffff2c27ac0 in g_main_context_iterate (context=context@entry=0xaaaaaaae2f90, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../glib-2.72.3/glib/gmain.c:4211
#15 0x0000fffff2c27b8c in g_main_context_iteration (context=context@entry=0xaaaaaaae2f90, may_block=may_block@entry=1) at ../glib-2.72.3/glib/gmain.c:4276
#16 0x0000fffff2eaf868 in g_application_run (application=application@entry=0xaaaaaaae18a0, argc=argc@entry=2, argv=argv@entry=0xfffffffffb78)
    at ../glib-2.72.3/gio/gapplication.c:2569
#17 0x0000aaaaaaaa5c34 in main (argc=2, argv=0xfffffffffb78) at ../cog-0.16.1/launcher/cog.c:41
quit)
@russdill
Copy link
Author

This seems to be related to "render: remove wl_drm support from wlr_renderer":

https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/e5b5592a95e3f12afc90cc9fcf5adc3664bf79a3

the imx viv egl library looks to be expecting a call to eglBindWaylandDisplayWL by the compositor, at which point it exposes the 'wl_viv' extension. The handler in the imx viv egl library for eglCreateWaylandBufferFromImageWL assumes this has happened and segfault if it has not.

@russdill
Copy link
Author

Note that downgrading to wlroots 0.14.1 and sway 1.6.1 fixes the issue but also requires fixing a bug in wlroots 0.14.1 where it passes a context to eglCreateImageKHR instead of passing EGL_NO_CONTEXT as required by the API.

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

1 participant