ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.48k stars 803 forks source link

Error on https://gamcore.com/games/school_girls_1_a_new_job #3427

Open malachi2000 opened 3 years ago

malachi2000 commented 3 years ago

Error Info

Error name: Error Error message: panicked at 'assertion failed: (left == right) left: true, right: false: cannot recursively acquire mutex', /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys/wasm/../unsupported/mutex.rs:23:9 Error stack:

Error: panicked at 'assertion failed: `(left == right)`
  left: `true`,
 right: `false`: cannot recursively acquire mutex', /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys/wasm/../unsupported/mutex.rs:23:9
    at a.wbg.__wbg_new_df6e6ab7a65c4c4d (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/ruffle.js:1:6799)
    at std::sync::once::Once::call_once::{{closure}}::hce6501f6f20767e4 (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[1327]:0x26ba91)
    at std::sync::once::Once::call_inner::hd3d269a4946f2df2 (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[1604]:0x29efac)
    at core::ops::function::FnOnce::call_once{{vtable.shim}}::h6ed7686ed76cb258 (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[4639]:0x3823e3)
    at std::panicking::rust_panic_with_hook::h4f753dc70b771d8e (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[3509]:0x357cb7)
    at std::panicking::begin_panic_handler::{{closure}}::h5c9fc29957309ae8 (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[4146]:0x37594f)
    at std::sys_common::backtrace::__rust_end_short_backtrace::h92808941d97e9b21 (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[4985]:0x387ab4)
    at rust_begin_unwind (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[4870]:0x3863b1)
    at core::panicking::panic_fmt::hbd8a975261a5f466 (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[4986]:0x387aea)
    at ruffle_web::Ruffle::new_internal::{{closure}}::{{closure}}::h15f929c1b068f5d3 (https://fgn.cdn.serverable.com/common/flashes/js/ruffle210214/4d640ad5aa95d1360f7c8c38e9c8b0d8.wasm:wasm-function[1339]:0x26e509)

Player Info

Allows script access: false

Page Info

Page URL: https://gamcore.com/games/school_girls_1_a_new_job SWF URL: https://fgn.cdn.serverable.com/common/flashes/ff/s/school_girls_1_a_new_job.swf?d=20191106065912

Browser Info

Useragent: Mozilla/5.0 (Linux; Android 10; 5007Z) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Mobile Safari/537.36 OS: Linux armv7l

Ruffle Info

Version: 0.1.0 Name: nightly 2021-02-14 Channel: nightly Built: 2021-02-14T00:19:03.523Z Commit: ecd873eb39c141f9bf2e41454c7a47d5f7e9507c

jhwgh1968 commented 3 years ago

I tried to see if this bug was reproducible on nightly 1c249200.

Instead of the one above, I got a very different panic before anything drew on the screen:

thread 'main' panicked at 'Error in Queue::write_texture: copy of 0..2304 would end up overruning the bounds of the Source buffer of size 1536'

It is really hard to track down, but it seems like there is something weird when the source buffer is built.

This is the section of the wgpu renderer where it seem to originate:

```rust let texture_label = create_debug_label!("{} Texture", debug_str); let texture = self .descriptors .device .create_texture(&wgpu::TextureDescriptor { label: texture_label.as_deref(), size: extent, mip_level_count: 1, sample_count: 1, dimension: wgpu::TextureDimension::D2, format: wgpu::TextureFormat::Rgba8Unorm, usage: wgpu::TextureUsage::SAMPLED | wgpu::TextureUsage::COPY_DST, }); self.descriptors.queue.write_texture( wgpu::TextureCopyView { texture: &texture, mip_level: 0, origin: Default::default(), }, &data, wgpu::TextureDataLayout { offset: 0, bytes_per_row: 4 * extent.width, rows_per_image: 0, }, extent, ); ```

The texture itself is 24x24, which at 16bpp is 1536 bytes. I don't know where 2304 comes from.

If it helps, the debug label is "JPEG2", even though it doesn't seem to be compressed.

Full backtrace (which I think is misleading, but just in case):

``` stack backtrace: 0: 0x5645b982d060 - std::backtrace_rs::backtrace::libunwind::trace::h7494b45d90ec45a4 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5 1: 0x5645b982d060 - std::backtrace_rs::backtrace::trace_unsynchronized::h56cf2035161a18d9 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x5645b982d060 - std::sys_common::backtrace::_print_fmt::hfd16b930749fd013 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/sys_common/backtrace.rs:67:5 3: 0x5645b982d060 - ::fmt::h50d455647eab6579 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/sys_common/backtrace.rs:46:22 4: 0x5645b9852d7c - core::fmt::write::hfdcdeb08fb2b3afa at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/core/src/fmt/mod.rs:1096:17 5: 0x5645b9825742 - std::io::Write::write_fmt::hf1cdfbccd874d77e at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/io/mod.rs:1568:15 6: 0x5645b982f195 - std::sys_common::backtrace::_print::h35bf1431e4a67498 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/sys_common/backtrace.rs:49:5 7: 0x5645b982f195 - std::sys_common::backtrace::print::ha577b54ca4ed89f1 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/sys_common/backtrace.rs:36:9 8: 0x5645b982f195 - std::panicking::default_hook::{{closure}}::h041688187fb081e5 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/panicking.rs:208:50 9: 0x5645b982ecf3 - std::panicking::default_hook::h38b8114a34b4f6c0 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/panicking.rs:225:9 10: 0x5645b982f931 - std::panicking::rust_panic_with_hook::h58660c406232fbfc at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/panicking.rs:591:17 11: 0x5645b982f477 - std::panicking::begin_panic_handler::{{closure}}::hff097664637c7a44 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/panicking.rs:497:13 12: 0x5645b982d4fc - std::sys_common::backtrace::__rust_end_short_backtrace::h8a007fccc86c0e19 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/sys_common/backtrace.rs:141:18 13: 0x5645b982f3d9 - rust_begin_unwind at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/panicking.rs:493:5 14: 0x5645b982f38b - std::panicking::begin_panic_fmt::hfb8db915a9669ea7 at /rustc/4d25f4607015a56d18d7c6c649441608a9298845/library/std/src/panicking.rs:435:5 15: 0x5645b7a38de6 - wgpu::backend::direct::Context::handle_error_fatal::hf640dda26a822304 at /home/cryptkeeper/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.7.0/src/backend/direct.rs:129:9 16: 0x5645b7a40f07 - ::queue_write_texture::hf47997cac9db2cd1 at /home/cryptkeeper/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.7.0/src/backend/direct.rs:1845:25 17: 0x5645b7b2a6bc - wgpu::Queue::write_texture::h71bd382e7ce7852a at /home/cryptkeeper/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.7.0/src/lib.rs:2780:9 18: 0x5645b75a0887 - ruffle_render_wgpu::WgpuRenderBackend::register_bitmap::hfef7ae8513eed427 at /tmp/ruffle/render/wgpu/src/lib.rs:705:9 ```