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

Text rendering outside of the UI #971

Closed
Weasy666 opened this issue Dec 1, 2020 · 7 comments · Fixed by #1122
Closed

Text rendering outside of the UI #971

Weasy666 opened this issue Dec 1, 2020 · 7 comments · Fixed by #1122
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets P-Crash A sudden unexpected crash

Comments

@Weasy666
Copy link
Contributor

Weasy666 commented Dec 1, 2020

This was initially about an error that occured while i tried to render text with TextComponents on the 2D camera.

Bevy version

Bevy Release: 0.3.0

Operating system & version

Edition Windows 10 Pro
Version 20H2
OSbuild 19042.630

What you did

You can clone and run this example repo.

What you expected to happen

I expected Bevy to render all components with their children.

What actually happened

This error occured

'Compute Task Pool (1)' panicked... - Click me to see the rest!

thread 'Compute Task Pool (1)' panicked at 'called `Option::unwrap()` on a `None` value', ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_ui-0.3.0\src\flex\mod.rs:151:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'Compute Task Pool (2)' panicked at 'task has failed', ..\.cargo\registry\src\github.com-1ecc6299db9ec823\async-task-4.0.3\src\task.rs:368:45
thread 'main' panicked at 'task has failed', ..\.cargo\registry\src\github.com-1ecc6299db9ec823\async-task-4.0.3\src\task.rs:368:45
thread 'main' panicked at 'task thread panicked while executing: Any', ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_tasks-0.3.0\src\task_pool.rs:75:18
stack backtrace:
   0:     0x7ff7de4501e9 - std::backtrace_rs::backtrace::dbghelp::trace
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
   1:     0x7ff7de4501e9 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff7de4501e9 - std::sys_common::backtrace::_print_fmt
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\sys_common\backtrace.rs:79
   3:     0x7ff7de4501e9 - std::sys_common::backtrace::_print::{{impl}}::fmt
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\sys_common\backtrace.rs:58
   4:     0x7ff7de4678bb - core::fmt::write
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\core\src\fmt\mod.rs:1080
   5:     0x7ff7de44c168 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\io\mod.rs:1516
   6:     0x7ff7de452fd4 - std::sys_common::backtrace::_print
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\sys_common\backtrace.rs:61
   7:     0x7ff7de452fd4 - std::sys_common::backtrace::print
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\sys_common\backtrace.rs:48
   8:     0x7ff7de452fd4 - std::panicking::default_hook::{{closure}}
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:208
   9:     0x7ff7de452bb8 - std::panicking::default_hook
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:227
  10:     0x7ff7de45388f - std::panicking::rust_panic_with_hook
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:577
  11:     0x7ff7de4533f5 - std::panicking::begin_panic_handler::{{closure}}
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:484
  12:     0x7ff7de450acf - std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!>
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\sys_common\backtrace.rs:153
  13:     0x7ff7de4533a9 - std::panicking::begin_panic_handler
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:483
  14:     0x7ff7de465320 - core::panicking::panic_fmt
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\core\src\panicking.rs:85
  15:     0x7ff7de465143 - core::option::expect_none_failed
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\core\src\option.rs:1234
  16:     0x7ff7de3ce941 - core::result::Result<tuple<>, alloc::boxed::Box<Any>>::expect<tuple<>,alloc::boxed::Box<Any>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\result.rs:933
  17:     0x7ff7de3d2b12 - bevy_tasks::task_pool::{{impl}}::drop
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_tasks-0.3.0\src\task_pool.rs:73
  18:     0x7ff7de3ca85f - core::ptr::drop_in_place<bevy_tasks::task_pool::TaskPoolInner>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  19:     0x7ff7de30e9e2 - alloc::sync::Arc<bevy_tasks::task_pool::TaskPoolInner>::drop_slow<bevy_tasks::task_pool::TaskPoolInner>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\sync.rs:934
  20:     0x7ff7de30ecf5 - alloc::sync::{{impl}}::drop<bevy_tasks::task_pool::TaskPoolInner>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\sync.rs:1454
  21:     0x7ff7de30736e - core::ptr::drop_in_place<alloc::sync::Arc<bevy_tasks::task_pool::TaskPoolInner>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  22:     0x7ff7de307ef3 - core::ptr::drop_in_place<bevy_tasks::task_pool::TaskPool>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  23:     0x7ff7de308dee - core::ptr::drop_in_place<bevy_tasks::usages::ComputeTaskPool>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  24:     0x7ff7de3443be - core::ptr::mut_ptr::{{impl}}::drop_in_place<bevy_tasks::usages::ComputeTaskPool>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mut_ptr.rs:963
  25:     0x7ff7de34618d - bevy_hecs::archetype::{{impl}}::of::drop_ptr<bevy_tasks::usages::ComputeTaskPool>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_hecs-0.3.0\src\archetype.rs:493
  26:     0x7ff7de41c176 - bevy_hecs::archetype::Archetype::clear
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_hecs-0.3.0\src\archetype.rs:88
  27:     0x7ff7de41d739 - bevy_hecs::archetype::{{impl}}::drop
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_hecs-0.3.0\src\archetype.rs:424
  28:     0x7ff7de41906f - core::ptr::drop_in_place<bevy_hecs::archetype::Archetype>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  29:     0x7ff7de3071df - core::ptr::drop_in_place<bevy_ecs::resource::resources::ResourceData>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  30:     0x7ff7de3084a5 - core::ptr::drop_in_place<tuple<core::any::TypeId, bevy_ecs::resource::resources::ResourceData>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  31:     0x7ff7de32005e - core::ptr::mut_ptr::{{impl}}::drop_in_place<tuple<core::any::TypeId, bevy_ecs::resource::resources::ResourceData>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mut_ptr.rs:963
  32:     0x7ff7de3291ad - hashbrown::raw::Bucket<tuple<core::any::TypeId, bevy_ecs::resource::resources::ResourceData>>::drop<tuple<core::any::TypeId, bevy_ecs::resource::resources::ResourceData>>
                               at C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.9.0\src\raw\mod.rs:334
  33:     0x7ff7de32757d - hashbrown::raw::{{impl}}::drop<tuple<core::any::TypeId, bevy_ecs::resource::resources::ResourceData>>
                               at C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\hashbrown-0.9.0\src\raw\mod.rs:1325
  34:     0x7ff7de307c5e - core::ptr::drop_in_place<hashbrown::raw::RawTable<tuple<core::any::TypeId, bevy_ecs::resource::resources::ResourceData>>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  35:     0x7ff7de307545 - core::ptr::drop_in_place<hashbrown::map::HashMap<core::any::TypeId, bevy_ecs::resource::resources::ResourceData, ahash::random_state::RandomState>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  36:     0x7ff7de307d7e - core::ptr::drop_in_place<std::collections::hash::map::HashMap<core::any::TypeId, bevy_ecs::resource::resources::ResourceData, ahash::random_state::RandomState>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  37:     0x7ff7de2e9e7f - core::ptr::drop_in_place<bevy_ecs::resource::resources::Resources>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  38:     0x7ff7de2e9c2c - core::ptr::drop_in_place<bevy_app::app::App>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  39:     0x7ff7dd753fbe - core::ptr::drop_in_place<closure-1>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  40:     0x7ff7dd7538be - core::ptr::drop_in_place<closure-0>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  41:     0x7ff7dd7c3799 - core::ptr::drop_in_place<alloc::boxed::Box<FnMut<tuple<winit::event::Event<tuple<>>, mut winit::event_loop::ControlFlow*>>>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:175
  42:     0x7ff7dd7e7f8c - winit::platform_impl::platform::event_loop::runner::{{impl}}::call_event_handler::{{closure}}<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop\runner.rs:252
  43:     0x7ff87b1b1030 - <unknown>
  44:     0x7ff87b1b4a52 - is_exception_typeof
  45:     0x7ff87b1be7f4 - _C_specific_handler
  46:     0x7ff87b1b3cc8 - is_exception_typeof
  47:     0x7ff87b1bf131 - _CxxFrameHandler3
  48:     0x7ff885d5117f - _chkstk
  49:     0x7ff885cd1c56 - RtlUnwindEx
  50:     0x7ff87b1becbe - _C_specific_handler
  51:     0x7ff87b1b2955 - is_exception_typeof
  52:     0x7ff87b1b2d81 - is_exception_typeof
  53:     0x7ff87b1b3dc4 - is_exception_typeof
  54:     0x7ff87b1bf131 - _CxxFrameHandler3
  55:     0x7ff885d510ff - _chkstk
  56:     0x7ff885cfb474 - RtlRaiseException
  57:     0x7ff885cfb1c5 - RtlRaiseException
  58:     0x7ff883903e49 - RaiseException
  59:     0x7ff87b1b6220 - CxxThrowException
  60:     0x7ff7de4595f1 - panic_unwind::real_imp::panic
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\panic_unwind\src\seh.rs:315
  61:     0x7ff7de459579 - panic_unwind::__rust_start_panic
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\panic_unwind\src\lib.rs:112
  62:     0x7ff7de453aa8 - std::panicking::rust_panic
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:626
  63:     0x7ff7de453946 - std::panicking::rust_panic_with_hook
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:596
  64:     0x7ff7de4533f5 - std::panicking::begin_panic_handler::{{closure}}
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:484
  65:     0x7ff7de450acf - std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!>
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\sys_common\backtrace.rs:153
  66:     0x7ff7de4533a9 - std::panicking::begin_panic_handler
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:483
  67:     0x7ff7de465320 - core::panicking::panic_fmt
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\core\src\panicking.rs:85
  68:     0x7ff7de4650a2 - core::option::expect_failed
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\core\src\option.rs:1226
  69:     0x7ff7de30de41 - core::option::Option<alloc::vec::Vec<tuple<>>>::expect<alloc::vec::Vec<tuple<>>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\option.rs:346
  70:     0x7ff7de34581d - async_task::task::{{impl}}::poll<alloc::vec::Vec<tuple<>>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\async-task-4.0.3\src\task.rs:368
  71:     0x7ff7de324de9 - futures_lite::future::block_on::{{closure}}<alloc::vec::Vec<tuple<>>,async_task::task::Task<alloc::vec::Vec<tuple<>>>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-lite-1.11.2\src\future.rs:89
  72:     0x7ff7de319c24 - std::thread::local::LocalKey<core::cell::RefCell<tuple<parking::Parker, core::task::wake::Waker>>>::try_with<core::cell::RefCell<tuple<parking::Parker, core::task::wake::Waker>>,closure-0,alloc::vec::Vec<tuple<>>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\local.rs:272
  73:     0x7ff7de319a28 - std::thread::local::LocalKey<core::cell::RefCell<tuple<parking::Parker, core::task::wake::Waker>>>::with<core::cell::RefCell<tuple<parking::Parker, core::task::wake::Waker>>,closure-0,alloc::vec::Vec<tuple<>>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\local.rs:248
  74:     0x7ff7de324c9d - futures_lite::future::block_on<alloc::vec::Vec<tuple<>>,async_task::task::Task<alloc::vec::Vec<tuple<>>>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-lite-1.11.2\src\future.rs:79
  75:     0x7ff7de305e95 - bevy_tasks::task_pool::TaskPool::scope<closure-0,tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_tasks-0.3.0\src\task_pool.rs:197
  76:     0x7ff7de34a1ca - bevy_ecs::schedule::parallel_executor::ExecutorStage::run_systems
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_ecs-0.3.0\src\schedule\parallel_executor.rs:327
  77:     0x7ff7de34ba0d - bevy_ecs::schedule::parallel_executor::ExecutorStage::run
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_ecs-0.3.0\src\schedule\parallel_executor.rs:465
  78:     0x7ff7de34859d - bevy_ecs::schedule::parallel_executor::ParallelExecutor::run
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_ecs-0.3.0\src\schedule\parallel_executor.rs:62
  79:     0x7ff7de2f56b0 - bevy_app::app::App::update
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_app-0.3.0\src\app.rs:63
  80:     0x7ff7dd74b6ea - bevy_winit::winit_runner::{{closure}}
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_winit-0.3.0\src\lib.rs:292
  81:     0x7ff7dd791908 - winit::platform_impl::platform::event_loop::{{impl}}::run_return::{{closure}}<tuple<>,closure-1>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop.rs:203
  82:     0x7ff7dd7b7e73 - alloc::boxed::{{impl}}::call_mut<tuple<winit::event::Event<tuple<>>, mut winit::event_loop::ControlFlow*>,FnMut<tuple<winit::event::Event<tuple<>>, mut winit::event_loop::ControlFlow*>>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\boxed.rs:1049
  83:     0x7ff7dd7e7e1b - winit::platform_impl::platform::event_loop::runner::{{impl}}::call_event_handler::{{closure}}<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop\runner.rs:245
  84:     0x7ff7dd7d1a76 - std::panic::{{impl}}::call_once<tuple<>,closure-0>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:308
  85:     0x7ff7dd7b5a10 - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure-0>,tuple<>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:381
  86:     0x7ff7dd7ba957 - winit::window::{{impl}}::clone
  87:     0x7ff7dd7b56ca - std::panicking::try<tuple<>,std::panic::AssertUnwindSafe<closure-0>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:345
  88:     0x7ff7dd7d1b66 - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure-0>,tuple<>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:382
  89:     0x7ff7dd7e7259 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple<>>::catch_unwind<tuple<>,tuple<>,closure-0>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop\runner.rs:152
  90:     0x7ff7dd7e7bb1 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple<>>::call_event_handler<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop\runner.rs:239
  91:     0x7ff7dd7e860f - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple<>>::move_state_to<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop\runner.rs:341
  92:     0x7ff7dd7e7b37 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple<>>::main_events_cleared<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop\runner.rs:227
  93:     0x7ff7dd7d7e48 - winit::platform_impl::platform::event_loop::flush_paint_messages<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop.rs:676
  94:     0x7ff7dd7923fa - winit::platform_impl::platform::event_loop::public_window_callback::{{closure}}<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop.rs:831
  95:     0x7ff7dd751847 - core::ops::function::FnOnce::call_once<closure-0,tuple<>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
  96:     0x7ff7dd7743d3 - std::panic::{{impl}}::call_once<isize,closure-0>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:308
  97:     0x7ff7dd788b0e - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure-0>,isize>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:381
  98:     0x7ff7dd78c417 - hashbrown::set::HashSet<mut winapi::shared::windef::HWND__*, std::collections::hash::map::RandomState>::remove<mut winapi::shared::windef::HWND__*,std::collections::hash::map::RandomState,mut winapi::shared::windef::HWND__*>
  99:     0x7ff7dd788a03 - std::panicking::try<isize,std::panic::AssertUnwindSafe<closure-0>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:345
 100:     0x7ff7dd774c0e - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure-0>,isize>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:382
 101:     0x7ff7dd777643 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner<tuple<>>::catch_unwind<tuple<>,isize,closure-0>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop\runner.rs:152
 102:     0x7ff7dd791c6f - winit::platform_impl::platform::event_loop::public_window_callback<tuple<>>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop.rs:1909
 103:     0x7ff86f9ed3b6 - DefSubclassProc
 104:     0x7ff86f9ed26c - DefSubclassProc
 105:     0x7ff88582e858 - CallWindowProcW
 106:     0x7ff88582e3dc - DispatchMessageW
 107:     0x7ff885840bc3 - SendMessageTimeoutW
 108:     0x7ff885d4fbd4 - KiUserCallbackDispatcher
 109:     0x7ff883761704 - NtUserDispatchMessage
 110:     0x7ff88582e2ea - DispatchMessageW
 111:     0x7ff7dd7915d6 - winit::platform_impl::platform::event_loop::EventLoop<tuple<>>::run_return<tuple<>,closure-1>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop.rs:218
 112:     0x7ff7dd7919e6 - winit::platform_impl::platform::event_loop::EventLoop<tuple<>>::run<tuple<>,closure-1>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\platform_impl\windows\event_loop.rs:188
 113:     0x7ff7dd77005d - winit::event_loop::EventLoop<tuple<>>::run<tuple<>,closure-1>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.23.0\src\event_loop.rs:154
 114:     0x7ff7dd74a34d - bevy_winit::run<closure-1>
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_winit-0.3.0\src\lib.rs:105
 115:     0x7ff7dd74a686 - bevy_winit::winit_runner
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_winit-0.3.0\src\lib.rs:300
 116:     0x7ff7dd7513ae - core::ops::function::Fn::call<fn(bevy_app::app::App),tuple<bevy_app::app::App>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:70
 117:     0x7ff7de2f0b25 - alloc::boxed::{{impl}}::call<tuple<bevy_app::app::App>,Fn<tuple<bevy_app::app::App>>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\boxed.rs:1056
 118:     0x7ff7de2f585c - bevy_app::app::App::run
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_app-0.3.0\src\app.rs:81
 119:     0x7ff7de2f5df0 - bevy_app::app_builder::AppBuilder::run
                               at ..\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_app-0.3.0\src\app_builder.rs:43
 120:     0x7ff7dcbb31d5 - bevy_bug::main
                               at E:\Code\Rust\bevy_bug\src\main.rs:5
 121:     0x7ff7dcbb920b - core::ops::function::FnOnce::call_once<fn(),tuple<>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:227
 122:     0x7ff7dcbb870b - std::sys_common::backtrace::__rust_begin_short_backtrace<fn(),tuple<>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys_common\backtrace.rs:137
 123:     0x7ff7dcba14c1 - std::rt::lang_start::{{closure}}<tuple<>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:66
 124:     0x7ff7de453bd3 - core::ops::function::impls::{{impl}}::call_once
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\library\core\src\ops\function.rs:280
 125:     0x7ff7de453bd3 - std::panicking::try::do_call
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:381
 126:     0x7ff7de453bd3 - std::panicking::try
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panicking.rs:345
 127:     0x7ff7de453bd3 - std::panic::catch_unwind
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\panic.rs:382
 128:     0x7ff7de453bd3 - std::rt::lang_start_internal
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4\/library\std\src\rt.rs:51
 129:     0x7ff7dcba1493 - std::rt::lang_start<tuple<>>
                               at ..\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:65
 130:     0x7ff7dcbb3640 - main
 131:     0x7ff7de7fc588 - invoke_main
                               at d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
 132:     0x7ff7de7fc588 - __scrt_common_main_seh
                               at d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
 133:     0x7ff884f57034 - BaseThreadInitThunk
 134:     0x7ff885cfcec1 - RtlUserThreadStart
