Re: Memory allocation problem
- From: Archer <champ@xxxxxxx>
- Date: Sat, 03 Nov 2007 23:19:16 -0000
On 2007/11/03, John Hasler wrote:
Puzzled writes:
From the malloc man page:
"By default, Linux follows an optimistic memory allocation strategy.
This means that when malloc() returns non-NULL there is no guarantee
that the memory really is available. This is a really bad bug."
And it's bit me.
No it hasn't. Read the rest of that note.
I did. And the files in the kernel Documentation/vm direcxtory. And
sysctl/vm.txt.
Does anyone have any ideas about this?
Post your code.
Thankyou.
I avoided that because it would cause a lot of irrelevant chatter, but
having no other recourse, I pasted it in here. *Then* I found the code
that triggered the problem. The program's working fine now.
But the malloc() bug is still there. What test can I apply to it?
The "optimistic strategy" is decribed as the "default". Can malloc()
be switched to a robust strategy? (I tried setting the environment
variable MALLOC_CHECK_ to 1 but that didn't help.)
Why does such a bug exist? Memory allocation is a mission-critical
system service even for trivial programs: why is Linux malloc()
*deliberately* frail?
How can anyone develop credible and portable software when such a
basic service is so unreliable that even its own man page describes
it as having a "really bad bug"?
I remain,
very, very, very,
Puzzled.
.
- Follow-Ups:
- Re: Memory allocation problem
- From: John Hasler
- Re: Memory allocation problem
- References:
- Memory allocation problem
- From: Archer
- Re: Memory allocation problem
- From: John Hasler
- Memory allocation problem
- Prev by Date: Re: Memory allocation problem
- Next by Date: Re: Memory allocation problem
- Previous by thread: Re: Memory allocation problem
- Next by thread: Re: Memory allocation problem
- Index(es):
Relevant Pages
|