This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: i386 backtrace() question


> While tracking down an unrelated libunwind failure on x86, I came
> across this curious test in sysdeps/i386/backtrace.c:
> 
>       if ((void *) current < esp || (void *) current > __libc_stack_end)
> 
> The test is obvous for non-threaded programs.  However, I'd like to
> confirm that the test is OK for multi-threaded programs as well,
> because all thread stacks will be allocated below __libc_stack_end.
> I'm pretty sure that's true for Linux, though I'm uncertain about how
> stack-randomization or other OSes would affect the validity of the
> test.  Could somebody confirm?

This is the case on Linux with all kernels I'm aware of.  It's not true on
GNU/Hurd, where the stack can be anywhere (it's just a vanilla allocation
like an mmap).


Thanks,
Roland
.


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