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

ObjectPool creates uninitialized memory of forbidden types #109

Open
riking opened this issue Feb 27, 2024 · 0 comments
Open

ObjectPool creates uninitialized memory of forbidden types #109

riking opened this issue Feb 27, 2024 · 0 comments

Comments

@riking
Copy link

riking commented Feb 27, 2024

See also #87. This was introduced in commit 9c28844, part of version 0.6.0.

https://asan.saethlin.dev/ub?crate=crayon&version=0.7.1

---- src/video/mod.rs - video (line 113) stdout ----
Test executable failed (signal: 6 (SIGABRT) (core dumped)).

stderr:
thread 'main' panicked at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:136:5:
attempted to leave type `crayon::video::assets::shader::ShaderParams` uninitialized, which is invalid
stack backtrace:
   0: rust_begin_unwind
             at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_nounwind_fmt
             at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:106:14
   2: core::panicking::panic_nounwind
             at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panicking.rs:136:5
   3: core::mem::uninitialized
             at /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:692:9
   4: crayon::utils::object_pool::ObjectPool<H,T>::free
             at ./src/utils/object_pool.rs:80:29
   5: crayon::video::system::VideoSystem::delete_shader
             at ./src/video/system.rs:203:12
   6: crayon::video::delete_shader
             at ./src/video/mod.rs:302:5
   7: rust_out::main::_doctest_main_src_video_mod_rs_113_0
             at ./src/video/mod.rs:33:1
[affected]
functions = { "crayon::utils::object_pool::ObjectPool<H,T>::free" = [">=0.6.0"] }
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

No branches or pull requests

1 participant