[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
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c1
Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c5
--- Comment #5 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c6
Andreas Schwab
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c7
Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c8
--- Comment #8 from Andreas Schwab
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c9
--- Comment #9 from Michael Matz
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
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c11
--- Comment #11 from haochuan chen
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
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
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c14
--- Comment #14 from haochuan chen
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c
Jeff Mahoney
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c15
--- Comment #15 from haochuan chen
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c16
Mike Galbraith
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
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
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
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
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c
Swamp Workflow Management
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
https://bugzilla.novell.com/show_bug.cgi?id=819383
https://bugzilla.novell.com/show_bug.cgi?id=819383#c23
Andreas Schwab
participants (1)
-
bugzilla_noreply@novell.com