|
From: <sv...@va...> - 2009-07-26 20:15:51
|
Author: sewardj
Date: 2009-07-26 21:15:37 +0100 (Sun, 26 Jul 2009)
New Revision: 10626
Log:
Unbreak Helgrind on Linux following recent Darwin hackery.
Modified:
trunk/helgrind/hg_intercepts.c
Modified: trunk/helgrind/hg_intercepts.c
===================================================================
--- trunk/helgrind/hg_intercepts.c 2009-07-26 19:55:18 UTC (rev 10625)
+++ trunk/helgrind/hg_intercepts.c 2009-07-26 20:15:37 UTC (rev 10626)
@@ -208,6 +208,9 @@
// darwin: pthread_create
// darwin: pthread_create_suspended_np (trapped)
//
+/* ensure this has its own frame, so as to make it more distinguishable
+ in suppressions */
+__attribute__((noinline))
static int pthread_create_WRK(pthread_t *thread, const pthread_attr_t *attr,
void *(*start) (void *), void *arg)
{
@@ -1400,6 +1403,7 @@
/*----------------------------------------------------------------*/
#include <semaphore.h>
+#include <fcntl.h> /* O_CREAT */
#define TRACE_SEM_FNS 0
|
|
From: Bart V. A. <bar...@gm...> - 2009-07-27 12:16:09
|
On Sun, Jul 26, 2009 at 10:15 PM, <sv...@va...> wrote:
> New Revision: 10626
> [...]
> Modified: trunk/helgrind/hg_intercepts.c
> ===================================================================
> --- trunk/helgrind/hg_intercepts.c 2009-07-26 19:55:18 UTC (rev 10625)
> +++ trunk/helgrind/hg_intercepts.c 2009-07-26 20:15:37 UTC (rev 10626)
> @@ -208,6 +208,9 @@
> // darwin: pthread_create
> // darwin: pthread_create_suspended_np (trapped)
> //
> +/* ensure this has its own frame, so as to make it more distinguishable
> + in suppressions */
> +__attribute__((noinline))
> static int pthread_create_WRK(pthread_t *thread, const pthread_attr_t *attr,
> void *(*start) (void *), void *arg)
> {
Hello Julian,
In case you did not yet notice it: the above change breaks the
regression tests helgrind/tests/tc20_verifywrap and
helgrind/tests/tc23_bogus_condwait because an additional stack frame
appeared in the call stacks printed while running these tests.
Bart.
|
|
From: Julian S. <js...@ac...> - 2009-07-27 13:16:11
|
On Monday 27 July 2009, Bart Van Assche wrote:
> On Sun, Jul 26, 2009 at 10:15 PM, <sv...@va...> wrote:
> > New Revision: 10626
> > [...]
> > Modified: trunk/helgrind/hg_intercepts.c
> > ===================================================================
> > --- trunk/helgrind/hg_intercepts.c 2009-07-26 19:55:18 UTC (rev
> > 10625) +++ trunk/helgrind/hg_intercepts.c 2009-07-26 20:15:37 UTC
> > (rev 10626) @@ -208,6 +208,9 @@
> > // darwin: pthread_create
> > // darwin: pthread_create_suspended_np (trapped)
> > //
> > +/* ensure this has its own frame, so as to make it more distinguishable
> > + in suppressions */
> > +__attribute__((noinline))
> > static int pthread_create_WRK(pthread_t *thread, const pthread_attr_t
> > *attr, void *(*start) (void *), void *arg) {
>
> Hello Julian,
>
> In case you did not yet notice it: the above change breaks the
> regression tests helgrind/tests/tc20_verifywrap and
> helgrind/tests/tc23_bogus_condwait because an additional stack frame
> appeared in the call stacks printed while running these tests.
Hi, yes. I added the __attribute__((noinline)) to consistently
cause it to have its own frame. I think it got inlined on Linux
and not on Darwin (or the other way around), causing problems with
portability of suppressions, since there would be a frame on one
and not on the other.
J
|