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

New traking cause my app error #2695

Closed
jinleili opened this issue May 26, 2022 · 2 comments · Fixed by #2703
Closed

New traking cause my app error #2695

jinleili opened this issue May 26, 2022 · 2 comments · Fixed by #2703
Assignees

Comments

@jinleili
Copy link
Contributor

Description
Update wgpu from rev="dd6febe3"(Update deno) to "91142837", running my app caused error:

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `true`,
 right: `false`', /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/track/texture.rs:1017:13
stack backtrace:

   0:        0x104a6b3f8 - std::backtrace_rs::backtrace::libunwind::trace::h449592924b3bd63f
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x104a6b3f8 - std::backtrace_rs::backtrace::trace_unsynchronized::ha2aaeafed0c31c90
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x104a6b3f8 - std::sys_common::backtrace::_print_fmt::h58db85a17304976f
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:66:5
   3:        0x104a6b3f8 - ::fmt::h10cf06316d33e2a9
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:45:22
   4:        0x104a88aa4 - core::fmt::write::h1faf18c959c3a8df
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/fmt/mod.rs:1190:17
   5:        0x104a67e48 - std::io::Write::write_fmt::h86ab231360bc97d2
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/io/mod.rs:1657:15
   6:        0x104a6d538 - std::sys_common::backtrace::_print::h771b4aab9b128422
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:48:5
   7:        0x104a6d538 - std::sys_common::backtrace::print::h637de99a9f76e8a7
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:35:9
   8:        0x104a6d538 - std::panicking::default_hook::{{closure}}::h36e628ffaf3cd44f
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:295:22
   9:        0x104a6d1b0 - std::panicking::default_hook::h3ee1564a7544e58f
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:314:9
  10:        0x104a6db98 - std::panicking::rust_panic_with_hook::h191339fbd2fe2360
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:698:17
  11:        0x104a6d920 - std::panicking::begin_panic_handler::{{closure}}::h91c230befd9929e3
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:588:13
  12:        0x104a6b8e0 - std::sys_common::backtrace::__rust_end_short_backtrace::haaaeebb1d37476b3
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:138:18
  13:        0x104a6d65c - rust_begin_unwind
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
  14:        0x104a9fb34 - core::panicking::panic_fmt::h4fe1013b011ef602
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
  15:        0x104a86398 - core::panicking::assert_failed_inner::h67a65df2c19c8ccd
  16:        0x104a9774c - core::panicking::assert_failed::ha39807bdbf684e74
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:182:5
  17:        0x1046c08e0 - wgpu_core::track::texture::insert::h8de777a228702e9c
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/track/texture.rs:1017:13
  18:        0x1046c08e0 - wgpu_core::track::texture::insert_or_merge::hbb23c541e3bda43a
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/track/texture.rs:908:9
  19:        0x1046c08e0 - wgpu_core::track::texture::TextureUsageScope::merge_single::hd39334c76f8c5cb6
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/track/texture.rs:362:9
  20:        0x1046be260 - wgpu_core::track::texture::TextureUsageScope::merge_bind_group::h91b289cbeec1da25
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/track/texture.rs:330:13
  21:        0x10470cc38 - wgpu_core::track::UsageScope::merge_bind_group::h8cb740d9346d060c
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/track/mod.rs:589:9
  22:        0x1045880a0 - wgpu_core::command::render::>::command_encoder_run_render_pass_impl::h6b87929b51c40d7b
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/command/render.rs:1171:29
  23:        0x104581c54 - wgpu_core::command::render::>::command_encoder_run_render_pass::h978836a7a16506d9
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu-core/src/command/render.rs:1031:9
  24:        0x104626e48 - ::command_encoder_end_render_pass::hcfd3a889b2608513
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu/src/backend/direct.rs:2042:13
  25:        0x104677d28 - ::drop::hdd2861be20525bdc
                               at /Users/lijinlei/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/9114283/wgpu/src/lib.rs:3078:13
  26:        0x1044d139c - core::ptr::drop_in_place::ha5242dfdac7ae426
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ptr/mod.rs:188:1
  27:        0x1044d3958 - ::enter_frame::hdf43f9556821e079
                               at /Users/lijinlei/Rust/idroid/gpu-nature/src/canvas.rs:92:9
  28:        0x104355f48 - nature::main::{{closure}}::h45d22a2a203958e6
                               at /Users/lijinlei/Rust/idroid/gpu-nature/examples/nature.rs:111:17
  29:        0x1043593f0 -  as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::{{closure}}::h7e4f251035564a87
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/app_state.rs:101:13
  30:        0x104358f6c - winit::platform_impl::platform::app_state::EventLoopHandler::with_callback::h0b0f33fb9f68bb24
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/app_state.rs:79:13
  31:        0x1043592c0 -  as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::h3b774ac0d67c5f5e
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/app_state.rs:100:9
  32:        0x1045068d8 - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::h518b599f82cc8279
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/app_state.rs:206:21
  33:        0x10450848c - winit::platform_impl::platform::app_state::AppState::cleared::ha57f7cc707d30a00
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/app_state.rs:389:13
  34:        0x10453d7c4 - winit::platform_impl::platform::observer::control_flow_end_handler::{{closure}}::hf8b71e2b70fda96f
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/observer.rs:180:21
  35:        0x10453d5e4 - winit::platform_impl::platform::observer::control_flow_handler::{{closure}}::hb05e4408452e961a
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/observer.rs:142:57
  36:        0x104531964 - std::panicking::try::do_call::h56a1169439412e51
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:492:40
  37:        0x104531b3c - ___rust_try
  38:        0x104531760 - std::panicking::try::h9730f743a80c9838
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:456:19
  39:        0x10450a4b8 - std::panic::catch_unwind::hbcd12e7943737783
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panic.rs:137:14
  40:        0x10452e27c - winit::platform_impl::platform::event_loop::stop_app_on_panic::h3b9bbbd8b886e14d
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/event_loop.rs:229:11
  41:        0x10453d548 - winit::platform_impl::platform::observer::control_flow_handler::hea31f09584e9f9c5
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/observer.rs:142:5
  42:        0x10453d740 - winit::platform_impl::platform::observer::control_flow_end_handler::h4ab549aa57759c83
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/observer.rs:175:9
  43:        0x1c2714244 - 
  44:        0x1c2714094 - 
  45:        0x1c27136e0 - 
  46:        0x1c2712b24 - 
  47:        0x1cb34b338 - 
  48:        0x1cb34b0b4 - 
  49:        0x1cb34ae68 - 
  50:        0x1c527978c - 
  51:        0x1c5278084 - 
  52:        0x1c526a250 - 
  53:        0x104a2af38 - <() as objc::message::MessageArguments>::invoke::h844c517ddbf88b0a
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/objc-0.2.7/src/message/mod.rs:128:17
  54:        0x104a06d1c - objc::message::platform::send_unverified::h711ea951466fd3e2
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/objc-0.2.7/src/message/apple/mod.rs:27:9
  55:        0x10435717c - objc::message::send_message::hd0e0498562591f89
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/objc-0.2.7/src/message/mod.rs:178:5
  56:        0x10435717c - winit::platform_impl::platform::event_loop::EventLoop::run_return::{{closure}}::h3b1a56f1e85200e7
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/event_loop.rs:188:22
  57:        0x104359c5c - objc::rc::autorelease::autoreleasepool::h203b75b0b2dd0324
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/objc-0.2.7/src/rc/autorelease.rs:29:5
  58:        0x104356dfc - winit::platform_impl::platform::event_loop::EventLoop::run_return::hf9cf06a62328ccd0
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/event_loop.rs:178:9
  59:        0x104356cb0 - winit::platform_impl::platform::event_loop::EventLoop::run::h7745ccc98cb10904
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/macos/event_loop.rs:157:9
  60:        0x104353b84 - winit::event_loop::EventLoop::run::h4a1c265f87abbf0f
                               at /Users/lijinlei/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.26.1/src/event_loop.rs:154:9
  61:        0x10435a020 - nature::main::h3d6abece2ebb2f5e
                               at /Users/lijinlei/Rust/idroid/gpu-nature/examples/nature.rs:33:5
  62:        0x10435ae34 - core::ops::function::FnOnce::call_once::hde607609c1094811
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
  63:        0x104354120 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1f30ddf8729916f3
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:122:18
  64:        0x10435520c - std::rt::lang_start::{{closure}}::h6a92192bf6fd972c
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/rt.rs:145:18
  65:        0x104a6aca4 - core::ops::function::impls:: for &F>::call_once::h8eb3ac20f80eabfa
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:259:13
  66:        0x104a6aca4 - std::panicking::try::do_call::ha6ddf2c638427188
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:492:40
  67:        0x104a6aca4 - std::panicking::try::hda8741de507c1ad0
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:456:19
  68:        0x104a6aca4 - std::panic::catch_unwind::h82424a01f258bd39
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panic.rs:137:14
  69:        0x104a6aca4 - std::rt::lang_start_internal::{{closure}}::h67e296ed5b030b7b
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/rt.rs:128:48
  70:        0x104a6aca4 - std::panicking::try::do_call::hd3dd7e7e10f6424e
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:492:40
  71:        0x104a6aca4 - std::panicking::try::ha0a7bd8122e3fb7c
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:456:19
  72:        0x104a6aca4 - std::panic::catch_unwind::h809b0e1092e9475d
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panic.rs:137:14
  73:        0x104a6aca4 - std::rt::lang_start_internal::h358b6d58e23c88c7
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/rt.rs:128:20
  74:        0x1043551d4 - std::rt::lang_start::hdb6a7709043a9706
                               at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/rt.rs:144:17
  75:        0x10435a068 - _main
-[_MTLCommandEncoder dealloc]:131: failed assertion `Command encoder released without endEncoding'
zsh: abort      RUST_BACKTRACE=full cargo run --example nature
	

Extra materials
Tracer recorded files
Running properly:NORMAL.zip
Running crashed:ERROR.zip

Platform
Metal backend on macOS 12.4

@cwfitzgerald cwfitzgerald self-assigned this May 26, 2022
@cwfitzgerald
Copy link
Member

cwfitzgerald commented May 26, 2022

The issue stems from https://github.com/gfx-rs/wgpu/blob/master/wgpu-core/src/device/mod.rs#L1026 which is how the texture is used, RESOURCE | STORAGE_READ is an invalid usage for a texture - need to figure out what that code was initially trying to do.

@jinleili
Copy link
Contributor Author

texture usage: TextureUsages::TEXTURE_BINDING | TextureUsages::STORAGE_BINDING and StorageTextureAccess only set WriteOnly, crash occurs on third frame when draw_indexed is executed

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

Successfully merging a pull request may close this issue.

2 participants