jack2 icon indicating copy to clipboard operation
jack2 copied to clipboard

Segmentation fault after switching user

Open mxmilkiib opened this issue 5 years ago • 2 comments

<Urchlay> anyone awake? found a segfault bug in jack2 (1.9.14 and also latest git). to replicate: rm -rf /dev/shm/jack* then start jackd as root. then exit it, and start it as a normal user.
<Urchlay> /dev/shm/jack_db/__db.001: Permission denied
<Urchlay> cannot open DB environment: Permission denied
<Urchlay> then after opening the ALSA device: Segmentation fault
<Urchlay> (yes, OK, nobody should run jackd as root, but it shouldn't segfault either... should exit with an error message at worst)
<Urchlay> it's specifically /dev/shm/jack_db/ as jack-shm-registry is mode 666
<Urchlay> the reason I even found this: trying to compile clam, and as part of its build process (probably in the test suite), it actually starts jackd temporarily.
<Urchlay> (that would be "c++ library for audio & music", not clam the antivirus thing!)
<Urchlay> heh. I'm wrong. It happens during "scons configure" (Checking that jack sample program runs)

mxmilkiib avatar Jan 18 '20 07:01 mxmilkiib

In order for JACK to work properly, your user needs to be added to the realtime group for access to higher ulimits defined in /etc/security/limits.d/99-realtime-privileges.conf (provided by the realtime-privileges package), which is needed for realtime audio processing.

Note: You need to manually add your user to the realtime group even if you're using logind, since logind just handles access to direct hardware. There are two JACK implementations, see this comparison for the difference between the two. In short, Jack 1 and Jack 2 are equivalent implementations of the same protocol. Programs compiled against Jack 1 will work with Jack 2 without recompile (and vice versa).

https://wiki.archlinux.org/index.php/JACK_Audio_Connection_Kit

matheust3 avatar Mar 29 '20 20:03 matheust3

I don't have a realtime group on this machine. Kubuntu on 5.4.0-81-generic. I checked my perms are:

tom@putin:~/Dropbox/ShellScripts$ ls -la /dev/shm/
total 47576
drwxrwxrwt  4 root root       300 Aug 19 10:04  .
drwxr-xr-x 21 root root      5820 Aug 19 09:14  ..
-rw-rw-r--  1 sddm sddm 107341340 Aug 19 09:14  jack-120-0
-rw-rw-r--  1 sddm sddm      1196 Aug 19 09:14  jack-120-1
drwx------  2 sddm sddm       120 Aug 19 09:14  jack_db
srwxrwxr-x  1 sddm sddm         0 Aug 19 09:14  jack_default_120_0
-rwxrwxr-x  1 sddm sddm        12 Aug 19 09:14  jack_sem.120_default_dbusapi
-rwxrwxr-x  1 sddm sddm        12 Aug 19 09:14  jack_sem.120_default_freewheel
-rwxrwxr-x  1 sddm sddm        12 Aug 19 09:14 'jack_sem.120_default_PulseAudio JACK Sink'
-rwxrwxr-x  1 sddm sddm        12 Aug 19 09:14 'jack_sem.120_default_PulseAudio JACK Sink-01'
-rwxrwxr-x  1 sddm sddm        12 Aug 19 09:14 'jack_sem.120_default_PulseAudio JACK Source'
-rwxrwxr-x  1 sddm sddm        12 Aug 19 09:14 'jack_sem.120_default_PulseAudio JACK Source-01'
-rwxrwxr-x  1 sddm sddm        12 Aug 19 09:14  jack_sem.120_default_system
-rw-rw-rw-  1 sddm sddm     70744 Aug 19 09:14  jack-shm-registry
drwx------  4 root root        80 Aug 19 09:13  multipath

Perhaps I should become part of the sddm group? As these are rebuilt each reboot my changes to ownership get reset every now and then.

tomachinz avatar Aug 18 '21 22:08 tomachinz