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

[Bug libc/5758] [patch] Fix getrlimit() acting funny sometimes


------- Additional Comments From thomas dot jarosch at intra2net dot com  2008-02-12 18:40 -------
Ulrich,

Concerning the rlimit issue:
My main system is running glibc 2.1.3 and kernel 2.6.23.
I've added some debug loggers to the kernel and traced
bash's 2.04 "ulimit -s unlimited" call. This ends up
in the kernel as sys_setrlimit(RLIMIT_STACK) -> 2147483647.

That's the signed version of RLIMIT_INFINITY missing one bit, right?
As far as I can tell there is no translation layer for setrlimit
in the kernel and there is only a ugetrlimit call but no usetrlimit call.
-> Old glibc versions will set wrong values.

As I'm currently in the process of switching the primary glibc to 2.7
I can add a small patch to nptl/init.c to get "__default_stacksize"
to a reasonable value until the switch over is complete.

OTOH we could modify unix/sysv/linux/i386/getrlimit.c to apply
the same "compat" code for ugetrlimit as for getrlimit.
Who want's a stack size of -exactly- 2GB for the threads anyway?!

This solves the famous error message like:
"gnome-terminal: allocatestack.c:370: allocate_stack: Assertion `size != 0' 
failed."

Here are just two examples of users facing the problem:

http://hercules.herts.ac.uk/~mjh/limits-conf-problem.html

or

http://nptl.bullopensource.org/phpBB/viewtopic.php?p=290


Hope you don't try to kill me again ;-)

Regards,
Thomas

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=5758

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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