Skip to content

sensor/ptrace fix: don't re-inject kernel-generated SIGSTOPs into tracees - #200

Merged
kcq merged 1 commit into
mintoolkit:masterfrom
iximiuz:fix-ptrace-sigstop-misdelivery
Oct 7, 2026
Merged

kcq merged 1 commit into
mintoolkit:masterfrom
iximiuz:fix-ptrace-sigstop-misdelivery

Conversation

@iximiuz

@iximiuz iximiuz commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

The collect loop re-injected every non-SIGTRAP stop signal on resume, including the SIGSTOP the kernel queues on a freshly auto-attached thread (PTRACE_O_TRACECLONE). Delivering it puts the whole thread group into a group-stop. Traced threads get resumed by the next PTRACE_SYSCALL, but untraced kernel threads in the group (io_uring iou-sqp-/iou-wrk- used by Node.js/libuv) stay stopped forever, so the app never starts listening, and the HTTP probe fails or hangs.

Use PTRACE_GETSIGINFO to tell a real stop signal (sent via kill) from the auto-attach SIGSTOP and group-stop notifications, and only inject the real one. Also resume the stopped tracee after a syscall handler error instead of the previous pid, and finish collection on wait4 ECHILD instead of spinning.

Fixes the hang with ghcr.io/iximiuz/labs/mintoolkit/nuxt-web-app:v1.0.0.

…cees

The collect loop re-injected every non-SIGTRAP stop signal on resume,
including the SIGSTOP the kernel queues on a freshly auto-attached
thread (PTRACE_O_TRACECLONE). Delivering it puts the whole thread group
into a group-stop. Traced threads get resumed by the next PTRACE_SYSCALL,
but untraced kernel threads in the group (io_uring iou-sqp-*/iou-wrk-*
used by Node.js/libuv) stay stopped forever, so the app never starts
listening and the HTTP probe fails or hangs.

Use PTRACE_GETSIGINFO to tell a real stop signal (sent via kill) from
the auto-attach SIGSTOP and group-stop notifications, and only inject
the real one. Also resume the stopped tracee after a syscall handler
error instead of the previous pid, and finish collection on wait4
ECHILD instead of spinning.

Fixes the hang with ghcr.io/iximiuz/labs/mintoolkit/nuxt-web-app:v1.0.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@kilo-code-bot

kilo-code-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • pkg/monitor/ptrace/ptrace.go

Reviewed by free · Input: 66.5K · Output: 23.7K · Cached: 337.3K

@kcq
kcq merged commit 98ca995 into mintoolkit:master Oct 7, 2026
3 of 6 checks passed
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.

2 participants