public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Jon TURNEY <jon.turney@dronecode.org.uk>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Only construct ucontext for SA_SIGINFO signal handlers
Date: Fri, 03 Apr 2015 12:51:00 -0000	[thread overview]
Message-ID: <551E8CBB.4020306@dronecode.org.uk> (raw)
In-Reply-To: <20150403121707.GT13285@calimero.vinschen.de>

On 03/04/2015 13:17, Corinna Vinschen wrote:
> On Apr  3 13:18, Corinna Vinschen wrote:
>> On Apr  2 20:30, Jon TURNEY wrote:
>>
>>>         sigset_t this_oldmask = set_process_mask_delta ();
>>> -      thiscontext.uc_sigmask = this_oldmask;
>>> +      context.uc_sigmask = this_oldmask;
>>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> This call to set_process_mask_delta() should occur before constructing
>> the context, so that filling in uc_sigmask can be moved into the above
>> `'if' branch.

Ok, I will move it.

>> On second thought, isn't this slightly wrong anyway?  Shouldn't that be
>>
>>           context.uc_sigmask = _my_tls.sigmask;
>> 	 context.uc_mcontext.oldmask = this_oldmask;

As I wrote elsewhere:  You'll have to help me understand what the 
difference in meaning between ucontext_t.uc_sigmask and 
ucontext_t.uc_mcontext.oldmask is.

I don't see how the value of _my_tls.sigmask has any meaning at that 
point in the code.

> Oh, btw., what about cr2?  Right now, with the above code, it contains
> a random value.  It should at least be zero'ed out.  Alternatively:
>
>    context.uc_mcontext.cr2 = (thissi.si_signo == SIGSEGV
> 			     || thissi.si_signo == SIGBUS)
> 			    ? (uintptr_t) thissi.si_addr : 0;
>

Sure, but can we deal with that as a separate patch?

  reply	other threads:[~2015-04-03 12:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 19:30 Jon TURNEY
2015-04-03 11:18 ` Corinna Vinschen
2015-04-03 12:17   ` Corinna Vinschen
2015-04-03 12:51     ` Jon TURNEY [this message]
2015-04-03 14:08       ` Corinna Vinschen
2015-04-04 16:07         ` Jon TURNEY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551E8CBB.4020306@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).