This is the mail archive of the libc-alpha@sourceware.org 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: Cancellation and dlmopen?


On 11/10/2015 07:27 AM, Adhemerval Zanella wrote:
>> IIUC your work removes these variables as it introduces cancellation
>> regions around the syscalls, so we shouldn't see this problem?
>>
>> Does that sound right?
> 
> Currently my patchset still adds the 'optimization' to first check if
> program is in single-thread to avoid call the cancellation function.
> This is done in sysdep-cancel.h headers.  

OK, if we don't remove the optimization then there is still the risk
that a statically dlopen'd libc.so.6 may think it is unthreaded,
and a dlmopen'd libc.so.6 may think it is unthreaded.

In both context's I think we will need to add something to the
documentation to clarify that if you are calling into an new namespace
(which is what dlopen from a static binary is equivalent to) that if the new
namespace does not also load libpthread.so, then it is not thread safe
for you to call any function in that new namespace from multiple
threads.

Does that make sense?

Cheers,
Carlos.


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