rerun-io / rerun

Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui.
https://rerun.io/
Apache License 2.0
6.24k stars 290 forks source link

C++ SDK crash on shutdown #5260

Open emilk opened 6 months ago

emilk commented 6 months ago

A user reported that:

const auto rr = rerun::RecordingStream("...");
rr.connect().exit_on_failure();

on Pop OS (Ubuntu) results in:

thread '<unnamed>' panicked at library/std/src/thread/mod.rs:711:35:
use of std::thread::current() is not possible after the thread's local data has been destroyed
stack backtrace:
   0: rust_begin_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_display
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:168:5
   3: core::panicking::panic_str
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:152:5
   4: core::option::expect_failed
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/option.rs:1988:5
   5: core::option::Option<T>::expect
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/option.rs:898:21
   6: std::thread::current
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/mod.rs:711:35
   7: crossbeam_channel::context::Context::new
   8: crossbeam_channel::flavors::zero::Channel<T>::recv
   9: crossbeam_channel::channel::Receiver<T>::recv
  10: re_log_types::data_table_batcher::DataTableBatcherInner::flush_blocking
  11: re_sdk::recording_stream::RecordingStream::set_sink
  12: rr_recording_stream_free
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aborted (core dumped)

This sounds similar to:

Wumpf commented 1 month ago

still happens for @02alexander

Crash log:

[2024-08-06T15:03:46Z DEBUG re_chunk::batcher] creating new chunk batcher config=ChunkBatcherConfig { flush_tick: 8ms, flush_num_bytes: 1048576, flush_num_rows: 18446744073709551615, chunk_max_rows_if_unsorted: 256, max_commands_in_flight: None, max_chunks_in_flight: None, hooks: BatcherHooks { on_insert: None, on_release: None } }
[2024-08-06T15:03:46Z DEBUG re_sdk::recording_stream] setting recording info app_id=HelloWorld rec_id=30719026-ecff-488c-9b01-a1c0b53ff661
[2024-08-06T15:03:46Z DEBUG re_sdk_comms::buffered_client] Connecting to remote 127.0.0.1:9876…
[2024-08-06T15:03:46Z DEBUG re_sdk::recording_stream] setting recording info app_id=HelloWorld rec_id=30719026-ecff-488c-9b01-a1c0b53ff661
[2024-08-06T15:03:46Z DEBUG re_sdk_comms::buffered_client] Flushing message queue…
[2024-08-06T15:03:46Z DEBUG re_sdk_comms::tcp_client] Connecting to 127.0.0.1:9876…
[2024-08-06T15:03:46Z DEBUG re_sdk_comms::buffered_client] Failed to send message: Failed to connect to Rerun server at 127.0.0.1:9876: Connection refused (os error 111)
[2024-08-06T15:03:46Z DEBUG re_sdk_comms::tcp_client] Connecting to 127.0.0.1:9876…
[2024-08-06T15:03:46Z DEBUG re_sdk_comms::tcp_client] Connecting to 127.0.0.1:9876…
[2024-08-06T15:03:46Z WARN  re_sdk_comms::buffered_client] Failed to send message after 3 attempts: Failed to connect to Rerun server at 127.0.0.1:9876: Connection refused (os error 111)
[2024-08-06T15:03:47Z DEBUG re_sdk_comms::tcp_client] Connecting to 127.0.0.1:9876…
[2024-08-06T15:03:48Z DEBUG re_sdk_comms::tcp_client] Connecting to 127.0.0.1:9876…
[2024-08-06T15:03:49Z DEBUG re_sdk_comms::tcp_client] Connecting to 127.0.0.1:9876…
[2024-08-06T15:03:49Z WARN  re_sdk_comms::buffered_client] Dropping messages because tcp client has timed out.
[2024-08-06T15:03:49Z WARN  re_sdk_comms::buffered_client] Dropping messages because tcp client has timed out.
[2024-08-06T15:03:49Z WARN  re_sdk_comms::tcp_client] Tried to flush while TCP stream was still Pending. Data was possibly dropped.
[2024-08-06T15:03:49Z DEBUG re_sdk_comms::buffered_client] Flush complete.
thread '<unnamed>' panicked at library/std/src/thread/mod.rs:709:35:
use of std::thread::current() is not possible after the thread's local data has been destroyed
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_display
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:196:5
   3: core::panicking::panic_str
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:171:5
   4: core::option::expect_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:1980:5
   5: core::option::Option<T>::expect
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:894:21
   6: std::thread::current
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/mod.rs:709:35
   7: crossbeam_channel::context::Context::new
   8: crossbeam_channel::flavors::zero::Channel<T>::recv
   9: crossbeam_channel::channel::Receiver<T>::recv
  10: re_chunk::batcher::ChunkBatcherInner::flush_blocking
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[1]    152476 IOT instruction (core dumped)  RUST_BACKTRACE=1 RUST_LOG=debug ./global_crash