bugGNU Octave - Bugs: bug #47875, audiowrite: segmentation fault...

 
 

bug #47875: audiowrite: segmentation fault when named parameter is missing coresponding value

Submitted by:  Rick T <ratulloch>
Submitted on:  Sun 08 May 2016 09:36:32 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Rick TOpen/Closed: Closed
Release: 4.0.0Operating System: Any

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)

Fri 13 May 2016 07:42:00 PM UTC, comment #10:

Checked the example of failing code in comment #2 and it is working now. Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Fri 13 May 2016 07:04:29 PM UTC, comment #9:

I checked in the following change on the stable branch:

http://hg.savannah.gnu.org/hgweb/octave/rev/2c6d1ef071d1

John W. Eaton <jwe>
Project Administrator
Thu 12 May 2016 11:13:47 PM UTC, comment #8:

No, I don't at the moment. I agree that crashes should be fixed with extreme prejudice, so I'll take a look at fixing this on stable in the next day or two since no one has expressed interest.

Mike Miller <mtmiller>
Project Administrator
Thu 12 May 2016 01:02:26 AM UTC, comment #7:

@Mike: It's an easy bug to fix. Do you have a way to identify a new contributor who wants to tackle this? Otherwise, it might be best to go ahead and fix it on the stable branch since it does result in a segfault.

Rik <rik5>
Project Administrator
Sun 08 May 2016 06:30:32 PM UTC, comment #6:

Yes, indeed I have configured --enable-bounds-check, hence it doesn't crash. Sorry for the noise.

Pantxo Diribarne <pantxo>
Project Member
Sun 08 May 2016 05:55:53 PM UTC, comment #5:

@pantxo: have you configured with --enable-bounds-check?

Anonymous
Sun 08 May 2016 05:13:09 PM UTC, comment #4:

It still segfaults for me on the default branch, rev 894b440027fa.

Mike Miller <mtmiller>
Project Administrator
Sun 08 May 2016 04:47:41 PM UTC, comment #3:

Default dev branch doesn't segfault. Mike's minimal scripts returns an error instead:

Pantxo Diribarne <pantxo>
Project Member
Sun 08 May 2016 03:35:23 PM UTC, comment #2:

Here is a more minimal example:

The top two frames of the backtrace:

This is clearly because the code is not checking whether args(i+1) is valid if args(i) is a valid parameter name.

This would be a good bug for a new contributor to work on.

Mike Miller <mtmiller>
Project Administrator
Sun 08 May 2016 09:45:25 AM UTC, comment #1:

the code posted in summary stripped things out so I attached the file as a text file that will cause the crash)

Rick T <ratulloch>
Sun 08 May 2016 09:36:32 AM UTC, original submission:

Octave 4.0 crashes using audiowrite if incorrect values are used.

This is the code that crashes Octave every-time using octave 4.0.0. I'm using Ubuntu 16.04 64bit

fs =8000; % Sampling frequency
fs_rate=fs;
dursec=10; %%duration of signal in seconds

t=linspace(0,2pi,dursecfs);
freq=primes(fs/2*dursec);
freq=freq';

ya=zeros(1,length(t));
numfreq=numel(freq)

for ii=1:1:numel(freq)
ya = ya+sin(freq(ii,1)*t);
end

audio_prop='BitsPerSample',16,'Artist','artist rt','Title','title section rt','Comment','Comments section rt';
audiowrite('/tmp/test.flac',[ya(:) -1*ya(:)],44100,audio_prop)

this can be prevented by using the correct syntax and changing the following two lines
audio_prop={'BitsPerSample',16,'Artist','artist rt','Title','title section rt','Comment','Comments:fn used goes here'};
audiowrite('/tmp/test.flac',[ya(:) -1*ya(:)],44100,audio_prop{:})

Rick T <ratulloch>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #37100:  aw_crash_code.m added by ratulloch (450B - text/x-objcsrc - the code posted in summary stripped things out so I attached the file as a text file that will cause the crash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by ratulloch (Submitted the item)
  • -unavailable- added by ratulloch
  •  

    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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 13 May 2016 07:42:00 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sun 08 May 2016 03:35:23 PM UTCmtmillerOperating SystemGNU/Linux=>Any
      SummaryCrash on audiowrite=>audiowrite: segmentation fault when named parameter is missing coresponding value
    Sun 08 May 2016 02:30:47 PM UTCjordighStatusNone=>Confirmed
    Sun 08 May 2016 09:40:36 AM UTCratullochAttached File-=>Added aw_crash_code.m, #37100
    Sun 08 May 2016 09:36:32 AM UTCratullochCarbon-Copy-=>Added ratulloch

    Back to the top


    Powered by Savane 3.1-cleanup1