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: "redi 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 15:54:46 +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 #21 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-12 15:54:46 UTC ---
(In reply to comment #19)
> (In reply to comment #18)
> > Also, gthr.h says the signature should be:
> > void __GTHREAD_MUTEX_INIT_FUNCTION (__gthread_mutex_t *)
>
> I don't understand this?
>
> The current define is pre-existing
>
> #ifdef _GTHREAD_USE_MUTEX_INIT_FUNC
> # undef __GTHREAD_MUTEX_INIT
> # define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
> #endif
>
> I suppose it simply forgets to undef __GTHREAD_MUTEX_INIT_FUNCTION like
> the _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC does.
No, that was intentional.
Before your commit gthr-posix.h never defined __GTHREAD_MUTEX_INIT_FUNCTION
(because all POSIX targets define PTHREAD_MUTEX_INITIALIZER) so there was no
need to undef it. However, gthr-posix.h sometimes defines
__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION (because not all POSIX targets provide
PTHREAD_RECURSIVE_MUTEX_INITIALIZER) so I needed to undef it before
(re-)defining it. I could have alternatively done:
#ifndef __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION ...
#endif
But I chose to just #undef it then #define it.
> I have no access to the weird platforms (but asked for help three month ago
> and again a week ago).
Yes, sorry, I don't subscribe to gcc-patches so only saw it when the change was
committed.
> Please open new bugs for issues you spot.
OK, will do.
> Btw, the gthr-posix.h path with _GTHREAD_USE_MUTEX_INIT_FUNC could have
> never worked as there was no __gthread_mutex_init_function available
> in gthr-posix.h. Or how was that supposed to work?
I added __gthread_mutex_init_function, that's why it's there twice now. Your
patch added another copy of it right below mine!
But my change was only made a month ago:
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183955
So when you first prepared your patch it was correct. Now it's not.