From: Richard Hirst <rhirst@linuxcare.com>
To: Alan Modra <alan@linuxcare.com.au>
Cc: parisc-linux@thepuffingroup.com
Subject: Re: [parisc-linux] signal handling problems (32 bit kernel)
Date: Tue, 21 Nov 2000 09:34:42 +0000 [thread overview]
Message-ID: <20001121093442.U32715@linuxcare.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0011211713550.15623-100000@front.linuxcare.com.au>; from alan@linuxcare.com.au on Tue, Nov 21, 2000 at 06:05:36PM +1100
On Tue, Nov 21, 2000 at 06:05:36PM +1100, Alan Modra wrote:
> On Mon, 20 Nov 2000, Richard Hirst wrote:
>
> > #warning XXX FIXME probably bogus -PB
> > /* I think this is bogus -- it'll cause the first instn of the
> > * signal handler to be executed twice! Better might be to
>
> Definitely bogus, as with quite a lot of iaoq manipulation in signal.c
As another example, if a process gets a signal as it is about to
execute the instr in the delay slot of a branch, it forgets that it
was supposed to be branching on return from the signal handler. Try
compiling the following and sending it a SIGUSR1:
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
void sig_handler(int sig)
{
}
int main()
{
struct sigaction act;
int i = 1;
memset(&act, 0, sizeof(act));
act.sa_handler = sig_handler;
sigaction(SIGUSR1, &act, NULL);
printf("I am %d\n", getpid());
while (i++)
;
printf("Escaped, i=%d!\n", i);
return 0;
}
Oh, you have to run it with "LD_BIND_NOW=1 <progname>" to avoid one of
the other problems.
Time to try and work out what signal.c is really trying to do, I guess.
Richard
next prev parent reply other threads:[~2000-11-21 9:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-20 17:58 [parisc-linux] signal handling problems (32 bit kernel) Richard Hirst
2000-11-21 7:05 ` Alan Modra
2000-11-21 9:34 ` Richard Hirst [this message]
2000-11-21 11:26 ` Alan Modra
2000-11-21 16:54 ` Richard Hirst
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=20001121093442.U32715@linuxcare.com \
--to=rhirst@linuxcare.com \
--cc=alan@linuxcare.com.au \
--cc=parisc-linux@thepuffingroup.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