Bug 716390

Summary: gcov crash if two(or more) forks happen at the same time
Product: Red Hat Enterprise Linux 5 Reporter: cobexer
Component: gcc44Assignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.5CC: law, mpolacek
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-13 14:05:02 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:
Attachments:
Description Flags
test application to reproduce the problem none

Description cobexer 2011-06-24 09:30:38 UTC
Created attachment 509711 [details]
test application to reproduce the problem

Description of problem:

gcov crashes the application if the application forks in multiple threads at
the same time.

#0  0x0000003612430265 in raise () from /lib64/libc.so.6
#1  0x0000003612431d10 in abort () from /lib64/libc.so.6
#2  0x000000000085e2ae in __gcov_open ()
#3  0x000000000085e559 in gcov_exit ()
#4  0x000000000085ef7f in __gcov_flush ()
#5  0x000000000085f019 in __gcov_fork ()


#0  0x000000000085effc in __gcov_merge_add ()
#1  0x000000000085ef1a in gcov_exit ()
#2  0x000000000085ef7f in __gcov_flush ()
#3  0x000000000085f019 in __gcov_fork ()


Version-Release number of selected component (if applicable):
gcov (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)


How reproducible:
build an application with gcov and have it fork concurrently in multiple threads

Steps to Reproduce:
1. call fork() in 2 or more threads at the same time
2. 
3.
  
Actual results:
-> crash (signal 6)

Expected results:
no crash, coverage correctly accumulated in the data files
(the crash in my test program could randomly corrupt the data file)

Additional info:
This crash could be reproduced on:
 * RHEL 5.5 (x64)
 * CentOS 5.5 (x64)
both with gcc 4.1
but not on openSuSE 12.1(gcc 4.6).
I also reported the bug upstream, but they sent me here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49484

Comment 3 Jeff Law 2013-03-21 19:51:53 UTC
Changing component to gcc44 as we are not planning to fix this in the gcc-4.1 based compilers on Red Hat Enterprise Linux 5.  However the fix may be portable to the gcc-4.4 based compiler that is also available on Red Hat Enterprise Linux 5.

Comment 4 Jeff Law 2013-11-13 14:05:02 UTC
This Bugzilla has been reviewed by Red Hat and is not planned on being
addressed in Red Hat Enterprise Linux 5, and therefore will be closed.
If this bug is critical to production systems, please contact your Red
Hat support representative and provide sufficient business
justification.

Also note DTS 2.0 (which is available now on Red Hat Enterprise Linux 5 contains a fix for this issue.