Re: Stack consumption in NPTL



Hello,

Chetan wrote:

Hi,

We have an application which creates multiple threads and has some
logging mechanism. We observed that the application crashes when
using
NPTL but works just fine with LinuxThreads.
The stack trace analysis revealed that the crash is due to smaller
stack size. We are setting the stack size to 16K through the program
using pthread_attr_setstacksize() function.
Increasing the stack size to 128K did not reproduce the crash. We are
trying to find out the difference in behavior between LinuxThreads
and
NPTL with respect to stack size, pthread_attr_setstacksize() etc.
Does
anyone know about this? What should be the stack size for the threads
in NPTL?

See

http://people.redhat.com/drepper/nptl-design.pdf

e.g. section 5.6 might be interesting. I'm not fully sure this is the
reason for your problems, but if thread data-structures, thread-local
storage and stack are merged, and the stack size you give is used
without adjustment, then the variations in behaviour compared to
LinuxThreads and by different applications can be explained.


Bernd Strieder

.



Relevant Pages

  • Stack consumption in NPTL
    ... We observed that the application crashes when ... The stack trace analysis revealed that the crash is due to smaller ... NPTL with respect to stack size, ... void call_my_sprintf ...
    (comp.os.linux.development.apps)
  • Re: Stack Size in NPTL
    ... NPTL with respect to stack size, ... Now I seem to get the crash at different level of recursion for LT and ... For LinuxThreads, it crashes while making 16th recursive call. ...
    (comp.programming.threads)
  • Stack Size in NPTL
    ... The stack trace analysis revealed that the crash is due to smaller ... Increasing the stack size to 128K did not reproduce the crash. ... NPTL with respect to stack size, ... void call_my_sprintf ...
    (comp.programming.threads)
  • Re: controlling stack size in RHEL 3.0 pthreads
    ... smaller stack space. ... hardware designs in C++ for those of you familiar ... NPTL and LinuxThread's versions of pthreads? ... You probably have a bug in your program (or request illegal stack ...
    (comp.programming.threads)
  • Re: Stack consumption in NPTL
    ... analysis revealed that the crash is due to smaller stack size. ... NPTL will reserve 8M of virtual address space per ... Memory Allocation ... data structures and the thread-local storage are placed on the ...
    (comp.os.linux.development.apps)