Bug 240961

Summary: Multithreaded process left Stopped (T) on CTRL-C of strace
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: straceAssignee: Roland McGrath <roland>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 4.5.16-1.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-06 17:59:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 222053    
Attachments:
Description Flags
Testcase.
none
Fix.
none
Bugfix (this time incl. the forgotten ChangeLog entry).
none
Bugfix updated according to the Roland's comments.
none
Testcase for the PTRACE_KILL change of the last bugfix.
none
Bugfix update #2 according to the Roland's comments. none

Description Jan Kratochvil 2007-05-23 14:09:16 UTC
Description of problem:
In some cases the multithreaded application gets Stopped (T, by SIGSTOP) and
needs to be sent `kill -CONT'.  Shell prints:
[1]+  Stopped                 appname args

Version-Release number of selected component (if applicable):
strace-4.5.15-1.fc6.x86_64

How reproducible:
Always with the attached testcase, rarely on real apps.

Steps to Reproduce:
1. gcc -o mt3-stop mt3-stop.c -Wall -ggdb2 -pthread
2. ./mt3-stop
3. On other console: strace -f -p `pidof mt3-stop`

Actual results:
[1]+  Stopped                 ./mt3-stop

Expected results:
`mt3-stop' left running without any strace(1) notice.

Additional info:
General package protoize(1)ation may fix more bugs.

Comment 1 Jan Kratochvil 2007-05-23 14:09:16 UTC
Created attachment 155241 [details]
Testcase.

Comment 2 Jan Kratochvil 2007-05-23 14:30:12 UTC
Created attachment 155245 [details]
Fix.

Bugfix.

The testcase requires also fix from the strace Bug 240962 to reliably pass.

(It may statistically improve the success chance a bit.)

Comment 3 Jan Kratochvil 2007-05-23 14:54:32 UTC
Created attachment 155252 [details]
Bugfix (this time incl. the forgotten ChangeLog entry).

Comment 4 Jan Kratochvil 2007-05-24 17:05:25 UTC
Created attachment 155366 [details]
Bugfix updated according to the Roland's comments.

Comment 5 Jan Kratochvil 2007-05-24 17:06:04 UTC
Created attachment 155367 [details]
Testcase for the PTRACE_KILL change of the last bugfix.

Comment 6 Jan Kratochvil 2007-06-10 16:00:23 UTC
Created attachment 156669 [details]
Bugfix update #2 according to the Roland's comments.

Another testcase is also included.

Comment 7 Jan Kratochvil 2007-08-03 12:01:15 UTC
Fixed in Rawhide strace-4.5.16-1.fc8:
* Fri Aug  3 2007 Roland McGrath <roland> - 4.5.16-1
- fix multithread issues ([...], #240961, [...])

and upstream:

2007-07-05  Jan Kratochvil  <jan.kratochvil>

        * strace.c (detach): New prototype.  Extended the function comment.
        [LINUX] (detach): Call droptcb() instead of the wrongly parametrized
        detach() call.
        (handle_group_exit): Call droptcb() instead of the wrongly parametrized
        detach() call.  Always call detach() only once from the group leader.
        Comment the leader killing known bug tested by `test/leaderkill.c'.
        Code advisory: Roland McGrath
        Fixes RH#240961.

        * test/leaderkill.c: New file.
        * test/.cvsignore, test/Makefile: Add it.


Comment 8 Fedora Update System 2007-08-06 17:59:11 UTC
strace-4.5.16-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.