diff --git a/checkin_notes b/checkin_notes index 0a664840c8..c7f31b6633 100755 --- a/checkin_notes +++ b/checkin_notes @@ -1391,3 +1391,9 @@ David 30 Jan 2007 tools/ backend_lib.C,h create_work.C + +David 30 Jan 2007 + - Unix: when increasing stack size for apps, don't exceed 500 MB + + client/ + app_start.C diff --git a/client/app_start.C b/client/app_start.C index 85adaba5ad..0d3991c407 100644 --- a/client/app_start.C +++ b/client/app_start.C @@ -617,7 +617,11 @@ int ACTIVE_TASK::start(bool first_time) { // struct rlimit rlim; getrlimit(RLIMIT_STACK, &rlim); - rlim.rlim_cur = rlim.rlim_max; + if (rlim.rlim_max == RLIM_INFINITY || rlim.rlim_max > 500000000) { + rlim.rlim_cur = 500000000; // 500 MB max + } else { + rlim.rlim_cur = rlim.rlim_max; + } setrlimit(RLIMIT_STACK, &rlim); // hook up stderr to a specially-named file