Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioRenderThread panics when opening google #26663

Open
tipowol opened this issue May 26, 2020 · 26 comments
Open

AudioRenderThread panics when opening google #26663

tipowol opened this issue May 26, 2020 · 26 comments

Comments

@tipowol
Copy link
Contributor

@tipowol tipowol commented May 26, 2020

nightly build from servo.org

 ~/Downloads/servo$ ./servo https://www.google.com
index out of bounds: the len is 1 but the index is 18446744073709551615 (thread AudioRenderThread, at /root/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/buffer_source_node.rs:405)
[2020-05-26T10:54:19Z ERROR servo] index out of bounds: the len is 1 but the index is 18446744073709551615

debug build from github (commit 7170a69)

~/code/tipowol/servo$ ./mach run https://www.google.com --dev
attempt to subtract with overflow (thread AudioRenderThread, at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/buffer_source_node.rs:405)
   0: servo::backtrace::print
             at /home/tipowol/code/tipowol/servo/ports/glutin/backtrace.rs:17
   1: servo::main::{{closure}}
             at /home/tipowol/code/tipowol/servo/ports/glutin/main2.rs:150
   2: std::panicking::rust_panic_with_hook
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:481
   3: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
   4: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
   5: core::panicking::panic
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:52
   6: servo_media_audio::buffer_source_node::AudioBuffer::interpolate
             at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/buffer_source_node.rs:405
   7: <servo_media_audio::buffer_source_node::AudioBufferSourceNode as servo_media_audio::node::AudioNodeEngine>::process
             at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/buffer_source_node.rs:308
   8: servo_media_audio::graph::AudioGraph::process
             at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/graph.rs:436
   9: servo_media_audio::render_thread::AudioRenderThread::process
             at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/render_thread.rs:218
  10: servo_media_audio::render_thread::AudioRenderThread::event_loop
             at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/render_thread.rs:311
  11: servo_media_audio::render_thread::AudioRenderThread::start
             at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/render_thread.rs:159
  12: servo_media_audio::context::AudioContext::new::{{closure}}
             at /home/tipowol/.cargo/git/checkouts/media-c23a3cd5aa97076a/62cd58a/audio/context.rs:150
  13: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys_common/backtrace.rs:130
  14: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:475
  15: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:318
  16: std::panicking::try::do_call
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:297
  17: __rust_try
  18: std::panicking::try
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:274
  19: std::panic::catch_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:394
  20: std::thread::Builder::spawn_unchecked::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:474
  21: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/ops/function.rs:232
  22: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys/unix/thread.rs:87
  23: start_thread
  24: __clone
[2020-05-26T10:56:20Z ERROR servo] attempt to subtract with overflow
@jdm
Copy link
Member

@jdm jdm commented May 26, 2020

This will likely be fixed by #26611.

@jdm
Copy link
Member

@jdm jdm commented May 26, 2020

Nevermind, that's a different panic stack but similar panic message. Maybe it's related to #26271 instead.

@tipowol
Copy link
Contributor Author

@tipowol tipowol commented May 26, 2020

After reverting commit servo/media@f5f10c4 I no longer have this problem when opening google.

@jdm
Copy link
Member

@jdm jdm commented May 26, 2020

@jdm
Copy link
Member

@jdm jdm commented May 26, 2020

The linear extrapolation looks like it can panic if pos is 0.

@camelid
Copy link
Contributor

@camelid camelid commented May 29, 2020

I don't have this on the latest Servo build on my Ubuntu VM.

Commit hash: bb80eb1da

The Google logo is off to the left, but no panics.

EDIT: I thought ./servo --version outputted the commit hash, but it seems that's not a valid commit. Either way, it's the latest nightly as of today

@jdm
Copy link
Member

@jdm jdm commented May 29, 2020

Aha, it might have been triggered by a special google doodle. That's frustrating.

@camelid
Copy link
Contributor

@camelid camelid commented May 29, 2020

I don't get the error on my Mac either by the way.

@camelid
Copy link
Contributor

@camelid camelid commented May 29, 2020

Time to look at the Google Doodle archives! Or I could try archive.org maybe

@camelid
Copy link
Contributor

@camelid camelid commented May 29, 2020

There doesn't seem to have been a Google Doodle when this bug happened! I tried https://web.archive.org/web/20200526105453/http://www.google.com/ in Servo, which is from the same time as the panic log report, and there was just the regular Google logo. It worked fine aside from a layout bug.

The only thing I can think of is that the timezones don't match.

@camelid
Copy link
Contributor

@camelid camelid commented May 29, 2020

Or, perhaps Archive.org is blocking the audio

@camelid
Copy link
Contributor

@camelid camelid commented May 29, 2020

Could we add an automated test to check for this?

@jdm
Copy link
Member

@jdm jdm commented May 29, 2020

we would have to work backwards from the code, but it definitely should be possible (also desirable).

@camelid
Copy link
Contributor

@camelid camelid commented May 29, 2020

Is it possible to have the CI run ./servo https://www.google.com as a test?

@jdm
Copy link
Member

@jdm jdm commented May 29, 2020

We could, but any tests where the content can change at any time are inherently risky and difficult to determine whether a PR is responsible for a new failure or not.

@tipowol
Copy link
Contributor Author

@tipowol tipowol commented May 30, 2020

jdm was right, it was doodle that day, so google doesn't crash now. I am able to reproduce same stack trace after manually starting doodle on: https://www.google.com/doodles/mothers-day-2020-nicaragua
commit hash: 1a6193703

@camelid
Copy link
Contributor

@camelid camelid commented May 30, 2020

Weirdly, when I go to that page, it still doesn't panic. Does yours panic every time or is it random?

Commit hash: 5dae012

@tipowol
Copy link
Contributor Author

@tipowol tipowol commented May 31, 2020

Panic occurred every time I tested. Today i tried also testing on VM, same results.

@camelid
Copy link
Contributor

@camelid camelid commented May 31, 2020

Hmm. What OS are you on?

@tipowol
Copy link
Contributor Author

@tipowol tipowol commented May 31, 2020

arch linux

@khodzha
Copy link
Contributor

@khodzha khodzha commented May 31, 2020

could you try again please compiling with servo-media from master? i (think i) fixed the error in BufferSourceNode

@atouchet
Copy link
Contributor

@atouchet atouchet commented May 31, 2020

This hasn't been updated in Servo yet.

@atouchet atouchet reopened this May 31, 2020
@tipowol
Copy link
Contributor Author

@tipowol tipowol commented May 31, 2020

Servo crashes no more for me on google doodle, after compiling with the most recent servo/media.

@jdm
Copy link
Member

@jdm jdm commented Jun 1, 2020

It would be really great to create an automated test that reproduces the same issue without the change to servo/media.

@camelid
Copy link
Contributor

@camelid camelid commented Jun 2, 2020

What confuses me about this is that the issue was when the position was zero, but shouldn’t that happen at the beginning of every audio clip? Am I missing something?

@jdm
Copy link
Member

@jdm jdm commented Jun 2, 2020

Only for audiobuffersoucenode when the slow path in this code requires interpolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.