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

SIGABRT due to race during node shutdown #1061

Open
akumansley opened this issue Aug 20, 2024 · 0 comments
Open

SIGABRT due to race during node shutdown #1061

akumansley opened this issue Aug 20, 2024 · 0 comments

Comments

@akumansley
Copy link

There's a fairly rare race where an async rust function is running on a worker thread, and the main thread invokes process.exit(0).

Minimal repro is here: https:/AndrewKumansley-at/neon-repro

Build, install and ./run_until_sigabrt.sh. It takes a few minutes to hit the sigabrt on my machine. You might need to fiddle with the timeouts to make it more reliable since it depends on how fast the machine starts a worker thread etc.

Example backtrace

thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `PendingException`,
 right: `Ok`', /Users/andrew.wansley/.cargo/registry/src/index.crates.io-6f17d22bba15001f/neon-1.0.0/src/sys/promise.rs:18:5
stack backtrace:
   0:        0x105870e30 - std::backtrace_rs::backtrace::libunwind::trace::h65bc41667b946a9b
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x105870e30 - std::backtrace_rs::backtrace::trace_unsynchronized::h11e85e00c64d2951
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x105870e30 - std::sys_common::backtrace::_print_fmt::hd30f3b7be3b8d9bb
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:65:5
   3:        0x105870e30 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h56d7672c82815b65
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x1058861d4 - core::fmt::rt::Argument::fmt::h6ead82aa10d38e42
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/rt.rs:138:9
   5:        0x1058861d4 - core::fmt::write::h632b3cc8e66b4f04
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/mod.rs:1094:21
   6:        0x10586f0f8 - std::io::Write::write_fmt::hc28441b249a4971d
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/io/mod.rs:1714:15
   7:        0x105870c88 - std::sys_common::backtrace::_print::h0d2f8b8a08c5cc48
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x105870c88 - std::sys_common::backtrace::print::h8057ced4b0f9fdc1
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x105871db0 - std::panicking::default_hook::{{closure}}::h8157fa8f0f7934b5
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:269:22
  10:        0x105871b40 - std::panicking::default_hook::hdaefe3bfb5fe212c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:288:9
  11:        0x1058722e0 - std::panicking::rust_panic_with_hook::h21091a3c79c5da9c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:705:13
  12:        0x1058721ec - std::panicking::begin_panic_handler::{{closure}}::hd2f65b958d3068b8
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:597:13
  13:        0x105871210 - std::sys_common::backtrace::__rust_end_short_backtrace::h53ec33e49ec66621
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:151:18
  14:        0x105871f58 - rust_begin_unwind
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
  15:        0x10588d3f0 - core::panicking::panic_fmt::h3bbf9265d206434c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
  16:        0x10588d638 - core::panicking::assert_failed_inner::h3df7a2ccc8a09efc
  17:        0x10588a94c - core::panicking::assert_failed::hf53a35f9946e6f30
  18:        0x105855200 - neon::sys::promise::create::heca1f7edeba2e79a
  19:        0x1058492c0 - neon::event::task::TaskBuilder<C,E>::promise::h07cc969c2f5688d5
  20:        0x10584bb40 - std::panicking::try::h02a35cba3d218e8b
  21:        0x10584a820 - neon::types_impl::error::convert_panics::heefedd224335d8ca
  22:        0x1058491bc - neon::sys::fun::call_boxed::hf0c6fc0839859c50
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `PendingException`,
 right: `Ok`', /Users/andrew.wansley/.cargo/registry/src/index.crates.io-6f17d22bba15001f/neon-1.0.0/src/sys/error.rs:49:5
stack backtrace:
   0:        0x105870e30 - std::backtrace_rs::backtrace::libunwind::trace::h65bc41667b946a9b
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x105870e30 - std::backtrace_rs::backtrace::trace_unsynchronized::h11e85e00c64d2951
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x105870e30 - std::sys_common::backtrace::_print_fmt::hd30f3b7be3b8d9bb
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:65:5
   3:        0x105870e30 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h56d7672c82815b65
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:
npm install / npm run build / ./run_until_sigabrt.sh
44:22
   4:        0x1058861d4 - core::fmt::rt::Argument::fmt::h6ead82aa10d38e42
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/rt.rs:138:9
   5:        0x1058861d4 - core::fmt::write::h632b3cc8e66b4f04
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/mod.rs:1094:21
   6:        0x10586f0f8 - std::io::Write::write_fmt::hc28441b249a4971d
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/io/mod.rs:1714:15
   7:        0x105870c88 - std::sys_common::backtrace::_print::h0d2f8b8a08c5cc48
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x105870c88 - std::sys_common::backtrace::print::h8057ced4b0f9fdc1
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x105871db0 - std::panicking::default_hook::{{closure}}::h8157fa8f0f7934b5
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:269:22
  10:        0x105871b40 - std::panicking::default_hook::hdaefe3bfb5fe212c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:288:9
  11:        0x1058722e0 - std::panicking::rust_panic_with_hook::h21091a3c79c5da9c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:705:13
  12:        0x1058721ec - std::panicking::begin_panic_handler::{{closure}}::hd2f65b958d3068b8
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:597:13
  13:        0x105871210 - std::sys_common::backtrace::__rust_end_short_backtrace::h53ec33e49ec66621
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:151:18
  14:        0x105871f58 - rust_begin_unwind
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
  15:        0x10588d3f0 - core::panicking::panic_fmt::h3bbf9265d206434c
                               at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
  16:        0x10588d638 - core::panicking::assert_failed_inner::h3df7a2ccc8a09efc
  17:        0x10588a94c - core::panicking::assert_failed::hf53a35f9946e6f30
  18:        0x10584f708 - neon::sys::error::throw_error_from_utf8::hb90b765ce030b796
  19:        0x10584a9c4 - neon::types_impl::error::convert_panics::heefedd224335d8ca
  20:        0x1058491bc - neon::sys::fun::call_boxed::hf0c6fc0839859c50

Node version v18.20.1
rustc 1.72.1
Macbook M2

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