This assumption can be invalid when another request is performed on another
thread before the XShmAttach() reads |request| from the display.
An |attached| sequence number that is too old means that
_cairo_xlib_shm_pool_cleanup() can call _cairo_xlib_display_shm_pool_destroy()
and so shmdt() before the server processes the ShmAttach request, resulting in
BadAccess errors.
Similarly _cairo_xlib_shm_surface_mark_active() is called and uses
XNextRequest() before the corresponding request, leading to similar races
affecting _cairo_xlib_shm_surface_flush() and get_compositor() and
_cairo_xlib_shm_info_cleanup(). I assume _cairo_xlib_shm_surface_get_obdata()
has similar issues.
_cairo_ xlib_display_ fini_shm sets pool->attached to XNextRequest() assuming /cgit.freedeskt op.org/ cairo/tree/ src/cairo- xlib-surface- shm.c?id= 3f1a6f7225e3105 7a8af9313f051a1 d311df0c69# n602
the approaching XShmAttach() will be the next request.
https:/
This assumption can be invalid when another request is performed on another
thread before the XShmAttach() reads |request| from the display.
An |attached| sequence number that is too old means that xlib_shm_ pool_cleanup( ) can call _cairo_ xlib_display_ shm_pool_ destroy( )
_cairo_
and so shmdt() before the server processes the ShmAttach request, resulting in
BadAccess errors.
Similarly _cairo_ xlib_shm_ surface_ mark_active( ) is called and uses xlib_shm_ surface_ flush() and get_compositor() and xlib_shm_ info_cleanup( ). I assume _cairo_ xlib_shm_ surface_ get_obdata( )
XNextRequest() before the corresponding request, leading to similar races
affecting _cairo_
_cairo_
has similar issues.