thread panicked while panicking. aborting.

Additional information

Any additional information you would like to add such as screenshots, logs, etc.

@mockersf
Copy link
Member

mockersf commented Dec 1, 2020

Issue is that you have an entity which belongs to the UI world as a child of an entity that belongs to the 2D world...
NodeComponents is placed by the UI flex systems, and need all of it's parent to also be placed that way. SpriteComponents isn't, it's placed by the 2D systems, and as such doesn't have the components needed for UI placement.

This could be better handled by the engine... but if you want to get around the failure, just don't mix UI components with others...

@Weasy666
Copy link
Contributor Author

Weasy666 commented Dec 2, 2020

Ok...so how can i display a text in my 2D world, which is a child of another 2D component?
Before using NodeComponents i simply tried to use TextComponents, but got the same error. From the name of it, i expected TextComponents to simply work.

@Moxinilian Moxinilian added core P-Crash A sudden unexpected crash labels Dec 2, 2020
@Moxinilian
Copy link
Member

I’ll still mark this as an inappropriate crash and leave this open until we have something more graceful when this happens.

@Weasy666
Copy link
Contributor Author

Weasy666 commented Dec 3, 2020

Cool. Could one of you two be so kind and tell me how i can add text as a child to a 2D component?
I can't seem to find it.

