Unconnected signal crash

Sep 13, 2010 at 9:35am

Unconnected signal crash

Hello,

I am having a problem whereby if I do not connect a signal to the inlet of an external I get (not entirely reliable) bad access crashes as soon as I try to access the input. I have been labouring for quite some time under the assumption that the dsp is always handed valid signal pointers, whether they are connected or otherwise, could someone confirm this?

I’m finding it hard to debug, partly because a couple of the variables (including the input) are always showing as out of scope in XCode, even when it is functioning correctly, and under debug build. Anyway, the line of code is so simple that there must be some pointer issue, but I never have a problem when the input is connected….

Anyone shed any light on the matter?

Thanks

Alex

#52289
Sep 13, 2010 at 7:00pm

Regardless of whether or not a signal is connected, you should have a valid signal pointer provided in your DSP method. Without more information (e.g. your dsp and perform methods) we can’t offer more help.

#187907
Sep 13, 2010 at 7:28pm

OK – thanks – it’s a big file that uses two big headers. It’s almost certainly my fault in that case – that was what I needed to know – I’ll investigate more…..

Alex

#187908
Sep 13, 2010 at 8:21pm

OK – I’ve looked some more at this and I *think* I may have it…

A while back (couple of years) I asked if signals could be 16byte aligned again and more recently it was done (maybe 8 months ago), which I was grateful for indeed.

It looks like unconnected signals may be valid, but not 16 byte aligned, which is a tiny bit of a pain for me, although I can live with it. That would explain why all my externals were working whilst fully patched, but this thing I’m getting now is happening (I’m treating the input block as 16 byte aligned).

Is that plausible? Could it be confirmed? Any chance it could be changed?

Thanks

Alex

#187909
Sep 14, 2010 at 9:05am

Also, I don’t see any issues yet with unaligned unconnected outlets, only inputs.

Be good to know if this is to be expected or not, as the workaround is easier for inputs only, but I’d like to be sure I’m properly avoiding crashes.

#187910
Sep 14, 2010 at 1:29pm

to play it safe, you can check the (short *)count array provided as the second argument to the dsp method, to see if a signal is connected or not.

#187911
Sep 14, 2010 at 1:36pm

Thanks mudang – Yeah – I know that – that’s the workaround I’ve just implemented. Unfortunately, although it may be obvious what to do it a single in / out scenario – it is more complicated for multiple ins and outs, when the right thing to do is to correctly calculate from some inputs / to some outputs, but others may crash.

Anyway, if outputs are not a problem then I might be ok, as I’m only dealing with one input at the moment…

Alex

#187912
Sep 14, 2010 at 8:33pm

Thanks for the report Alex. This will be fixed in the next release.

-Joshua

#187913
Sep 14, 2010 at 11:55pm

Many thanks!

#187914

You must be logged in to reply to this topic.