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: [PATCH 08/08] nptl: arm: Fix Race conditions in pthread cancellation (BZ#12683)


On Thu, 2015-09-03 at 12:52 -0300, Adhemerval Zanella wrote:
> I can change to:
> 
>         mov     lr, pc
>         b       __syscall_do_cancel
> 
> Which explicit state it is a tail cail that do not return.

If you set lr like that then the implication is that it will return
(since otherwise lr would be unnecessary).  A regular tail call would
just do the branch without changing lr at all.

> If you check my first message (00/08: nptl: Fix Race conditions in pthread 
> cancellation (BZ#12683)) the idea of this modification it exactly to route
> *all* cancellable syscall to the __syscall_cancel_arch.  It is required
> because the __syscall_cancel_arch have the global marks the signal cancel
> handler (sigcancel_handle in nptl/nptl-init.c) will use to check if the 
> instruction pointer falls within the cancellable syscall code.

Ah, I see.  Your original message didn't actually say that, but now I
understand how it's supposed to work.  However, I think the amount of
stack shuffling that you're doing is still rather excessive.  

If __syscall_cancel_arch simply needs to be a delineated block of code
and isn't called from anywhere except PSEUDO then it doesn't necessarily
need to obey the normal ABI calling conventions.  But even if it does, I
think it should be possible to achieve this result with rather less
complexity than you seem to have at the moment.

p.



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