This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/759] getcontext() not setting arg's uc_stack correctly


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]