Re: [Jack-Devel] jack_port_get_buffer segfaults
On Thu, 21 Apr 2011, Dan Muresan wrote:
> I keep getting segfaults inside a process thread (non-callback model)
> when calling jack_port_get_buffer. Is it possible that Jack zombifies
Just curious... any reason for using the non-callback model?
You still have to have a dedicated thread, right? What's
the benefit of doing non-callback?
> back"? I.e. can this happen without any on_shutdown or
> port_registration notifications delivered to the application?
Yeah, you should be getting an on_shutdown, if you set the
callback.
> jack_nframes_t nframes = jack_cycle_wait (jclient);
> if (nframes <= 0 || zombified) break;
FYI, nframes is unsigned, so `nframes <= 0` is equiv. to
`nframes == 0`
> if (nframes > 0) {
> struct sembuf sops1 = { .sem_num = 0, .sem_op = nframes, .sem_flg = 0 };
> semop (jbufavail_sem, &sops1, 1);
> }
Did you try removing this to see if it's the problem? (But
it looks OK to me)
> In theory this should be immune to anything the non-realtime threads
> do, but in practice I get zombifications (and segfaults) often enough.
> Any ideas on what I might be missing?
This code looks fine to me. Looks like something else is
afoot.
For starters... what are your jack settings?
-gabriel
1303400164.15081_0.ltw:2,a <alpine.DEB.1.10.1104211022540.32613 at localhost dot localdomain>