@Weasy666
Copy link
Contributor Author

Weasy666 commented Dec 8, 2020

As per Discord, Bevy currently only has text rendering in the UI render pipeline. For 2D and 3D that still needs to be implemented. 2D could potentially be rather easy, when one can reuse stuff from the UI pipeline.

@Weasy666 Weasy666 changed the title Compute Task Pool (1)' panicked... - when using children on children Text rendering outside of the UI Dec 8, 2020
@CleanCut
Copy link
Member

Would anyone like to collaborate with me to implement the 2D functionality for this? I'm thinking of digging into this some time next week.

Documenting info I learned from @cart in Discord:

  • The implementation should live within bevy_text
  • The general approach is to mimic what the TextBundle component and draw_text_system system are doing, without the UI-specific stuff.
  • Specifically, we will use DrawableText
  • We'll use a MainPass component to hook into rendering via Camera2dBundle. More generally:
    • The presence of a MainPass component causes things to be rendered by Camera2dBundle/Camera3dBundle
    • The presence of a Node component causes things to be rendered by CameraUiBundle
    • The determination of the actual camera is done via the name of the camera...somewhere

@Moxinilian Moxinilian added A-UI Graphical user interfaces, styles, layouts, and widgets and removed core labels Dec 23, 2020
@CleanCut
Copy link
Member

Thanks to @PabloMansanet's help, the implementation is ready for review/testing. Give it a try! #1122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets P-Crash A sudden unexpected crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants