Skip to content

Occasional SIGSEGV (exit code 139) under high concurrency #6221

@sgrebnov

Description

@sgrebnov

We have observed occasional crashes when running Vortex under high concurrency. An example stack trace and related discussion can be found here:

Our conclusion was that the oneshot crate drops stored wakers inside Receiver::drop(). When the waker is an Arc<FuturesUnordered::Task>, this can lead to re-entrant drops, triggering either:

  • a safety panic: "future still here when dropping", or
  • a SIGSEGV due to a use-after-free.

We fixed this by switching from oneshot to tokio::sync::oneshot. This change resolved the crashes for us, and we have not observed the issue for several weeks since making the switch.

Creating this issue to:

  • help others discover this potential problem and its solution, and
  • ask whether you would be open to making the same change—using tokio::sync::oneshot when the tokio feature is enabled.

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