Red Hat Bugzilla – Bug 133460
setrlimit/getrlimit should be per-process, not per-thread
Last modified: 2007-11-30 17:10:49 EST
Description of problem:
POSIX specifies that
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Compile attached program with -lpthread.
2. Run it. See it writes 3 bytes.
3. Realize it should have died with SIGXFSZ.
killed by SIGXFSZ
Fix on the way.
Created attachment 104249 [details]
test program for multithreaded behavior of setrlimit
gcc -g -o mt-rlimit mt-rlimit.c -lpthread
Run with some args, demonstrates the single-threaded case and dies with
Run with no args, demonstrates the multi-threaded case and only dies with
SIGXFSZ if the kernel is fixed.
Created attachment 104251 [details]
patch vs 2.6.9-rc2-bk9 to fix the behavior
I've submitted this patch upstream, waiting for feedback.
This patch has gone in upstream, after 2.6.9; hopefully in 2.6.10 release.
2.6.10 has this fixed. Only the RLIMIT_CPU behavior is not quite correct,
everything else should be right now.