This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports 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]

Re: thread_self() and STACK_GROWS_UP


On 6/6/06, Daniel Jacobowitz <drow@false.org> wrote:

See THREAD_STACK_START_ADDRESS, which you can redefine - as far as I
know, fairly freely.

Looking at the default for __pthread_initial_thread_bos, I'd have
thought it would put thread stacks below your stack already, by
default.  Did you change that to get them above somehow?

No, I don't think I changed anything in that regard.


The setup is done in pthread.c:

 __pthread_initial_thread_bos = (char *)
   ((long)CURRENT_STACK_FRAME &~ (STACK_SIZE - 1));

If any stacks were put below that we would get a segfault, as the
stack vma grows up (notionally) not down! So the code is doing the
right thing w.r.t to STACK_GROWS_UP.


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