~hp/issues#18: 
synthpod resource exhaustion with PipeWire

Hello,

I've recently tried to run synthpod (both synthpod_alsa and synthpod_jack) under PipeWire (system is utilizing PipeWire's JACK implementation by default via emulating libjack.so). While the application starts, it quickly freezes the system as it allocates too much memory.

The issue seems to stem from here:

https://github.com/OpenMusicKontrollers/synthpod/blob/89ad345e211631ceb8e22c3495878b8cd4fa0818/app/synthpod_app.c#L997-L1008

The first 8 iterations of the loop (0-7) are all fine and dsp_master->num_slaves have the value of 11. However, when the 9th iteration comes along, the value of dsp_master->num_slaves changes to > 32000 (differs every time - 32583, 32630, 32696, 32763) and as a result, the application tries to spawn that many threads, thus leading to resource exhaustion (out-of-memory).

Edit:

The issues seems to be an invalid array access.

https://github.com/OpenMusicKontrollers/synthpod/blob/89ad345e211631ceb8e22c3495878b8cd4fa0818/app/synthpod_app_private.h#L51

A temporary workaround appears to be increasing MAX_SLAVES.

System:

  • Linux 5.14.8
  • PipeWire 0.3.38
  • synthpod (master)
Status
REPORTED
Submitter
~hp
Assigned to
~hp
Submitted
1 year, 1 month ago
Updated
1 year, 1 month ago
Labels
synthpod

~hp 1 year, 1 month ago

Not sure if this is the same, my system does not freeze but the synthpod server (both jack and alsa) crashes

synhpod_jack

Synthpod 0.1.6507
Copyright (c) 2015-2016 Hanspeter Portner (dev@open-music-kontrollers.ch)
Released under Artistic License 2.0 by Open Music Kontrollers
(DSP) [Error] _dsp_slave_thread: pthread_setschedparam error
(DSP) [Error] _dsp_slave_thread: pthread_setschedparam error
(DSP) [Error] _dsp_slave_thread: pthread_setschedparam error
Killed

synthpod_alsa

Synthpod 0.1.6507
Copyright (c) 2015-2016 Hanspeter Portner (dev@open-music-kontrollers.ch)
Released under GNU General Public License 3 by Open Music Kontrollers
playback :
  nchan  : 2
  fsamp  : 48000
  fsize  : 1024
  nfrag  : 3
  format : S32_LE
capture  :
  nchan  : 2
  fsamp  : 48000
  fsize  : 1024
  nfrag  : 3
  format : S32_LE
synced
Killed
Register here or Log in to comment, or comment via email.