This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] nptl: Fix invalid Systemtap probe in pthread_join [BZ #24211]

* Carlos O'Donell:

> Why not move the probe up?
>  77   if (block)
>  78     {
>  79       /* If abstime is NULL we switch to asynchronous cancellation.  If we
>  80          are cancelled then the thread we are waiting for must be marked as
>  81          un-wait-ed for again.  */
>  82       pthread_cleanup_push (cleanup, &pd->joinid);
>  83 
>  84       result = lll_wait_tid (pd->tid, abstime);
>  85 
>  86       pthread_cleanup_pop (0);
>  87     }
>  88 
> LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd->result);
> ^^^^

I think it should come after the stack has been freed.  It's explicitly
documented as a return probe (“probe for pthread_join return”).

> At this point the join is complete.
> We have the threadid (constant).
> We have the result (just returned from lll_wait_tid).
> We have pd->result (the thread returned).
> We aren't waiting for anything else?

Something might be interested in the fact that the stack is actually
gone.  I'm not sure if this is a change we should make when backporting.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]