Bug 58006
Summary: | "limit datasize" does not work | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Jamie Zawinski <jwz> | ||||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||||
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 7.2 | CC: | fweimer | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | i386 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2004-08-26 04:19:17 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Jamie Zawinski
2002-01-05 00:34:05 UTC
Created attachment 41831 [details]
malloc-bomb.c source: program that verbosely allocates memory
Created attachment 41832 [details]
limiter.pl -- program to demonstrate that setrlimit() works correctly
The difference is that limiter.pl (and (ulimit -v) referenced in malloc-bomb.c) use RLIMIT_AS, but (limit datasize) uses RLIMIT_DATA. If you use (limit vmemoryuse) under tcsh (to also use RLIMIT_AS), bash and tcsh behave exactly the same. OTOH SUSv3 specifies: RLIMIT_DATA This is the maximum size of a processâ data segment, in bytes. If this limit is exceeded, the malloc() function shall fail with errno set to [ENOMEM]. In fact, RLIMIT_DATA limits memory allocated through sbrk (), but malloc () in glibc can also use mmap (). This seems like a violation of the standard by glibc. That POSIX text is ancient. If one insists to have this definition of RLIMIT_DATA, simply start the application with MALLOC_MMAP_THRESHOLD_=0 in the environment. That is perfectly fine with POSIX. POSIX specifies only that there must be one environment in which all the rules apply. The default environment does not have this stupid limitation which nobody wants. |