Julien Claassen wrote [2010-09-06] :
Hello everyone!
I'm experiencing trouble with jack and multiple servers. The moment
I start a second jackserver (for net I/O) and try:
jack_lsp -s new_name
jack_lsp segfaults.
[follow-up: jack-devel]
Hi!
I have been bitten too, and found the bug:
jack_get_ports() may return NULL if no ports matched,
and jack_lsp uses this function on line 138 like this:
ports = jack_get_ports( client, NULL, NULL, 0)
for (i = 0; ports[i]; ++i) {
...
}
which obviously does not check for NULL.
Attached is a patch that fixes this.
Note that this also touches libjack/clients.c because
I think it is wrong to return NULL when no ports match.
There should be a distinction between a failed malloc and
no matching ports.
The array is already allocated, and the user has to free it
anyway, so there is nothing wrong with returning it empty.
Patch is against SVN but should apply with offsets against
0.118, too.
Bug test case:
console1> jackd -dnet
console2> jack_lsp
Segmentation Fault
Cheers,
Mathis