Re: Stack consumption in NPTL
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Fri, 7 Mar 2008 15:33:53 -0800 (PST)
On Mar 7, 1:39 am, Chetan <chetan...@xxxxxxxxx> wrote:
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?
You really are wasting your time. Just stop setting the stack size so
low. Investigating when you can get away with invoking undefined
behavior and when you can't just isn't interesting. Nobody wants
programs that "might happen to" work.
Reduce your stack usage and leave the default stack size. Don't
allocate large objects on the stack and limit your call stack depths
to reasonable ones. (There are other good reasons to do these two
things as well, for example, there is no reliable way to indicate out-
of-memory when an allocation occurs on the stack.)
DS
.
- References:
- Stack consumption in NPTL
- From: Chetan
- Stack consumption in NPTL
- Prev by Date: why does it not get the value in perl run shell script to call include php file?
- Next by Date: Files not found
- Previous by thread: Re: Stack consumption in NPTL
- Next by thread: why does it not get the value in perl run shell script to call include php file?
- Index(es):
Relevant Pages
|