This is the mail archive of the libc-help@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: çå: Help, any one ever meet hanging on _IO_lock_lock(list_all_lock) issue ?


On 11/15/2013 08:18 PM, Wuqixuan wrote:
>> Andreas can best comment on that.
> 
> We found a discussion which can cause this problem and Andreas also was on that, so we guess below 
> discussion cause Andreas to make the patch ( can Andreas confirm?) . 
> http://sourceware-org.1504.n7.nabble.com/PATCH-Fix-possible-deadlock-in-stdio-locking-code-td6853.html 
> 
> Also, we analyze the code that thread(A) call pthread_cancel and thread(B) call fcloseall at the same time, 
> can reproduce this issue. 
> 
> Thread A                      Thread B
>                                      fcloseall
>                                     _IO_cleanup
> pthread_cancelïBï   _IO_flush_all_lockp(0)  
>                                     _IO_cleanup_region_start_noarg (flush_cleanup) 
>                                                      (here register flush_cleanup, if we did the patch, flush_cleanup will not be registered)
>                                     write (here is a cancel point, so it check somebody cancel  me)
>                                           call flush_cleanup, (list_all_lock->cnt reduce to -1, but occur)
>                                     thread exit.
> 
> So we guess our problem is similiar with it. 

Just to be clear: Does Andreas' patch fix this issue?

Note that we can try to force this issue to appear by
doing some white-box testing and using systemtap to
delay or abitrarily synchronize the operation of certain
threads (I've done this before to expose threading issues
by delaying pthread calls via the ld audit interface to
widen small race conditions).

Cheers,
Carlos.


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