Bug 79407 - Shutting off altstacks -> segfault in existing signal handlers
Shutting off altstacks -> segfault in existing signal handlers
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel (Show other bugs)
2.1
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Larry Woodman
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-11 07:46 EST by Johan Walles
Modified: 2007-11-30 17:06 EST (History)
1 user (show)

See Also:
Fixed In Version: AS2.1/IPF
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-28 12:30:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Altstack problem demonstration. Works on IA32 but not on IA64. (1.36 KB, text/plain)
2002-12-11 07:48 EST, Johan Walles
no flags Details
Fix for the 2.5 series, may need backporting (1.20 KB, patch)
2002-12-12 03:55 EST, Johan Walles
no flags Details | Diff
A similar test case that also needs fixing (1.54 KB, text/plain)
2002-12-16 10:49 EST, Johan Walles
no flags Details
Backported Mosberger's patch for tpc.016 (1.15 KB, patch)
2002-12-16 17:48 EST, Tony Luck
no flags Details | Diff

  None (edit)
Description Johan Walles 2002-12-11 07:46:43 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130

Description of problem:
Will attach a C program that works fine on IA32 but segfaults on IA64.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Write a program that sets up an alternative signal stack.
2. Register an altstack-using signal handler.
3. Disable the alternative signal stack and free() it.
4. Receive the signal.
	

Actual Results:  Segfault.


Expected Results:  The last signal should have been handled on the ordinary
signal stack.


Additional info:
Comment 1 Johan Walles 2002-12-11 07:48:34 EST
Created attachment 88365 [details]
Altstack problem demonstration.  Works on IA32 but not on IA64.
Comment 2 Johan Walles 2002-12-12 03:55:15 EST
Created attachment 88528 [details]
Fix for the 2.5 series, may need backporting
Comment 3 Johan Walles 2002-12-12 03:57:06 EST
Quoting David Mosberger's e-mail containing the patch:

Actually, just looking at the code, it's pretty obvious what's wrong.
Looks like the attached fix was overlooked by me when the
corresponding fix was made on the x86.

Caveat: the attached patch is is for 2.5 and untested.
Comment 4 Johan Walles 2002-12-16 10:49:28 EST
Created attachment 88757 [details]
A similar test case that also needs fixing

This is a very similar testcase that also needs fixing.  I have no idea whether
this test case is covered by the same patch as the other one, but this should
be working as well.  It sets up an altstack, tears it down, registers an
altstack-using signal handler and raise()s the signal.

Just as with the other test case, this segfaults on IA64 but works fine on
IA32.
Comment 5 Tony Luck 2002-12-16 17:48:03 EST
Created attachment 88771 [details]
Backported Mosberger's patch for tpc.016

David's proposed patch doesn't apply cleanly to tpc.016, but the problem is a
trivial re-format of the comment covered by the scope of this patch in 2.5 to
make it conform to Linux coding style.

Here's a version of the patch backported for tpc.016.  With this patch applied
the sigaltstack4.c program runs correctly on ia64.
Comment 6 Johan Walles 2003-01-09 04:35:50 EST
FWIW Mosberger says this patch is good for both test cases.  Tony, as you seem
to be up and running with a patched kernel, could you verify the second test
case as well?
Comment 7 Johan Walles 2003-01-09 04:40:55 EST
Oops, seems Tony didn't get my last comment.  Tony, would it be possible for you
to verify the second test case as well?
Comment 8 Tony Luck 2003-01-09 11:42:55 EST
I just checked the second test case (sigaltstack5.c) on my kernel running with 
the above patch applied.  It runs perfectly, here's the output:
$ ./sigaltstack5
main(): Hello
main(): Done setting up altstack
main(): Done tearing down altstack
main(): Done setting up the signal handler
Signal handler: Hello
main(): Back from signal handling

Since I was updating this bugzilla report anyway, I wanted to increase the 
priority to "high".  This bug is preventing a customer from beginning their 
testing (as I explained to Larry Woodman last Thursday (Jan 2nd)). Bugzilla 
won't let me as I'm not the owner.
Comment 9 Jason Baron 2003-01-16 18:07:06 EST
This patch has been incorporated into the pending errata.
Comment 10 Tony Luck 2003-01-17 18:33:12 EST
Just downloaded the QA cycle version of the e.14 errata kernel that Tim Burke 
just announced.  It builds & boots ok, and both of the sigaltstack4 and 
sigaltstack5 test programs attached to this bug run correctly. Thanks.

Note You need to log in before you can comment on or make changes to this bug.