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

thread '<unnamed>' panicked at 'called Option::unwrap() on a None value' on FreeBSD #47

Closed
messense opened this issue Feb 10, 2023 · 2 comments

Comments

@messense
Copy link

messense commented Feb 10, 2023

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /.cargo/registry/src/github.com-1ecc6299db9ec823/thread_local-1.1.6/src/thread_id.rs:135:65
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
   2: core::panicking::panic
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:111:5
   3: core::option::Option<T>::unwrap
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/option.rs:778:21
   4: <thread_local::thread_id::ThreadGuard as core::ops::drop::Drop>::drop
             at /.cargo/registry/src/github.com-1ecc6299db9ec823/thread_local-1.1.6/src/thread_id.rs:135:30
   5: core::ptr::drop_in_place<thread_local::thread_id::ThreadGuard>
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ptr/mod.rs:490:1
   6: core::ptr::drop_in_place<core::option::Option<thread_local::thread_id::ThreadGuard>>
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ptr/mod.rs:490:1
   7: core::ptr::drop_in_place<core::cell::UnsafeCell<core::option::Option<thread_local::thread_id::ThreadGuard>>>
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ptr/mod.rs:490:1
   8: core::ptr::drop_in_place<std::thread::local::lazy::LazyKeyInner<thread_local::thread_id::ThreadGuard>>
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ptr/mod.rs:490:1
   9: core::ptr::drop_in_place<std::thread::local::os::Value<thread_local::thread_id::ThreadGuard>>
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ptr/mod.rs:490:1
  10: core::ptr::drop_in_place<alloc::boxed::Box<std::thread::local::os::Value<thread_local::thread_id::ThreadGuard>>>
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ptr/mod.rs:490:1
  11: core::mem::drop
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/mem/mod.rs:979:24
  12: std::thread::local::os::destroy_value
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/thread/local.rs:1144:13
  13: _thread_cleanupspecific
             at /usr/src/lib/libthr/thread/thr_spec.c:155:5
  14: exit_thread
             at /usr/src/lib/libthr/thread/thr_exit.c:290:3
  15: thread_unwind_stop
             at /usr/src/lib/libthr/thread/thr_exit.c:162:3
  16: unwind_phase2_forced
             at /usr/src/contrib/llvm-project/libunwind/src/UnwindLevel1.c:337:3
  17: _Unwind_ForcedUnwind
             at /usr/src/contrib/llvm-project/libunwind/src/UnwindLevel1.c:420:10
  18: _Unwind_ForcedUnwind
             at /usr/src/lib/libthr/thread/thr_exit.c:109:9
  19: thread_unwind
             at /usr/src/lib/libthr/thread/thr_exit.c:175:2
  20: _pthread_exit_mask
             at /usr/src/lib/libthr/thread/thr_exit.c:257:3
  21: _Tthr_exit
             at /usr/src/lib/libthr/thread/thr_exit.c:209:2
  22: thread_start
             at /usr/src/lib/libthr/thread/thr_create.c:292:2
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/tmp/cirrus-ci-build/target/debug/deps/maturin-9ead281c73b2735c` (signal: 6, SIGABRT: process abort signal)

Exit status: 101

See also https://cirrus-ci.com/task/6008761958006784

THREAD_ID_MANAGER.lock().unwrap().free(thread.id);

@messense
Copy link
Author

BTW v1.1.4 works fine on FreeBSD.

@Amanieu
Copy link
Owner

Amanieu commented Feb 11, 2023

This seems to be an issue with the order in which TLS destructors are run. I've yanked 1.1.6 for now.

hawkw added a commit to linkerd/linkerd2 that referenced this issue Feb 11, 2023
Our lockfile currently depends on v1.1.6 of the `thread_local` crate,
which has been [yanked from crates.io][yanked] due to
Amanieu/thread_local-rs#47. Our `cargo deny` CI job is currently
[failing] due to the dependency on a yanked version of a crate.

This branch downgrades the dependency on `thread_local` to the latest
non-yanked version. This should fix the failing CI job.

[yanked]: https://crates.io/crates/thread_local/1.1.6
[failing]: https://github.com/linkerd/linkerd2/actions/runs/4148333422/jobs/7176219624
mateiidavid pushed a commit to linkerd/linkerd2 that referenced this issue Feb 13, 2023
Our lockfile currently depends on v1.1.6 of the `thread_local` crate,
which has been [yanked from crates.io][yanked] due to
Amanieu/thread_local-rs#47. Our `cargo deny` CI job is currently
[failing] due to the dependency on a yanked version of a crate.

This branch downgrades the dependency on `thread_local` to the latest
non-yanked version. This should fix the failing CI job.

[yanked]: https://crates.io/crates/thread_local/1.1.6
[failing]: https://github.com/linkerd/linkerd2/actions/runs/4148333422/jobs/7176219624
terrarier2111 pushed a commit to terrarier2111/thread_local-rs that referenced this issue Jun 13, 2023
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

2 participants