Crash when calling Weston/Cairo drawing functions from multiple threads
Bill Hayden
hayden at haydentech.com
Thu Mar 6 02:45:54 UTC 2025
I am porting a multi-threaded UI toolkit to Weston (layered on top of
toytoolkit), and running into an issue. This UI toolkit expects to be able
to draw from multiple threads, to be specific, from a different thread than
the one that called display_run() -- i.e. not from a
widget_redraw_handler_t function or the like.
Just a single call to widget_cairo_create() from another thread, even if
nothing is done with the returned context, is enough to trigger a crash.
The crash always manifests the same way: leaf->cairo_surface is NULL in
shm_surface_swap(), resulting in cairo_image_surface_get_width() triggering
a segfault.
The call stack looks like this:
cairo_image_surface_get_width
shm_surface_swap
surface_flush
window_flush
run_deferred_tasks
<display loop function>
Any help would be appreciated!
--
Thanks,
Bill Hayden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20250305/4ed4d9c0/attachment.htm>
More information about the wayland-devel
mailing list