Re(2): argument too large
Re(2): argument too large
- Subject: Re(2): argument too large
- From: Jens Bauer <email@hidden>
- Date: Wed, 5 Dec 2001 00:06:19 +0100
Hi Andreas and Angela,
On Mon, 3 Dec, 2001, Andreas Monitzer <email@hidden> wrote:
>
On Monday, December 3, 2001, at 10:26 , Angela Brett wrote:
>
>
> I have a program which usually works okay, but yesterday I got the
>
> following puzzling error, and then my program quit with a SIGBUS.
>
>
>
> *** malloc_zone_malloc[966]: argument too large: -708160
>
>
>
> Well, I know what malloc is, but I don't know what the error means or
>
> what could be causing it, or whether it has anything to do with my
>
> code. It's not happening now, but is there a way I can make sure it
>
> doesn't happen again, or is it just some kind of freak thing?
>
>
Your application tried to allocate -708160 bytes of memory. I don't know
>
what could cause this behavior, though.
My shot is something like this:
OSStatus err;
...
...
err = SomeStrangeFunction();
if(10 == err || 13 == err)
{
myMostLikelyInitializedVariable = 100;
}
buffer = malloc(myMostLikelyInitializedVariable);
...
So that the size is very often initialized, but in rare cases, you forget
to initialize it. This could be when a file was not found or the user left
the cursor in the wrong input field... ;)
Love,
Jens