Skip to content

tokio current-thread runtime deadlock on arm 2025.09.18 #39

@frostyplanet

Description

@frostyplanet

A continue issue after #35
tokio is patched with frostyplanet/tokio@6eb7cfa

https://github.com/frostyplanet/crossfire-rs/actions/runs/17809618502
commit 633b950
tokio current_thread
test_pressure_bounded_mixed_async_blocking_conversion::case_1

[2025-09-17 21:26:12.205654][DEBUG][ThreadId(6)] rx: recv
[2025-09-17 21:26:12.205655][DEBUG][ThreadId(2)] drop tx 1
[2025-09-17 21:26:12.205658][DEBUG][ThreadId(5)] tx: send Some(waker(8198 state=5))
[2025-09-17 21:26:12.205661][DEBUG][ThreadId(5)] tx: reg waker(8228 state=0)
[2025-09-17 21:26:12.205662][DEBUG][ThreadId(5)] tx: sender_reg_and_try Some(waker(8228 state=1)) 1
[2025-09-17 21:26:12.205672][DEBUG][ThreadId(5)] tx: send Some(waker(8228 state=3))
[2025-09-17 21:26:12.205675][DEBUG][ThreadId(2)] wake tx waker(8228 state=3) Waked
[2025-09-17 21:26:12.205676][DEBUG][ThreadId(2)] rx: recv Some(waker(7874 state=3))
[2025-09-17 21:26:12.205677][DEBUG][ThreadId(2)] rx: recv
[2025-09-17 21:26:12.205677][DEBUG][ThreadId(2)] rx: reg waker(7875 state=0)
[2025-09-17 21:26:12.205678][DEBUG][ThreadId(2)] rx: commit_waiting Some(waker(7875 state=1)) 1
[2025-09-17 21:26:12.205697][DEBUG][ThreadId(6)] rx: reg waker(7876 state=0)
[2025-09-17 21:26:12.205698][DEBUG][ThreadId(6)] rx: waker(7876 state=1) commit_waiting 1
[2025-09-17 21:26:12.205701][DEBUG][ThreadId(5)] wake rx waker(7875 state=3) Waked
[2025-09-17 21:26:12.205704][DEBUG][ThreadId(5)] tx: reg waker(8229 state=0)
[2025-09-17 21:26:12.205706][DEBUG][ThreadId(5)] tx: sender_reg_and_try Some(waker(8229 state=1)) 1

It's not obvious to tell async from threaded context, should change the log format add file and line
information extract from the current log format:

rx1 (async): ThreadId(2) is tokio runtime,

trace_log!("rx: commit_waiting {:?} {}", o_waker, state);

[2025-09-17 21:26:12.205677][DEBUG][ThreadId(2)] rx: recv
[2025-09-17 21:26:12.205677][DEBUG][ThreadId(2)] rx: reg waker(7875 state=0)
[2025-09-17 21:26:12.205678][DEBUG][ThreadId(2)] rx: commit_waiting Some(waker(7875 state=1)) 1

rx2 (thread): ThreadId(6)

trace_log!("rx: {:?} commit_waiting {}", waker, state);
[2025-09-17 21:26:12.205697][DEBUG][ThreadId(6)] rx: reg waker(7876 state=0)
[2025-09-17 21:26:12.205698][DEBUG][ThreadId(6)] rx: waker(7876 state=1) commit_waiting 1

only 1 tx left
tx: blocking context, ThreadId(5)

trace_log!("tx: sender_reg_and_try {:?} {}", o_waker, state);

[2025-09-17 21:26:12.205704][DEBUG][ThreadId(5)] tx: reg waker(8229 state=0)
[2025-09-17 21:26:12.205706][DEBUG][ThreadId(5)] tx: sender_reg_and_try Some(waker(8229 state=1)) 1
[2025-09-17 21:26:12.205701][DEBUG][ThreadId(5)] wake rx waker(7875 state=3) Waked

rx async waker(7875) is dead

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions