Re: Debugging lost task in wait_task_inactive() when delivering signal (6.12)

From: Oleg Nesterov

Date: Fri Sep 19 2025 - 12:15:27 EST


Let me repeat that currently I have no idea, so let me ask another stupid
question...

On 09/19, Matt Fleming wrote:
>
> I do have some info. The callstack for the lost thread is:
>
> Call Trace:
> <TASK>
> __schedule+0x4fb/0xbf0
> ? srso_return_thunk+0x5/0x5f
> schedule+0x27/0xf0
> do_exit+0xdd/0xaa0
> ? __pfx_futex_wake_mark+0x10/0x10
> do_group_exit+0x30/0x80
> get_signal+0x81e/0x860
> ? srso_return_thunk+0x5/0x5f
> ? futex_wake+0x177/0x1a0
> arch_do_signal_or_restart+0x2e/0x1f0
> ? srso_return_thunk+0x5/0x5f
> ? srso_return_thunk+0x5/0x5f
> ? __x64_sys_futex+0x10c/0x1d0
> syscall_exit_to_user_mode+0xa5/0x130
> do_syscall_64+0x57/0x110
> entry_SYSCALL_64_after_hwframe+0x76/0x7e

OK, thanks. Nothing "interesting" at first glance.

> do_exit+0xdd is here in coredump_task_wait():
>
> for (;;) {
> set_current_state(TASK_IDLE|TASK_FREEZABLE);
> if (!self.task) /* see coredump_finish() */
> break;
> schedule();
> }
>
> i.e. the task calls schedule() and never comes back.

Are you sure it never comes back and doesn't loop?

> The waiting task
> sees p->on_rq=1 for this lost thread

Strange...

Oleg.