Skip to content

Native: panic in Yamux::index_mut from single_stream_connection_task (iOS, smoldot-light) #3304

Description

@lrubasze

Seen via Sentry in a native (Rust, smoldot-light) integration on iOS: BREVITY-MORPHEUS-4C - 2 events, 2 users, substatus regressed.

Crash

SIGABRT on thread smoldot-light-2, ~1 minute after app start:

smoldot_light::network_service::tasks::single_stream_connection_task::{{closure}}
smoldot::libp2p::connection::yamux::Yamux<T>::index_mut
core::panicking::panic

Yamux::index_mut (lib/src/libp2p/connection/yamux.rs:1736) panics when the SubstreamId is not in the substream map:

impl<TNow, TSub> ops::IndexMut<SubstreamId> for Yamux<TNow, TSub> {
    fn index_mut(&mut self, substream_id: SubstreamId) -> &mut TSub {
        ...
            .unwrap_or_else(|| panic!())

Analysis

  • The concrete caller is inlined away; candidates are the self.inner.yamux[substream_id] accessors in lib/src/libp2p/connection/established/single_stream.rs (~16 sites).
  • SPECULATED: a coordinator message (request start, notification write, close, ...) is processed for a substream that has already died and been removed from the yamux state - a race between substream death and coordinator messages. Related past fix: Properly process dead substreams #2869.

Environment

  • iOS 26.2, iPhone17,1, app io.parity.brevity@1.0.0+39 (Flutter, native smoldot-light)
  • smoldot version pinned by the app: unknown, needs confirmation from the app team

Next steps

  • Confirm smoldot(-light) version used by the reporting app
  • Identify which accessor fires (debug log or better symbolication)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions