pipewire/spa/plugins
Barnabás Pőcze 479896279e spa: support: loop: handle cancellation better
Register a pthread cleanup handler to guarantee
that `spa_source::{priv, rmask}` are cleared even
if the thread is cancelled while the loop is dispatching.

This is necessary, otherwise `spa_source::priv` could point
to the stack of the cancelled thread, which will lead to
problems like this later:

  Program terminated with signal SIGSEGV, Segmentation fault.
  #0  0x00007f846b025be2 in detach_source (source=0x7f845f435f60) at ../spa/plugins/support/loop.c:144
  144      e->data = NULL;
  [Current thread is 1 (LWP 5274)]
  (gdb) p e
  $1 = (struct spa_poll_event *) 0x7f845e297820
  (gdb) bt
  #0  0x00007f846b025be2 in detach_source (source=0x7f845f435f60) at ../spa/plugins/support/loop.c:144
  #1  0x00007f846b0276ad in free_source (s=0x7f845f435f60) at ../spa/plugins/support/loop.c:359
  #2  0x00007f846b02a453 in loop_destroy_source (object=0x7f845f3af478, source=0x7f845f435f60) at ../spa/plugins/support/loop.c:786
  #3  0x00007f846b02a886 in impl_clear (handle=0x7f845f3af478) at ../spa/plugins/support/loop.c:859
  #4  0x00007f846b172f40 in unref_handle (handle=0x7f845f3af450) at ../src/pipewire/pipewire.c:211
  #5  0x00007f846b173579 in pw_unload_spa_handle (handle=0x7f845f3af478) at ../src/pipewire/pipewire.c:346
  #6  0x00007f846b15a761 in pw_loop_destroy (loop=0x7f845f434e30) at ../src/pipewire/loop.c:159
  #7  0x00007f846b135d8e in pw_data_loop_destroy (loop=0x7f845f434cb0) at ../src/pipewire/data-loop.c:166
  #8  0x00007f846b12c31c in pw_context_destroy (context=0x7f845f41c690) at ../src/pipewire/context.c:485
  #9  0x00007f846b3ddf9e in jack_client_close (client=0x7f845f3c1030) at ../pipewire-jack/src/pipewire-jack.c:3481
  ...
2022-06-02 00:24:24 +02:00
..
aec Cleanup argument names in methods and events interfaces: object/data, 2nd pass. 2022-04-18 07:49:35 +00:00
alsa alsa: sync acp with pulseaudio 2022-06-01 13:11:00 +02:00
audioconvert spa: debug memcpy 2022-05-31 10:31:26 +02:00
audiomixer spa: debug memcpy 2022-05-31 10:31:26 +02:00
audiotestsrc spa: set port flags on port info 2022-05-26 10:39:31 +02:00
bluez5 bluez5: implement freewheel in sink 2022-05-30 09:54:22 +02:00
control buffers: make alignment optional 2022-01-03 12:32:26 +01:00
ffmpeg treewide: meson.build: use dependency variable for SPA 2021-12-28 18:34:06 +01:00
jack buffers: make alignment optional 2022-01-03 12:32:26 +01:00
libcamera libcamera: advertise the device.product.name and not some random description 2022-05-26 19:18:35 +03:00
support spa: support: loop: handle cancellation better 2022-06-02 00:24:24 +02:00
test spa: set port flags on port info 2022-05-26 10:39:31 +02:00
v4l2 v4l2: cast varargs to the right type 2022-05-27 13:30:07 +02:00
videoconvert buffers: make alignment optional 2022-01-03 12:32:26 +01:00
videotestsrc spa: set port flags on port info 2022-05-26 10:39:31 +02:00
volume spa: Improve PropInfo fields 2022-03-30 17:09:08 +02:00
vulkan spa: set port flags on port info 2022-05-26 10:39:31 +02:00
meson.build module-echo-cancel: Move backends to dynamic libaries 2022-02-15 15:45:46 +00:00