This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/759] getcontext() not setting arg's uc_stack correctly
- From: "jima at cadence dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 12 Feb 2006 01:25:31 -0000
- Subject: [Bug libc/759] getcontext() not setting arg's uc_stack correctly
- References: <20050223192317.759.marques@cs.cornell.edu>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From jima at cadence dot com 2006-02-12 01:25 -------
Also: The uc_stack member is not set in the ucontext_t
passed as the 3rd argument to signal handlers
(for SIGSEGV, at least). I found this while trying to code
a SIGSEGV handler which could differentiate a stack-overflow
from a random bad memory access by comparing the stack
pointer with the stack limits. But the stack limits are not
set, so this is impossible.
Actually the uc_stack member is not set to zeroes by getcontext(),
but is not being set AT ALL. If you pre-initialize uc_stack.ss_sp
to a random value, the same value is there after calling getcontext().
However, the uc_mcontext data is being set, so the call is not
a total no-op.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=759
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.