Created attachment 329724 [details] Kernel patch: do not report stops more than once Forking off a kernel bug discovered while working on a strace improvement (bug 478419). Oleg Nesterov's comment from bug 478419: =============== simple test case: int main(void) { int pid, status; pid = fork(); if (!pid) { ptrace(PTRACE_TRACEME, 0, 0, 0); return kill(getpid(), SIGSTOP); } wait(&status); printf("status: %04X\n", status); ptrace(PTRACE_SYSCALL, pid, 0, SIGSTOP); wait(&status); printf("status: %04X\n", status); wait(&status); printf("status: %04X\n", status); return 0; } ouput: status: 137F status: 137F status: 007F Imho bug. Fedora is fine, and I bet upstream too. =============== In fact, in the above example wait() will report SIGSTOPed process infinitely many times (if you put wait() in the loop), but it should block on the second call. Attached patch seems to fix it. Run tested.
Created a testcase for it, waitpid-double-report: http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/tests/ptrace-tests/tests/waitpid-double-report.c?cvsroot=systemtap
Updating PM score.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
in kernel-2.6.18-141.el5 You can download this test kernel from http://people.redhat.com/dzickus/el5 Please do NOT transition this bugzilla state to VERIFIED until our QE team has sent specific instructions indicating when to do so. However feel free to provide a comment indicating that this fix has been verified.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2009-1243.html
*** Bug 456342 has been marked as a duplicate of this bug. ***