This is the mail archive of the libc-alpha@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]

Re: [PATCH 1/2] Set default stack size from program environment


On Tue, Mar 05, 2013 at 03:17:36PM +0100, Andreas Jaeger wrote:
> >How about something like this:
> >
> >1. A /etc/pthreads.conf with hard limits for stack sizes.  Its absence
> >means that RLIMIT_STACK is in play
> >2. A per-user .pthreads.conf with user-level overrides for stack sizes
> >(default_stack_size=1024K) and/or program-level overrides
> >(default_stack_size=/usr/bin/foo:2M)
> >3. An environment variable for process-level overrides.
> 
> This would need also a clear semantic: What if both 2 and 3 are used?

3 should override 2.  (2) is a configuration for all (or specific)
programs spawned by the user, while (3) overrides that configuration
for a specific instantiation of a process.

> Regarding 1: Doesn't ulimit allow hard limits for stack sizes already?

That's an upper limit for growth of the main process stack.  This
would be the initial (and final, since they can't grow) size for
thread stacks.

> This kind of different values will be very hard to debug - unless you
> add also some kind of LD_DEBUG=pthread debugging facility that
> displays the values read and the choice made.

Sure, I can do that.  I'll write up a wiki document to describe this,
so that I don't miss out on any agreed upon details during
implementation.

Siddhesh


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