-
Notifications
You must be signed in to change notification settings - Fork 373
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
Crash on shutdown when using thread local recording stream, Mac only (?) #2889
Comments
Feels likely this could be reproduced from the Rust SDK too, no? |
Rust SDK is also affected: fn main() {
let stream = rerun::RecordingStreamBuilder::new("rerun_example_app_test")
.buffered()
.unwrap();
rerun::RecordingStream::set_thread_local(rerun::StoreKind::Recording, Some(stream));
} ->
|
|
The problem is this: when the thread dies, the destructor of the thread-local I think this is likely a bug in the thread-teardown code of |
Minimal reproduce: use std::cell::RefCell;
struct Foo {}
impl Drop for Foo {
fn drop(&mut self) {
println!("Dropping Foo");
println!("Thread: {:?}", std::thread::current().id()); // panics
}
}
thread_local! {
static THREAD_LOCAL: RefCell<Option<Foo>> = RefCell::new(None);
}
fn main() {
THREAD_LOCAL.with(|cell| *cell.borrow_mut() = Some(Foo {}));
println!("So far so good!");
} Output:
|
This adds an ugly workaround for the crash in #2889
) ### What * Closes #3558 * Closes #2889 * Opens #3937 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3929) (if applicable) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/3929) - [Docs preview](https://rerun.io/preview/2b1469294de742102f69f16f6ecb8dc0e3e3a0c5/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/2b1469294de742102f69f16f6ecb8dc0e3e3a0c5/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/) --------- Co-authored-by: Andreas Reich <[email protected]>
Does not repro on Linux, observed so far only on my mac.
When doing this from C++
I get a crash on application shutdown with the following callstack:
The text was updated successfully, but these errors were encountered: