Skip to content

dump: skip POSIX timers targeting dead threads#2996

Open
pojntfx wants to merge 4 commits intocheckpoint-restore:criu-devfrom
loopholelabs:pojntfx/arch-951-upstream-criu-changes
Open

dump: skip POSIX timers targeting dead threads#2996
pojntfx wants to merge 4 commits intocheckpoint-restore:criu-devfrom
loopholelabs:pojntfx/arch-951-upstream-criu-changes

Conversation

@pojntfx
Copy link
Copy Markdown

@pojntfx pojntfx commented Apr 6, 2026

What:

When a POSIX timer uses SIGEV_THREAD_ID and the target thread has exited, dump fails in PID namespaces (Unable to convert the notify thread id) and restore fails without PID namespaces (EINVAL from timer_create()). We noticed this when an application switched from Java 8 to Java 21.

How:

To fix this, this PR detects dead notify threads during dump and skips the timer instead of failing. The kernel already silently drops signals from these timers, so skipping them during dump is safe.

Tests:

  • zdtm/static/dead_thread_posix_timer
  • zdtm/static/dead_thread_posix_timer_h

I added dead_thread_posix_timer_h since I wanted to specifically trigger the restore failure case, which needs host mode. I followed the convention that pthread_timers.c and pthread_timers_h.c uses.

pojntfx added 4 commits April 6, 2026 00:29
…eting a dead thread

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
… timer

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
pojntfx referenced this pull request in loopholelabs/criu Apr 7, 2026
…t/dead threads from checkpoint

Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
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

Successfully merging this pull request may close these issues.

1 participant