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 16:54:42 +0000 [thread overview]
Message-ID: <20001121165442.Y32715@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:
> > and then in another terminal do 'kill -USR1 <pid>'. The program
> > either goes 'Wah!', gives a SEGV, or works. That seems to be because
> > %r1 is corrupted while processing the signal. The signal handler ends
> > with a syscall (rt_sigreturn_wrapper), and %r1, at least, is not saved
> > and restored over the syscall. %r31 also appears to get corrupted, as
> > it is used in the final branch of the syscall return.
>
> I don't really understand what is going on here, but it seems wrong to me
> that setup_rt_frame should be touching regs->iaoq at all when in_syscall.
Problem is that whenever a signal handler is invoked, it is followed
by a sys_rt_sigreturn syscall (invoked via the trampoline code), before
returning to original usercode. I can imagine that this might work if
the process in question was blocked on a syscall, but not if it was
suspended due to an interrupt. In either case the path back to the
original user code is the syscall return path, and that obviously cannot
put things back as they were if the process was interrupted.
I think the answer is for syscall_do_signal to save enough in the
pt_regs such that sys_rt_sigreturn_wrapper can return to userland
via an RFI (like intr_restore, but remembering to trace the syscall
exit if necessary) regardless of the process state when the signal
occurred.
Richard
prev parent reply other threads:[~2000-11-21 16:55 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
2000-11-21 11:26 ` Alan Modra
2000-11-21 16:54 ` Richard Hirst [this message]
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=20001121165442.Y32715@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.