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

Node don't stop on Ctrl-C #4242

Closed
ailisp opened this issue Apr 19, 2021 · 5 comments
Closed

Node don't stop on Ctrl-C #4242

ailisp opened this issue Apr 19, 2021 · 5 comments

Comments

@ailisp
Copy link
Member

ailisp commented Apr 19, 2021

On first Ctrl-C it has no effect, node continues to run. On second Ctrl-C, it says:

Got another SIGINT before trap is triggered on WebAssembly side, aborting
Aborted (core dumped)

Full log:

^C
Apr 19 15:33:41.793  INFO stats: #     501 GbaoFuRGnEexgT9EmE7RA5xHabBg5s98ZQsxZDFTNGv7 V/1  0/0/40 peers ⬇ 0 B/s ⬆ 0 B/s 1.70 bps 0 gas/s CPU: 11%, Mem: 223.3 MiB    
Apr 19 15:33:51.806  INFO stats: #     517 7xwHbnTwk7Yd13jVmHTM5Ghi6HbFCKTNZetTfwjHneRB V/1  0/0/40 peers ⬇ 0 B/s ⬆ 0 B/s 1.60 bps 0 gas/s CPU: 10%, Mem: 223.6 MiB    
Apr 19 15:34:01.823  INFO stats: #     534 5VyP9BYb6dv7xZzmokMUpJ7YBb2pMPdsQMG4ECRdSTRb V/1  0/0/40 peers ⬇ 0 B/s ⬆ 0 B/s 1.70 bps 0 gas/s CPU: 10%, Mem: 223.6 MiB    
Apr 19 15:34:11.829  INFO stats: #     550 CBMXUV1bMKShvwworr5xSk4ELibsjVRravuRUSRko359 V/1  0/0/40 peers ⬇ 0 B/s ⬆ 0 B/s 1.60 bps 0 gas/s CPU: 8%, Mem: 223.8 MiB    
Apr 19 15:34:21.834  INFO stats: #     566 8EndFfRedq2EKqSfHBaykyNAgCFufogkqhgAtgKBSZG2 V/1  0/0/40 peers ⬇ 0 B/s ⬆ 0 B/s 1.60 bps 0 gas/s CPU: 10%, Mem: 223.8 MiB    
Apr 19 15:34:31.845  INFO stats: #     583 3ZgbkV6ZJt1L5PYDBb6g8cW1bdBWEBmJSQC6DdZMf1n8 V/1  0/0/40 peers ⬇ 0 B/s ⬆ 0 B/s 1.70 bps 0 gas/s CPU: 11%, Mem: 223.8 MiB    
Apr 19 15:34:41.859  INFO stats: #     599 9yKcTawWDsy435YqHSktJhxqx8fxcT7EyJM9CTPtoCg4 V/1  0/0/40 peers ⬇ 0 B/s ⬆ 0 B/s 1.60 bps 0 gas/s CPU: 11%, Mem: 224.1 MiB    
^CGot another SIGINT before trap is triggered on WebAssembly side, aborting
Aborted (core dumped)
@ailisp
Copy link
Member Author

ailisp commented Apr 19, 2021

Note, although the error indicate "trap is triggered on WebAssembly side" but I haven't figured out why this error message comes from. And, there's no transaction so no wasm runtime execution for a while before press "C-c". But this does related to wasm runtime: if this node has ever execute anything in wasm runtime since node restart and C-c, it stuck, otherwise it does not. I also got below core dump backtrace, also doesn't look very useful:

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f5022f1d535 in __GI_abort () at abort.c:79
#2  0x00005633faa49477 in std::sys::unix::abort_internal ()
    at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/std/src/sys/unix/mod.rs:237
#3  0x00005633faa40046 in std::process::abort ()
    at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0//library/std/src/process.rs:1784
#4  0x00005633f83e50c1 in wasmer_runtime_core_near::fault::sigint_handler (_signum=2, 
    _siginfo=0x7f502348daf0, _ucontext=0x7f502348d9c0)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/wasmer-runtime-core-near-0.17.1/src/fault.rs:449
#5  <signal handler called>
#6  0x00007f5023015e3f in epoll_wait (epfd=3, events=0x5633fcf7ce70, maxevents=1024, timeout=61)
    at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
#7  0x00005633fa2461bd in mio::sys::unix::selector::epoll::Selector::select (self=0x7ffd996dd760, 
    events=0x7ffd996dc1a0, timeout=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/mio-0.7.9/src/sys/unix/selector/epoll.rs:68
#8  0x00005633fa24404f in mio::poll::Poll::poll (self=0x7ffd996dd760, events=0x7ffd996dc1a0, timeout=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/mio-0.7.9/src/poll.rs:314
#9  0x00005633fa1ac156 in tokio::io::driver::Driver::turn (self=0x7ffd996dd580, max_wait=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/io/driver/mod.rs:162
#10 0x00005633fa1acc9a in <tokio::io::driver::Driver as tokio::park::Park>::park_timeout (
    self=0x7ffd996dd580, duration=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/io/driver/mod.rs:238
