bugGNU Octave - Bugs: bug #43994, New audio can crash octave when...

 
 

bug #43994: New audio can crash octave when rerun.

Submitted by:  Doug Stewart <dastew>
Submitted on:  Tue 13 Jan 2015 03:36:11 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Doug StewartOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 14 Jan 2015 07:22:25 PM UTC, comment #8:

markuman was so kind to test this code with matlab R2014b:

The sound stopped after 2 seconds. There was no warning and no error message.

Without second 'q=audioplayer...' it plays 10 seconds, as expected.

So I think the current approach is the right way, but the warning is not neccessary to be MATLAB compatible.

Stefan Mahr <dac922>
Tue 13 Jan 2015 01:27:50 PM UTC, comment #7:

Seems to me cset 9bd2f0a07c95 is causing this issue. The audio data was copied before, so it remains valid within the static callback function.

However, I don't know the MATLAB compatible way. Should it stop playing old audio, when the old object is deleted or should it continue play the old audio?

Stefan Mahr <dac922>
Tue 13 Jan 2015 12:53:54 PM UTC, comment #6:

this has been fixed. no crash now.

Doug Stewart <dastew>
Tue 13 Jan 2015 12:35:40 PM UTC, comment #5:

sorry I actually used sleep(1)

Doug Stewart <dastew>
Tue 13 Jan 2015 11:57:28 AM UTC, comment #4:

I think Stefan is right. @Doug: can you please test cset http://hg.savannah.gnu.org/hgweb/octave/rev/62ca016dbb2a

Your second testcase uses "delay". Is this an OCtave function or should this be "sleep"?

Andreas Weber <andy1978>
Project Member
Tue 13 Jan 2015 10:52:27 AM UTC, comment #3:

My guess: The second q=audioplayer(y,Fs,16); creates a new object and destroys the old 'q'. If the first 'q' is still playing, the old play_callback function wants to access the pointers from the old 'q' object. Since the object was released, the pointers are not valid anymore.

Stefan Mahr <dac922>
Tue 13 Jan 2015 10:39:04 AM UTC, comment #2:

I can confirm this on c36c22808d11.

Looks like the known multithreading problem.

Andreas Weber <andy1978>
Project Member
Tue 13 Jan 2015 10:30:15 AM UTC, comment #1:

This crashes for me.

+verbatum+
Fs=44100;
t=10;
x=0:1/Fs:t;
y(:,2)=sin(2pi220*x);
y(:,1)=sin(2pi440*x);
q=audioplayer(y,Fs,16);
play(q);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
q=audioplayer(y,Fs,16);
-verbatum-

and also this:
+verbatum+
Fs=44100;
t=10;
x=0:1/Fs:t;
y(:,2)=sin(2pi220*x);
y(:,1)=sin(2pi440*x);
q=audioplayer(y,Fs,16);
play(q);
delay(1)
play(q)
-verbatum-

Doug Stewart <dastew>
Tue 13 Jan 2015 03:36:11 AM UTC, original submission:

When using the following prog:

If you hit the blue run icon to start the sound, and then press it again and again, first the sound goes bad and the octave crashes with signal 11 and once with signal 6.

The time with signal 6 there was an error message about a callback problem. I did not get it copied down before octave crashed , and then the message was lost forever.

In summery if you rerun the software before it has finished the first run, it might crash, some times it doesn't.

Doug Stewart <dastew>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by dac922 (Posted a comment)
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by dastew (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 30 Jan 2015 04:36:23 PM UTCmtmillerStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 13 Jan 2015 11:57:28 AM UTCandy1978StatusNone=>Ready For Test

    Back to the top


    Powered by Savane 3.1-cleanup1