| The signal flow graph opcodes manage their own memory to some extent.
The collections of nodes are deallocated in a csoundModuleDestroy
call. If this came before the freeing of the instrument instances,
while some sort of performance was still under way, that would cause
this segmentation fault.
On Sun, Mar 25, 2012 at 7:01 AM, Tito Latini wrote:
> Here is my complete debug of `orcompact', after `s' in your example.
>
> ...
> end of section 1 sect peak amps: 436.24 492.22
> DEBUG: [act] insno 0
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: free insno 1
> DEBUG: [act] insno 3
> DEBUG: [act] insno 4
> DEBUG: [act] insno 5
> DEBUG: [act] insno 6
> DEBUG: [act] insno 7
> inactive allocs returned to freespace
> SECTION 2:
> ...
>
>
> where `DEBUG: [act] insno N' are the active instances that are not freed,
> so the instruments 3, 4, 5, 6 and 7 are *really* always on.
>
> The instrument 1 (Harpsichord) contains `outleta'. The last freed `insno 1'
> is `csound->curip'. Perhaps it is a problem with the threads, therefore
> I have proposed the prior patch.
>
> Another info: your example works without `Reverberation' (not alwayson).
>
> tito
>
> On Sat, Mar 24, 2012 at 08:31:14PM -0400, Michael Gogins wrote:
>> How does that affect the case here, where "alwayson" effect
>> instruments are running in the s or e section of the score? I suspect
>> that is the cause of the problem. I wonder if instances are being
>> deallocated at the start of an s or e event (intead of after the
>> indicated time), or if alwayson instruments are treated differently
>> now (I don't think this used to be a problem).
>>
>> Regards,
>> Mike
>>
>> On Sat, Mar 24, 2012 at 6:11 PM, Tito Latini wrote:
>> > A possible solution is to free all inactive instr spaces
>> > except `csound->curip'. It is safe and without memory leaks.
>> >
>> > diff -ur csound5~/Engine/insert.c csound5/Engine/insert.c
>> > --- csound5~/Engine/insert.c 2012-03-24 22:15:55.000000000 +0100
>> > +++ csound5/Engine/insert.c 2012-03-24 22:16:51.000000000 +0100
>> > @@ -676,7 +676,7 @@
>> > prvip = NULL;
>> > prvnxtloc = &txtp->instance;
>> > do {
>> > - if (!ip->actflg) {
>> > + if (!ip->actflg && ip != csound->curip) {
>> > cnt++;
>> > if (ip->opcod_iobufs && ip->insno > csound->maxinsno)
>> > mfree(csound, ip->opcod_iobufs); /* IV - Nov 10 2002 */
>> >
>> >
>> > tito
>> >
>> > ------------------------------------------------------------------------------
>> > This SF email is sponsosred by:
>> > Try Windows Azure free for 90 days Click Here
>> > http://p.sf.net/sfu/sfd2d-msazure
>> > _______________________________________________
>> > Csound-devel mailing list
>> > Csound-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> This SF email is sponsosred by:
>> Try Windows Azure free for 90 days Click Here
>> http://p.sf.net/sfu/sfd2d-msazure
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |