[Bug 819383] New: pldd a process multiple times can freeze the process
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c0 Summary: pldd a process multiple times can freeze the process Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: x86-64 OS/Version: openSUSE 12.3 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: yjcoshc@gmail.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.32 (KHTML, like Gecko) Chrome/27.0.1425.0 Safari/537.32 SUSE/27.0.1425.0 When I used pldd to show loading shared objects of a running process for multiple times, the process stopped (or freezed), and sent SIGCONT can make it continue to run. Reproducible: Sometimes Steps to Reproduce: 1.Open a terminal emulator, for example konsole. 2.ps aux|grep konsole, and remember the pid of it. 3.pldd <pid> |grep lib. 4.repeat step 3 multiple times(maybe more than twenty). Actual Results: The konsole window is freezed. You can send SIGCONT to make it continue to run. Expected Results: No matter how many times we execute pldd, the process shouldn't be freezed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c Andreas Jaeger <aj@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aj@suse.com AssignedTo|bnc-team-screening@forge.pr |schwab@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c1 Bernhard Wiedemann <bwiedemann@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bwiedemann@suse.com --- Comment #1 from Bernhard Wiedemann <bwiedemann@suse.com> 2013-05-12 20:58:23 CEST --- I could reproduce it with sleep 10 & for i in $(seq 1 100) ; do pldd `pidof sleep` > /dev/null; done -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c5 --- Comment #5 from Michael Matz <matz@suse.com> 2013-05-13 11:07:32 UTC --- Aha! glibc-utils, which I hadn't installed. Can't reproduce on a 12.3, either with the sleep example or with the konsole one. Which kernel are you using? I'm at kernel-desktop-3.7.10-1.1.1.x86_64 . -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c6 Andreas Schwab <schwab@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Basesystem |Kernel AssignedTo|schwab@suse.com |kernel-maintainers@forge.pr | |ovo.novell.com --- Comment #6 from Andreas Schwab <schwab@suse.com> 2013-05-13 13:44:23 CEST --- This happens when PTRACE_DETACH returns ESRCH, which does not make sense, since PTRACE_ATTACH was successful. This is likely a kernel bug. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c7 Michael Matz <matz@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schwab@suse.com --- Comment #7 from Michael Matz <matz@suse.com> 2013-05-13 12:04:31 UTC --- In this very situation it really sounds like a kernel bug, but that ESRCH isn't handled also indicates a problem in pldd itself. From the ptrace manpage: The tracer cannot assume that the ptrace-stopped tracee exists. There are many scenarios when the tracee may die while stopped (such as SIGKILL). Therefore, the tracer must be prepared to handle an ESRCH error on any ptrace operation. Unfortunately, the same error is returned if the tracee exists but is not ptrace-stopped (for commands which require a stopped tracee), or if it is not traced by the process which issued the ptrace call. The tracer needs to keep track of the stopped/running state of the tracee, and interpret ESRCH as "tracee died unexpectedly" only if it knows that the tracee has been observed to enter ptrace-stop. Note the "on any ptrace operation", which in my book includes PTRACE_DETACH. So, while strange from the kernel in this situation (and that needs investigation), it is explicitely allowed to return ESRCH. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c8 --- Comment #8 from Andreas Schwab <schwab@suse.com> 2013-05-13 14:10:31 CEST --- This is irrelevant, because if the tracee dies nothing needs to be done. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c9 --- Comment #9 from Michael Matz <matz@suse.com> 2013-05-13 12:26:21 UTC --- (In reply to comment #8)
This is irrelevant, because if the tracee dies nothing needs to be done.
Yes, I was just mentioning it because pldd might then also not be prepared to handle ESRCH from other ptrace operations. That after PTRACE_DETACH the process is left in traced state by the kernel is quite clearly a kernel bug. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c10 --- Comment #10 from Andreas Schwab <schwab@suse.com> 2013-05-13 14:33:27 CEST --- There are no other ptrace operations. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c11 --- Comment #11 from haochuan chen <yjcoshc@gmail.com> 2013-05-13 13:16:18 UTC --- (In reply to comment #5)
Aha! glibc-utils, which I hadn't installed. Can't reproduce on a 12.3, either with the sleep example or with the konsole one. Which kernel are you using? I'm at kernel-desktop-3.7.10-1.1.1.x86_64 .
My kernel version is kernel-desktop-3.7.10-1.4.1. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c12 --- Comment #12 from haochuan chen <yjcoshc@gmail.com> 2013-05-14 06:34:17 UTC --- (In reply to comment #5)
Aha! glibc-utils, which I hadn't installed. Can't reproduce on a 12.3, either with the sleep example or with the konsole one. Which kernel are you using? I'm at kernel-desktop-3.7.10-1.1.1.x86_64 .
I could reproduce it at 3.9.1-1.gb6484b6-desktop from kernel:stable. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c13 --- Comment #13 from haochuan chen <yjcoshc@gmail.com> 2013-06-21 06:36:34 UTC --- This bug is still reproducible with kernel 3.9.6-1.g8ead728-desktop. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c14 --- Comment #14 from haochuan chen <yjcoshc@gmail.com> 2013-07-09 14:48:00 UTC --- Still reproducible with kernel 3.9.8-1.gf3348a8-desktop. Any progress? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c Jeff Mahoney <jeffm@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mhocko@suse.com AssignedTo|kernel-maintainers@forge.pr |mgalbraith@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c15 --- Comment #15 from haochuan chen <yjcoshc@gmail.com> 2013-07-16 04:57:39 UTC --- Still reproducibel with kernel 3.10.1(vanilla, compiled myself). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c16 Mike Galbraith <mgalbraith@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #16 from Mike Galbraith <mgalbraith@suse.com> 2013-07-18 14:03:57 UTC --- (In reply to comment #15)
Still reproducibel with kernel 3.10.1(vanilla, compiled myself).
I have a pldd thingy now (12.1, had to go build glibc) and can reproduce it in upstream master. That's a start of what will no doubt (ptrace) be an interesting adventure. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c17 --- Comment #17 from Mike Galbraith <mgalbraith@suse.com> 2013-07-23 12:55:21 UTC --- (In reply to comment #6)
This happens when PTRACE_DETACH returns ESRCH, which does not make sense, since PTRACE_ATTACH was successful. This is likely a kernel bug.
The reason for that ESRCH return is that while the PTRACE_ATTACH was successful, the tracee is not yet stopped when pldd tries PTRACE_DETACH, and that because pldd does not wait() after the PTRACE_ATTACH. PTRACE_DETACH is expecting tracee->state to be TASK_TRACED, which tracee sets when it executes ptrace_stop(). Adding the wait() after PTRACE_DETACH fixes the problem. The manpage is pretty clear about wait() being required, so I don't think this is a bug, rather a case of proggy shooting self in foot. I sent a query to LKML, let's see what Oleg says. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c18 Michael Matz <matz@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|mgalbraith@suse.com |schwab@suse.com --- Comment #18 from Michael Matz <matz@suse.com> 2013-07-23 13:04:29 UTC --- (In reply to comment #17)
The manpage is pretty clear about wait() being required, so I don't think this is a bug, rather a case of proggy shooting self in foot.
Indeed. pldd bug then. Back to Andreas. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c20 --- Comment #20 from Mike Galbraith <mgalbraith@suse.com> 2013-07-24 02:57:44 UTC --- (In reply to comment #17)
The manpage is pretty clear about wait() being required, so I don't think this is a bug, rather a case of proggy shooting self in foot. I sent a query to LKML, let's see what Oleg says.
Oleg confirmed, consequences of missing wait() are the expected behavior. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c21 --- Comment #21 from Bernhard Wiedemann <bwiedemann@suse.com> 2013-08-01 12:00:09 CEST --- This is an autogenerated message for OBS integration: This bug (819383) was mentioned in https://build.opensuse.org/request/show/185400 Factory / glibc -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard| |obs:running:2020:moderate -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status Whiteboard|obs:running:2020:moderate | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c22 --- Comment #22 from Swamp Workflow Management <swamp@suse.de> 2013-09-30 16:05:35 UTC --- openSUSE-SU-2013:1510-1: An update that solves 6 vulnerabilities and has 5 fixes is now available. Category: security (moderate) Bug References: 779320,801246,805054,813121,813306,819383,819524,824046,830257,834594,839870 CVE References: CVE-2012-4412,CVE-2013-0242,CVE-2013-1914,CVE-2013-2207,CVE-2013-4237,CVE-2013-4332 Sources used: openSUSE 12.3 (src): glibc-2.17-4.7.1, glibc-testsuite-2.17-4.7.2, glibc-testsuite-2.17-4.7.3, glibc-utils-2.17-4.7.1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=819383 https://bugzilla.novell.com/show_bug.cgi?id=819383#c23 Andreas Schwab <schwab@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Component|Kernel |Basesystem Resolution| |FIXED --- Comment #23 from Andreas Schwab <schwab@suse.com> 2013-10-01 08:47:59 CEST --- Fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com