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

Florian Weimer fweimer@redhat.com
Mon Feb 11 21:40:00 GMT 2019


* Carlos O'Donell:

>> -  LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd->result);
>> +  LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd_result);
>
> What prevents the compiler from optimizing away pd_result and using
> pd->result directly again?

The __free_tcb call acts as an implicit optimization barrier, like any
function call that doesn't have attributes that say otherwise.

> The actions of __free_tcb() and their consequences are not visible
> to the compiler.

Exactly.  The compiler cannot rematerialize the value from pd->result
because it has no way of knowing if the value is still the same.

Thanks,
Florian



More information about the Libc-alpha mailing list