Csound Csound-dev Csound-tekno Search About

[Cs-dev] Jack Crash

Date2014-02-20 15:40
FromSteven Yi
Subject[Cs-dev] Jack Crash
Hi All,

Menno reported to me a crash from Blue when a Csound run completed.
The log reported the crash originated from Csound's librtjack's
processCallback function.  The log didn't have much more information
than that.  My one thought from a quick look at the rtjack code is
that it might be possible that the void* arg passed into the function
might be NULL, maybe if csound deletes and cleans up just before an
jack callback gets called.  My guess is that we might need a NULL
check at the top of the function and if NULL just return 0 (I don't
know what return values are usable there).

Does anyone have any thoughts on if the above analysis is plausible,
and whether they might see some other problems?

Thanks!
steven

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-20 15:59
FromVictor Lazzarini
SubjectRe: [Cs-dev] Jack Crash
I see this

     csound->DestroyGlobalVariable(csound, "_rtjackGlobals");
    if (p.client != (jack_client_t*) NULL) {
      /* deactivate client */
      //if (p.jackState != 2) {
      //if (p.jackState == 0)
      //  csound->Sleep((size_t)
      //                ((int) ((double) (p.bufSize * p.nBuffers)
      //                        * 1000.0 / (double) p.sampleRate + 0.999)));
      jack_deactivate(p.client);
      //}
      csound->Sleep((size_t) 50);

surely the DestroyGlobalVariable() needs to happen after deactivation.
Maybe this line should be moved to after jack_deactivate().

Victor
On 20 Feb 2014, at 15:40, Steven Yi  wrote:

> Hi All,
> 
> Menno reported to me a crash from Blue when a Csound run completed.
> The log reported the crash originated from Csound's librtjack's
> processCallback function.  The log didn't have much more information
> than that.  My one thought from a quick look at the rtjack code is
> that it might be possible that the void* arg passed into the function
> might be NULL, maybe if csound deletes and cleans up just before an
> jack callback gets called.  My guess is that we might need a NULL
> check at the top of the function and if NULL just return 0 (I don't
> know what return values are usable there).
> 
> Does anyone have any thoughts on if the above analysis is plausible,
> and whether they might see some other problems?
> 
> Thanks!
> steven
> 
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-20 16:12
FromSteven Yi
SubjectRe: [Cs-dev] Jack Crash
That seems reasonable.  Could you commit a change and we can ask Menno to test?

On Thu, Feb 20, 2014 at 10:59 AM, Victor Lazzarini
 wrote:
> I see this
>
>      csound->DestroyGlobalVariable(csound, "_rtjackGlobals");
>     if (p.client != (jack_client_t*) NULL) {
>       /* deactivate client */
>       //if (p.jackState != 2) {
>       //if (p.jackState == 0)
>       //  csound->Sleep((size_t)
>       //                ((int) ((double) (p.bufSize * p.nBuffers)
>       //                        * 1000.0 / (double) p.sampleRate + 0.999)));
>       jack_deactivate(p.client);
>       //}
>       csound->Sleep((size_t) 50);
>
> surely the DestroyGlobalVariable() needs to happen after deactivation.
> Maybe this line should be moved to after jack_deactivate().
>
> Victor
> On 20 Feb 2014, at 15:40, Steven Yi  wrote:
>
>> Hi All,
>>
>> Menno reported to me a crash from Blue when a Csound run completed.
>> The log reported the crash originated from Csound's librtjack's
>> processCallback function.  The log didn't have much more information
>> than that.  My one thought from a quick look at the rtjack code is
>> that it might be possible that the void* arg passed into the function
>> might be NULL, maybe if csound deletes and cleans up just before an
>> jack callback gets called.  My guess is that we might need a NULL
>> check at the top of the function and if NULL just return 0 (I don't
>> know what return values are usable there).
>>
>> Does anyone have any thoughts on if the above analysis is plausible,
>> and whether they might see some other problems?
>>
>> Thanks!
>> steven
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-20 17:02
FromVictor Lazzarini
SubjectRe: [Cs-dev] Jack Crash
done.
On 20 Feb 2014, at 16:12, Steven Yi  wrote:

> That seems reasonable.  Could you commit a change and we can ask Menno to test?
> 
> On Thu, Feb 20, 2014 at 10:59 AM, Victor Lazzarini
>  wrote:
>> I see this
>> 
>>     csound->DestroyGlobalVariable(csound, "_rtjackGlobals");
>>    if (p.client != (jack_client_t*) NULL) {
>>      /* deactivate client */
>>      //if (p.jackState != 2) {
>>      //if (p.jackState == 0)
>>      //  csound->Sleep((size_t)
>>      //                ((int) ((double) (p.bufSize * p.nBuffers)
>>      //                        * 1000.0 / (double) p.sampleRate + 0.999)));
>>      jack_deactivate(p.client);
>>      //}
>>      csound->Sleep((size_t) 50);
>> 
>> surely the DestroyGlobalVariable() needs to happen after deactivation.
>> Maybe this line should be moved to after jack_deactivate().
>> 
>> Victor
>> On 20 Feb 2014, at 15:40, Steven Yi  wrote:
>> 
>>> Hi All,
>>> 
>>> Menno reported to me a crash from Blue when a Csound run completed.
>>> The log reported the crash originated from Csound's librtjack's
>>> processCallback function.  The log didn't have much more information
>>> than that.  My one thought from a quick look at the rtjack code is
>>> that it might be possible that the void* arg passed into the function
>>> might be NULL, maybe if csound deletes and cleans up just before an
>>> jack callback gets called.  My guess is that we might need a NULL
>>> check at the top of the function and if NULL just return 0 (I don't
>>> know what return values are usable there).
>>> 
>>> Does anyone have any thoughts on if the above analysis is plausible,
>>> and whether they might see some other problems?
>>> 
>>> Thanks!
>>> steven
>>> 
>>> ------------------------------------------------------------------------------
>>> Managing the Performance of Cloud-Based Applications
>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>>> Read the Whitepaper.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> 
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-02-20 17:04
FromSteven Yi
SubjectRe: [Cs-dev] Jack Crash
Thanks! I've asked Menno to give it a try.

On Thu, Feb 20, 2014 at 12:02 PM, Victor Lazzarini
 wrote:
> done.
> On 20 Feb 2014, at 16:12, Steven Yi  wrote:
>
>> That seems reasonable.  Could you commit a change and we can ask Menno to test?
>>
>> On Thu, Feb 20, 2014 at 10:59 AM, Victor Lazzarini
>>  wrote:
>>> I see this
>>>
>>>     csound->DestroyGlobalVariable(csound, "_rtjackGlobals");
>>>    if (p.client != (jack_client_t*) NULL) {
>>>      /* deactivate client */
>>>      //if (p.jackState != 2) {
>>>      //if (p.jackState == 0)
>>>      //  csound->Sleep((size_t)
>>>      //                ((int) ((double) (p.bufSize * p.nBuffers)
>>>      //                        * 1000.0 / (double) p.sampleRate + 0.999)));
>>>      jack_deactivate(p.client);
>>>      //}
>>>      csound->Sleep((size_t) 50);
>>>
>>> surely the DestroyGlobalVariable() needs to happen after deactivation.
>>> Maybe this line should be moved to after jack_deactivate().
>>>
>>> Victor
>>> On 20 Feb 2014, at 15:40, Steven Yi  wrote:
>>>
>>>> Hi All,
>>>>
>>>> Menno reported to me a crash from Blue when a Csound run completed.
>>>> The log reported the crash originated from Csound's librtjack's
>>>> processCallback function.  The log didn't have much more information
>>>> than that.  My one thought from a quick look at the rtjack code is
>>>> that it might be possible that the void* arg passed into the function
>>>> might be NULL, maybe if csound deletes and cleans up just before an
>>>> jack callback gets called.  My guess is that we might need a NULL
>>>> check at the top of the function and if NULL just return 0 (I don't
>>>> know what return values are usable there).
>>>>
>>>> Does anyone have any thoughts on if the above analysis is plausible,
>>>> and whether they might see some other problems?
>>>>
>>>> Thanks!
>>>> steven
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Managing the Performance of Cloud-Based Applications
>>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>>>> Read the Whitepaper.
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Managing the Performance of Cloud-Based Applications
>>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>>> Read the Whitepaper.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net