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

unreachable panic libp2p-swarm-0.44.2/src/handler/either.rs:106 #5412

Open
joshuef opened this issue May 22, 2024 · 2 comments
Open

unreachable panic libp2p-swarm-0.44.2/src/handler/either.rs:106 #5412

joshuef opened this issue May 22, 2024 · 2 comments

Comments

@joshuef
Copy link
Contributor

joshuef commented May 22, 2024

Summary

Seemingly the unreachable code on a match in the swarm handler is panicking?!

This does not actually crash our app (I assume it's a spawned thread).

But it's not clear to me how this is even possible :|

Expected behavior

no panic

Actual behavior

panic

Relevant log output

May 20 07:07:36 node-1 safenode[23138]: The application panicked (crashed).
May 20 07:07:36 node-1 safenode[23138]: Message:  internal error: entered unreachable code
May 20 07:07:36 node-1 safenode[23138]: Location: /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libp2p-swarm-0.44.2/src/handler/either.rs:106
May 20 07:07:36 node-1 safenode[23138]: Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
May 20 07:07:36 node-1 safenode[23138]: Run with RUST_BACKTRACE=full to include source snippets.

root@node-1:/# journalctl -u safenode7.service 
May 21 16:13:20 node-1 safenode[23146]: The application panicked (crashed).
May 21 16:13:20 node-1 safenode[23146]: Message:  internal error: entered unreachable code
May 21 16:13:20 node-1 safenode[23146]: Location: /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libp2p-swarm-0.44.2/src/handler/either.rs:106

Possible Solution

No response

Version

No response

Would you like to work on fixing this bug ?

Maybe

@dariusc93
Copy link
Contributor

Thank you for the report. It looks like it happens when receiving an event from the behaviour.

fn on_behaviour_event(&mut self, event: Self::FromBehaviour) {
match (self, event) {
(Either::Left(handler), Either::Left(event)) => handler.on_behaviour_event(event),
(Either::Right(handler), Either::Right(event)) => handler.on_behaviour_event(event),
_ => unreachable!(),
}
}

Could you provide any code to reproduce it and any possible logs?

@joshuef
Copy link
Contributor Author

joshuef commented May 22, 2024

it seems we had two relay events around the panic time:

[2024-05-20T07:07:36.488761Z INFO sn_networking::event::swarm] relay client event event=OutboundCircuitEstablished { relay_peer_id: PeerId("12D3KooWPQYu4GjLEEwxp1BmgneDDwajawjUhT9ZupTbp6LRT4Ra"), limit: None }```


```May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]: Location: /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libp2p-swarm-0.44.2/src/handler/either.rs:106
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:                                 ⋮ 7 frames hidden ⋮                               
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:    8: core::panicking::panic::h584a128616e7fa9b
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:       at <unknown source file>:<unknown line>
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:    9: <libp2p_swarm::handler::select::ConnectionHandlerSelect<TProto1,TProto2> as libp2p_swarm::handler::ConnectionHandler>::on_behaviour_event::h75b996a885f09be9
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:       at <unknown source file>:<unknown line>
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:   10: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll::h0adc49c52e11e997
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:       at <unknown source file>:<unknown line>
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:   11: tokio::runtime::task::core::Core<T,S>::poll::h96755579c44ce1d6
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:       at <unknown source file>:<unknown line>
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:   12: tokio::runtime::task::raw::poll::h5bedef3875a2cdb8
May 22 20:41:19 ShuNetV3-node-4 safenode[3790806]:       at <unknown source file>:<unknown line>

trying to gather more logs (it's not super frequent, but we are seeing it often ish, we've restarted nodes with debugger attached just now)

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