From: Alex Barcelo <abarcelo@ac.upc.edu>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] sigaltstack bug in qemu (testing on qemu-ppc)
Date: Sat, 4 Feb 2012 15:26:24 +0100 [thread overview]
Message-ID: <CAFKAgTfA-7hznbqUJnbUbD73FMKM08nqHzcVYk5LNPfcJAYXnA@mail.gmail.com> (raw)
I am barely able to understand this inline function:
static inline int sas_ss_flags(unsigned long sp)
{
return (target_sigaltstack_used.ss_size == 0 ? SS_DISABLE
: on_sig_stack(sp) ? SS_ONSTACK : 0);
}
(signal.c @97)
... and it seems wrong to me when used in the following function. I
have a test program that uses sigaltstack to do some stack
manipulation. It doesn't work.
The function:
...
if ((ka->sa_flags & TARGET_SA_ONSTACK) &&
(/* here maybe a "!" */ sas_ss_flags(oldsp))) {
....
(signal.c, get_sigframe @4121)
Forcing a true value makes everything work (not that I'm claiming it
as the solution, obviously).
I think that it lacks an "!". Either flag SS_DISABLE or SS_ONSTACK are
flags that should *disable* the stack change, so 1 (SS_ONSTACK) and 2
(SS_DISABLE) should not enter the if. And a 0 value means that it
should be ok to do a stack change. It makes sense, but I'm not sure if
I'm oversimplifying things too much. And I wasn't sure if just sending
a patch was ok, given that I don't fully understand the code.
next reply other threads:[~2012-02-04 14:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-04 14:26 Alex Barcelo [this message]
2012-02-04 23:00 ` [Qemu-devel] sigaltstack bug in qemu (testing on qemu-ppc) Peter Maydell
2012-02-09 18:36 ` Alex Barcelo
2012-02-09 22:54 ` Alexander Graf
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=CAFKAgTfA-7hznbqUJnbUbD73FMKM08nqHzcVYk5LNPfcJAYXnA@mail.gmail.com \
--to=abarcelo@ac.upc.edu \
--cc=qemu-devel@nongnu.org \
/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 NNTP newsgroup(s).