bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rpctrace / libpager / signal preemptor


From: Samuel Thibault
Subject: Re: rpctrace / libpager / signal preemptor
Date: Wed, 16 Nov 2016 19:46:52 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Samuel Thibault, on Mon 14 Nov 2016 01:07:40 +0100, wrote:
> > Once that's been resolved, then we're back to the problem with signal
> > preemptors!  libpager/pager-memcpy.c includes the following code:
> > 
> >   void fault (int signo, long int sigcode, struct sigcontext *scp)
> >     {
> >       assert (scp->sc_error == EKERN_MEMORY_ERROR);
> >       err = pager_get_error (pager, sigcode - window + offset);
> >       n -= sigcode - window;
> >       vm_deallocate (mach_task_self (), window, window_size);
> >       longjmp (buf, 1);
> >     }
> > 
> > Since sigcode no longer contains the faulting address (it's in the subcode,
> > remember?)
> 
> Mmm, no.  For legacy signal handlers (i.e. without SA_SIGINFO), the
> parameters should still be the sigcode: it's
> _hurd_exception2signal_legacy which should be getting called from
> sysdeps/mach/hurd/i386/trampoline.c.

The attached testcase does get the faulting address.

I really believe the issue is related to this:

> Note that there is a 
> 
>   /* XXX what if handler != action->handler (for instance, if a signal
>    * preemptor took over) ? */
> 
> above.  I'd say that when handler != action->handler we should assume
> it's a legacy handler, and make 'action' point to a default-legacy
> sigaction structure, so that it doesn't have SA_SIGINFO, and thus the
> legacy parameters will be passeD.

Samuel

Attachment: test.c
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]