Crash in nightly when trying to use Howler.js & Web Audio

RESOLVED FIXED in mozilla22

Status

()

defect
--
critical
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: canuckistani, Assigned: Ehsan)

Tracking

({crash, testcase})

unspecified
mozilla22
x86_64
macOS
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(crash signature)

Attachments

(2 attachments)

Nightly crashes when trying to use a patched version of Howler.js to test Web Audio API support.
Do you have a link to the crash report?  You should be able to get one from about:crashes.

Thanks!
Blocks: webaudio
I posted some repro code here:

https://github.com/canuckistani/howler.js/tree/bug_845960_createGain

In particular I added this change to get the library to try to use createGain instead of chrome's createGainNode:

https://github.com/canuckistani/howler.js/commit/4dfd9583da240806db09e02da25df605452638d8#howler.js
Thanks, my first guess is that we're decoding an MP3 which fails and then we hit something bad in the failure code...  I'll take a look.
Assignee: nobody → ehsan
This bug was almost certainly caused because I had forgotten to put the audio files in place. Now that I have done so, I get different errors from Howler.
(In reply to Jeff Griffiths (:canuckistani) from comment #3)
> https://crash-stats.mozilla.com/report/index/bp-d82a7784-3e92-404a-b8f4-
> be5822130227
It's a 2-week old Nightly.
Severity: normal → critical
Crash Signature: [@ mozilla::WebAudioDecodeJob::OnFailure(mozilla::WebAudioDecodeJob::ErrorCode) ]
Keywords: crash
Hardware: x86 → x86_64
D'oh, you're exactly right. I've updated, here is a new crash report:

https://crash-stats.mozilla.com/report/index/bp-3e4cfca8-99e5-4421-b03b-9f2f72130227
(In reply to comment #5)
> This bug was almost certainly caused because I had forgotten to put the audio
> files in place. Now that I have done so, I get different errors from Howler.

Oh, actually I realize I never tested this with an empty input buffer, I don't think.  :-)
Should be pretty easy to fix then :) If you go in for this sort of thing, the user story might be something like:

"As a developer, if I try to play an audio file using AudioContext but the file is not available, the api should throw an exception that I can catch in a try block."
(In reply to comment #9)
> Should be pretty easy to fix then :) If you go in for this sort of thing, the
> user story might be something like:
> 
> "As a developer, if I try to play an audio file using AudioContext but the file
> is not available, the api should throw an exception that I can catch in a try
> block."

Oh yeah, in fact our code does try to call the failure callback function provided by the user to decodeAudioData, it just crashes in the process of doing that!  :-)
speex_resampler_process_*'s input buffer is not affected by its channel_index argument, hence the bug.  I'll need to adjust the tests for the fix.  Patch coming up.
(In reply to :Ehsan Akhgari from comment #11)
> speex_resampler_process_*'s input buffer is not affected by its
> channel_index argument, hence the bug.  I'll need to adjust the tests for
> the fix.  Patch coming up.

Wrong bug.  :(
So I just looked at this.  I cloned the branch in comment 2 and when I open test/index.html in that file and press play I cannot reproduce the bug...
(See this URL for example: http://people.mozilla.com/~eakhgari/howler.js/test/)

Jeff, do you still see the crash?
Flags: needinfo?(jgriffiths)
(In reply to :Ehsan Akhgari from comment #14)
> (See this URL for example:
> http://people.mozilla.com/~eakhgari/howler.js/test/)
> 
> Jeff, do you still see the crash?

With your example, it seems to be successfully loading sound.ogg. try deleting that, or changing the code to:

var sound = new Howl({
  urls: ['foo.ogg'],
  autoplay: false,
  loop: true,
  volume: 0.7,
  onend: function() {
    console.log('Finished!');
  }
});
Flags: needinfo?(jgriffiths)
OK great, now I can reproduce the crash!
Posted file Minimal testcase
Posted patch Patch (v1)Splinter Review
Very easy to fix, I was just missing a null check.
Attachment #721046 - Flags: review?(bzbarsky)
Comment on attachment 721046 [details] [diff] [review]
Patch (v1)

r=me
Attachment #721046 - Flags: review?(bzbarsky) → review+
Keywords: testcase
https://hg.mozilla.org/mozilla-central/rev/f4062c4b4fba
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Duplicate of this bug: 848552
Mass moving Web Audio bugs to the Web Audio component.  Filter on duckityduck.
Component: Video/Audio → Web Audio
You need to log in before you can comment on or make changes to this bug.