Bug 498595

Summary: gcore unstopping SIGSTOPped processes
Product: Red Hat Enterprise Linux 5 Reporter: Jan Kratochvil <jan.kratochvil>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: cagney, cward, ebachalo, pmuller, syeghiay, tao
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-6.8-34.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 11:27:22 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: 456333, 496732    
Bug Blocks:    
Attachments:
Description Flags
Workaround for `gdb-6.8-attach-signalled-detach-stopped.patch'. none

Description Jan Kratochvil 2009-05-01 12:15:17 UTC
Created attachment 342079 [details]
Workaround for `gdb-6.8-attach-signalled-detach-stopped.patch'.

Description of problem:
In RHEL-4 if you did kill -STOP $multithreaded_process and then gcore $multithreaded_process then it would stay stopped.  It is no longer so in RHEL-5 due to a kernel Bug 496732 = kernel Bug 456333.

As RHEL-5 kernel should stay compatible in its behavior and the workaround is simple for GDB proposing this patch.  This problem exists in all the RHEL-5 kernels.

Version-Release number of selected component (if applicable):
gdb-6.8-27.el5.x86_64
kernel-xen-2.6.18-128.1.6.el5.x86_64

How reproducible:
Always.

Steps to Reproduce:

echo -e '#include<pthread.h>\n#include<unistd.h>\nmain(){pthread_t t;pthread_create(&t,NULL,pause,NULL);pause();}'|gcc -o t -x c - -pthread

./t&p=$!;sleep 1;kill -STOP $p

gcore $p;sleep 1;grep State /proc/$p/task/*/status
  
Actual results:
[...]
Saved corefile core.27470
[...]
/proc/27470/task/27470/status:State:	S (sleeping)
/proc/27470/task/27472/status:State:	T (stopped)

Expected results:
Saved corefile core.27545
[...]
/proc/27545/task/27545/status:State:	T (stopped)
/proc/27545/task/27547/status:State:	T (stopped)

Additional info:
For singlethreaded processes this problem does not exist.

Comment 8 Chris Ward 2009-07-03 18:43:18 UTC
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.

Comment 11 errata-xmlrpc 2009-09-02 11:27:22 UTC
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/RHBA-2009-1361.html