bugGNU Octave - Bugs: bug #57939, audioplayer.play crashes with...


bug #57939: audioplayer.play crashes with exception when called with nbits = 32

Submitted by:  Michael Josenhans <mjosenhans>
Submitted on:  Mon 02 Mar 2020 02:26:22 PM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  3 - Low Item Group:  Segfault, Bus Error, etc.
Status:  Ready For Test Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  6.0.90 Operating 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)

Tue 24 Mar 2020 07:49:39 PM UTC, comment #6: 

Marking as low priority since I believe the input validation change will prevent the segfault.  It is now more of a question about whether support for 32-bit players should be added.

Rik <rik5>
Project Administrator
Sun 15 Mar 2020 10:02:44 PM UTC, comment #5: 

I improved the inputvalidation for audioplayer so it will catch odd NBITS settings before ever getting to a callback funciton.  See https://hg.savannah.gnu.org/hgweb/octave/rev/41750ce4752c.  Since this caused a segfault, I made the fix on the stable branch.

Note that Matlab's audioplayer function only supports 8, 16, and 24 bit players.  Can this bug be closed now?

Marking as Ready For Test.

Rik <rik5>
Project Administrator
Thu 12 Mar 2020 03:35:15 PM UTC, comment #4: 

Yes, input validation is my hobby horse.  I would always like to see more of it.

Rik <rik5>
Project Administrator
Thu 12 Mar 2020 05:28:43 AM UTC, comment #3: 

A third issue is lack of input validation in the constructor. It's not clear to me if 32 bits should be accepted, or should be an error, or if it depends on the hardware.

But if the user enters 31 as the number of bits, we should probably report an error in the constructor.

Mike Miller <mtmiller>
Project Administrator
Mon 09 Mar 2020 05:08:54 PM UTC, comment #2: 

This is really two problems.  The first problem is in audiodevinfo.cc.  The callback function uses a switch statement which has cases for 8-, 16-, and 24-bit audio.  There is no case statement for 32-bit audio so the switch statement falls through to the default case which calls error().

The second issue is that error() when invoked from a callback causes a termination of the entire program, rather than just returning to the Octave prompt.

Rik <rik5>
Project Administrator
Mon 02 Mar 2020 05:50:40 PM UTC, comment #1: 

Confirmed on Debian.

>> y = rand (1e5, 1);
>> player = audioplayer (y, 16000, 32);
>> play (player)
error: invalid player bit depth in callback function
terminate called after throwing an instance of 'octave::execution_exception'
fatal: caught signal Aborted -- stopping myself...
Aborted (core dumped)

Mike Miller <mtmiller>
Project Administrator
Mon 02 Mar 2020 02:26:22 PM UTC, original submission:  

FileNameDest='C:\test\test.wav'; % any wav file
[signal fs] = audioread(FileNameDest);
p1 = audioplayer(signal, fs,32); % Here should be nBis 8 or 16 bits not 32

Ocatve GUI crashes, when play is called.

Michael Josenhans <mjosenhans>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mjosenhans (Submitted the item)
  • -email is unavailable- added by mjosenhans

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

    Only project members can vote.




    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-24 rik5 Priority5 - Normal => 3 - Low
    2020-03-15 rik5 StatusConfirmed => Ready For Test
        Releasedev => 6.0.90
    2020-03-02 mtmiller StatusNone => Confirmed
        Release5.1.0 => dev
        Operating SystemMicrosoft Windows => Any
        SummaryAudioplayer play creashes if audioplayer is called with nBits = 32 => audioplayer.play crashes with exception when called with nbits = 32
    2020-03-02 mjosenhans Carbon-Copy- => Added mjosenhans

    Back to the top

    Powered by Savane 3.5