#11 0x00005633fa1cb169 in <tokio::signal::unix::driver::Driver as tokio::park::Park>::park_timeout (
    self=0x7ffd996dd580, duration=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/signal/unix/driver.rs:156
#12 0x00005633fa200329 in <tokio::process::imp::driver::Driver as tokio::park::Park>::park_timeout (
--Type <RET> for more, q to quit, c to continue without paging--
    self=0x7ffd996dd580, duration=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/process/unix/driver.rs:86
#13 0x00005633fa184e8d in <tokio::park::either::Either<A,B> as tokio::park::Park>::park_timeout (
    self=0x7ffd996dd578, duration=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/park/either.rs:37
#14 0x00005633fa1b25d0 in tokio::time::driver::Driver<P>::park_internal (self=0x7ffd996dd550, limit=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/time/driver/mod.rs:219
#15 0x00005633fa1b3370 in <tokio::time::driver::Driver<P> as tokio::park::Park>::park (self=0x7ffd996dd550)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/time/driver/mod.rs:391
#16 0x00005633fa184bab in <tokio::park::either::Either<A,B> as tokio::park::Park>::park (self=0x7ffd996dd548)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/park/either.rs:30
#17 0x00005633fa1ae697 in <tokio::runtime::driver::Driver as tokio::park::Park>::park (self=0x7ffd996dd548)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/driver.rs:198
#18 0x00005633fa1245b7 in tokio::runtime::basic_scheduler::Inner<P>::block_on::{{closure}} (
    scheduler=0x7ffd996dd510, context=0x7ffd996dd260)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/basic_scheduler.rs:211
#19 0x00005633fa125fd5 in tokio::runtime::basic_scheduler::enter::{{closure}} ()
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/basic_scheduler.rs:266
#20 0x00005633fa12b1d2 in tokio::macros::scoped_tls::ScopedKey<T>::set (
    self=0x5633fbadad80 <tokio::runtime::basic_scheduler::CURRENT>, t=0x7ffd996dd260, f=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/macros/scoped_tls.rs:61
#21 0x00005633fa125e78 in tokio::runtime::basic_scheduler::enter (scheduler=0x7ffd996dd510, f=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/basic_scheduler.rs:266
#22 0x00005633fa12378e in tokio::runtime::basic_scheduler::Inner<P>::block_on (self=0x7ffd996dd510, 
    future=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/basic_scheduler.rs:176
#23 0x00005633fa124b91 in tokio::runtime::basic_scheduler::InnerGuard<P>::block_on (self=0x7ffd996dd510, 
--Type <RET> for more, q to quit, c to continue without paging--
    future=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/basic_scheduler.rs:405
#24 0x00005633fa124f84 in tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on (self=0x7ffd996ddb20, 
    future=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/basic_scheduler.rs:136
#25 0x00005633fa147163 in tokio::runtime::Runtime::block_on (self=0x7ffd996ddb18, future=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/runtime/mod.rs:450
#26 0x00005633fa150753 in tokio::task::local::LocalSet::block_on (self=0x7ffd996ddad0, rt=0x7ffd996ddb18, 
    future=...) at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.2.0/src/task/local.rs:459
#27 0x00005633fa13a6f8 in actix_rt::runtime::Runtime::block_on (self=0x7ffd996ddad0, f=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/actix-rt-2.1.0/src/runtime.rs:85
#28 0x00005633fa1543a0 in actix_rt::system::SystemRunner::run (self=...)
    at /home/bo/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/actix-rt-2.1.0/src/system.rs:167
#29 0x00005633f6cb9178 in neard::main () at /home/bo/workspace/nearcore/neard/src/main.rs:249
(gdb) 

@bowenwang1996
Copy link
Collaborator

related #3266

@matklad
Copy link
Contributor

matklad commented Apr 29, 2021

Huh, apparently wasmer 0.17 used to catch sigint for no good reason? wasmerio/wasmer#1552

This probably will be fixed with the transition to wasmer 1.0

@OnlyOneJMJQ
Copy link

Adding that on my machine there's a similar, but slightly different behavior: the first Ctrl+C does say it's gracefully exiting with stopping NEARCore, however the process continues to run, even outputting to the console. Manually killing the process stopped it.

Machine:

  • WSL2 (Ubuntu 20.04 LTS) on Windows Home 10 20H2
  • Started a localnet with scripts/start_localnet.py --nodocker --debug

@bowenwang1996
Copy link
Collaborator

Duplicate of #3266

@bowenwang1996 bowenwang1996 marked this as a duplicate of #3266 Jun 28, 2021
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

4 participants