segfault while testing jack backend
First of all, pipewire is awesome. It's great to be able to use proaudio-type software so easily!
- PipeWire version (
pipewire --version
): 0.3.56 - Distribution and distribution version (
PRETTY_NAME
from/etc/os-release
): Gentoo Linux - Desktop Environment: KDE
- Kernel version (
uname -r
): 5.18.16-gentoo-dist
Description of Problem:
When running a slighted modified version of the test from JACK2 test.cpp, a segfault occurred in the function port_name()
from pipewire-jack.c
as c
is unconditionally dereferenced. When c
is NULL this results in a segfault. This is triggered on line 1769 in the above test.cpp
file
An easy fix is to add an instruction like spa_return_val_if_fail(c != NULL, NULL);
in port_name
, like in the proposed patch pipewire-jack-segfault.patch
Steps to Reproduce:
- Download test.cpp and add an upper bound in the
while
statement on line 1218 like&& j < 1000
- Compile the test with for instance
g++ -ggdb -ljack test.cpp -o test
- Run
./test
As an aside, would it make sense to prepare a MR to add test.cpp
to the testsuite? It looks like it could easily be converted to c.
It's possible that only a subset of the tests are relevant for pipewire.