Csound Csound-dev Csound-tekno Search About

[Cs-dev] patch for incomplete CSOUND segfault

Date2009-10-16 03:31
FromWade Brainerd
Subject[Cs-dev] patch for incomplete CSOUND segfault
Hi all,

When a sound fails to compile (e.g. SetJmp is invoked) the CSOUND can
be left in an incomplete state.  Calling a performance function on an
incomplete CSOUND, or starting a performance thread (part of the SWIG
interfaces) can lead to a segfault.

I encountered this while testing Art Hunkins' OurMusic Sugar activity.
 The segfault occurred when I opened a .csd file that required a MIDI
input device, and I did not have one in my machine.

I developed a patch and posted it to this Fedora bug:
https://bugzilla.redhat.com/show_bug.cgi?id=529293
The patch delays setting the COMP flag until csoundCompile returns
success.  The performance functions check for the presence of the COMP
flag before performing.

Best,
Wade

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-10-18 17:00
Fromvictor
SubjectRe: [Cs-dev] patch for incomplete CSOUND segfault
That's good thanks, but this is generally averted by checking the
result of a call to Compile(). Is Art Hunkis' code doing this? That is
what is supposed to be done. If it returns an error, then no further
calls should be made to performance functions.

Victor


----- Original Message ----- 
From: "Wade Brainerd" 
To: 
Sent: Friday, October 16, 2009 3:31 AM
Subject: [Cs-dev] patch for incomplete CSOUND segfault


> Hi all,
>
> When a sound fails to compile (e.g. SetJmp is invoked) the CSOUND can
> be left in an incomplete state.  Calling a performance function on an
> incomplete CSOUND, or starting a performance thread (part of the SWIG
> interfaces) can lead to a segfault.
>
> I encountered this while testing Art Hunkins' OurMusic Sugar activity.
> The segfault occurred when I opened a .csd file that required a MIDI
> input device, and I did not have one in my machine.
>
> I developed a patch and posted it to this Fedora bug:
> https://bugzilla.redhat.com/show_bug.cgi?id=529293
> The patch delays setting the COMP flag until csoundCompile returns
> success.  The performance functions check for the presence of the COMP
> flag before performing.
>
> Best,
> Wade
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net