This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug gcov-profile/49484] gcov crash if two(or more) forks happen at the same time
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 14:23:32 +0000
- Subject: [Bug gcov-profile/49484] gcov crash if two(or more) forks happen at the same time
- Auto-submitted: auto-generated
- References: <bug-49484-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49484
--- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-12 14:23:32 UTC ---
Author: rguenth
Date: Mon Mar 12 14:23:27 2012
New Revision: 185231
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185231
Log:
2012-03-12 Richard Guenther <rguenther@suse.de>
* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
(__gthread_mutex_init_function): New function.
* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
PR gcov/49484
* libgcov.c: Include gthr.h.
(__gcov_flush_mx): New global variable.
(init_mx, init_mx_once): New functions.
(__gcov_flush): Protect self with a mutex.
(__gcov_fork): Re-initialize mutex after forking.
* unwind-dw2-fde.c: Change condition under which to use
__GTHREAD_MUTEX_INIT_FUNCTION.
Modified:
trunk/libgcc/ChangeLog
trunk/libgcc/gthr-posix.h
trunk/libgcc/gthr-single.h
trunk/libgcc/gthr.h
trunk/libgcc/libgcov.c
trunk/libgcc/unwind-dw2-fde.c