FS#45006 - [pd] 0.46.6 Segmentation fault when set to use jack

Attached to Project: Community Packages
Opened by Raphael Santos (raphaelss) - Monday, 18 May 2015, 19:59 GMT
Last edited by David Runge (dvzrv) - Monday, 04 December 2017, 22:32 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To speps (archspeps)
David Runge (dvzrv)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 7
Private No


Pure data seems to crash when set to use jack.
When it's already set to jack on .pdsettings it crashes on execution.
After removing .pdsettings, it crashes when you choose jack on the Media menu.

Additional info:
package version: 0.46.6

Steps to reproduce:
Simply execute pd if you already have it setup for jack on .pdsettings or
execute it and choose jack on the Media menu
This task depends upon

Closed by  David Runge (dvzrv)
Monday, 04 December 2017, 22:32 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed with pd 0.48.0
Comment by Sean Lynch (seanl) - Tuesday, 21 July 2015, 13:57 GMT
Stack trace:

Thread 1 (Thread 0x7fe389bdd700 (LWP 2853)):
#0 0x0000000000000000 in ?? ()
#1 0x00000000004bca4b in jack_open_audio ()
#2 0x000000000046b39e in sys_reopen_audio ()
#3 0x000000000046b9cd in glob_audio_setapi ()
#4 0x000000000045452c in pd_typedmess ()
#5 0x000000000045c855 in binbuf_eval ()
#6 0x0000000000463ca4 in socketreceiver_read ()
#7 0x0000000000463125 in ?? ()
#8 0x0000000000460058 in m_mainloop ()
#9 0x00007fe388811790 in __libc_start_main () from /usr/lib/libc.so.6
#10 0x0000000000411a39 in _start ()
Comment by Daniel (cornicis) - Saturday, 10 October 2015, 16:18 GMT
As Allan suggests on the board [1], this can be omitted by adding options=(!buildflags). At least in my case, I can confirm that.

[1] https://bbs.archlinux.org/viewtopic.php?pid=1562421#p1562421
Comment by Darrell (denns) - Monday, 25 January 2016, 18:08 GMT
It crashes when using "jack2" or "jack2-dbus", but not when using old "jack".
Comment by Robert (missingsense) - Tuesday, 12 April 2016, 19:19 GMT
I have the same problem with jack2 running. I tried installing jack but that didn't help, then I installed linux-rt to see if that helped. both did not work and Pd still crashes when I try enabling jack.
Comment by Antanas Bružas (antanas) - Wednesday, 20 April 2016, 10:43 GMT
Same here:

pd -jack -d 1
set pd_whichmidiapi 0
set ::tmp_path {}
set ::sys_searchpath $::tmp_path
set ::tmp_path {}
lappend ::tmp_path {/home/antanas/pd-externals}
lappend ::tmp_path {/usr/local/lib/pd-externals}
lappend ::tmp_path {/usr/lib/pd/extra}
set ::sys_staticpath $::tmp_path
set ::startup_flags {}
set ::startup_libraries {}
pdtk_pd_startup 0 46 7 {} { {OSS 2} {ALSA 1} {jack 5} } { {OSS-MIDI 0} {ALSA-MIDI 1} } {DejaVu Sans Mono} bold
set pd_whichapi 5
set pd_whichmidiapi 0
Segmentation fault (core dumped)
Comment by David Runge (dvzrv) - Sunday, 08 May 2016, 20:03 GMT
@speps: Can you please apply the fix?
pd is quite useless in a real-time audio/ pro-audio context in this state.

I can also confirm, that the package works, when build with options=('!strip' '!buildflags')
Comment by David Runge (dvzrv) - Tuesday, 17 May 2016, 23:16 GMT
There's also an upstream bug report, but they don't know about it working here, when using options=(!buildflags) (yet): https://sourceforge.net/p/pure-data/bugs/1228/
Comment by David Runge (dvzrv) - Sunday, 05 June 2016, 23:05 GMT
@speps: It seems the global hardening flags are causing the trouble with pd and jack2.
So there are two options: Adding !buildflags to options or adding the global buildflags during build while ommitting CPPFLAGS="-D_FORTIFY_SOURCE=2"
Comment by Johannes Maibaum (jmx) - Monday, 28 November 2016, 19:28 GMT
Is there anything that can be done to get this bug fixed at last? I can also confirm that adding !buildflags to options resolve the issue with using jack.
Comment by David Runge (dvzrv) - Wednesday, 28 December 2016, 01:02 GMT
@jmx: You could use pd-git from the AUR (https://aur.archlinux.org/packages/pd-git/).
Just added it with !buildflags.

I'm not sure pd will be fixed in time and might even be dropped to AUR, because of lack of maintenance (which I hope it won't).
Comment by JP Cimalando (jpcima) - Monday, 08 May 2017, 05:29 GMT
The linker flag -Wl,--as-needed results in /usr/bin/pd omitting the link to libjack.so.
Since libjack has its functions marked as weak symbols, gcc does not signal an undefined symbol error at link time. However the jack functions receive null addresses at runtime, producing a jump to adress 0 and subsequent crash, as it can be seen in valgrind.
I am not quite sure why --as-needed would remove jack from the link though.
Comment by David Runge (dvzrv) - Wednesday, 25 October 2017, 02:31 GMT
I think this doesn't apply to pd > 0.48 anymore, so this can probably be closed.