[Bug 257484] New: ulimit -m doesn't work
https://bugzilla.novell.com/show_bug.cgi?id=257484 Summary: ulimit -m doesn't work Product: openSUSE 10.2 Version: Final Platform: x86 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: kernel-maintainers@forge.provo.novell.com ReportedBy: llunak@novell.com QAContact: qa@suse.de $ ulimit -m 300000 $ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 8192 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) 300000 open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 8192 virtual memory (kbytes, -v) 828880 file locks (-x) unlimited $ ./a.out Allocated 100MB Allocated 200MB Allocated 300MB Allocated 400MB Allocated 500MB $ As far as I can say the testapp should crash after allocating 300MB. Using ulimit -d doesn't work either, however ulimit -v does. The testapp is: === #include <stdlib.h> #include <stdio.h> #include <string.h> int main() { for( int i = 1; i <= 5; ++i ) { char* a = new char[ 100 * 1024 * 1024 ]; memset( a, 0, 100 * 1024 * 1024 ); printf( "Allocated %i00MB\n", i ); } } === $ rpm -q kernel-default kernel-default-2.6.18.8-0.1 $ rpm -q glibc glibc-2.5-25 $ rpm -q bash bash-3.1-55 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=257484 gregkh@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|kernel- |bnc-team-screening@forge.provo.novell.com |maintainers@forge.provo.nove| |ll.com | Component|Kernel |Basesystem ------- Comment #1 from gregkh@novell.com 2007-03-29 11:31 MST ------- This should be a glibc error, right? I thought it enforced the ulimit stuff... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=257484 mhorvath@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |pbaudis@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=257484 User jkosina@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=257484#c2 Jiri Kosina <jkosina@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jkosina@novell.com --- Comment #2 from Jiri Kosina <jkosina@novell.com> 2008-07-08 04:09:26 MDT --- glibc malloc implementation uses both mmap() and brk() system calls to obtain a block of free memory. RLIMIT_DATA is documemnted (see getrlimit(2)) to affect only heap areas (i.e. allocations performed by brk() system call). If you want to enforce the limit also on mmaped areas, use RLIMIT_AS instead (be aware that shared libraries and the executable code is also mmaped, though). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=257484 User pbaudis@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=257484#c3 Petr Baudis <pbaudis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #3 from Petr Baudis <pbaudis@novell.com> 2008-07-08 04:14:13 MDT --- Note that RLIMIT_RSS - which is ulimit -m AFAICS - is documented in getrlimit(2) to be basically no-op. Also, glibc has actually nothing to do with the ulimit enforcement. Maybe it would be useful to document this in ulimit documentation more clearly too, but that'd be a separate bash bug. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com