[Vm-dev] newDelta >0 failed in sqUnixMemory
Damien Cassou
damien.cassou at gmail.com
Sat Jan 31 10:15:02 UTC 2009
On Fri, Jan 30, 2009 at 6:29 PM, Andreas Raab <andreas.raab at gmx.de> wrote:
>>> fprintf(stderr, "oldLimit=%p\ndelta=%d\nnewSize=%d\nnewDelta=%d\n");
>>>
>>> oldLimit=0x80562b8
>>> delta=-1077506096
>>> newSize=0
>>> newDelta=423027548
>>> squeak: /tmp/squeak-svn/platforms/unix/vm/sqUnixMemory.c:175:
>>> uxGrowMemoryBy: Assertion `newDelta >= 0' failed.
>>>
>>> Does it help?
>>
>> Yes. I don't think newSize is supposed to be 0 here.
>>
>> int newSize= min(valign(oldLimit - heap + delta), heapLimit);
>> int newDelta= newSize - heapSize;
>>
>> I'm not sure what is wrong, but apparently it's in the expression
>> "min(valign(oldLimit - heap + delta), heapLimit)".
>
> Could be a CSE bug. Considering that min(a,b) is usually defined as "a < b ?
> a : b" or so, a compiler might do something with the valign(...) expression.
> I would try to move the expression out of there and see if that helps.
Nobody noticed, but I did a very stupid mistake. Look at the call to
fprintf that I copy/pasted in my previous mail. I forgot all the
parameters :-). I don't how it is possible that gcc still compiled the
code...
I moved valign out:
int align = valign(oldLimit - heap + delta);
int newSize= min(align, heapLimit);
And printed the values:
if(newDelta < 0)
fprintf(stderr,
"oldLimit=%p\ndelta=%d\nnewSize=%d\nnewDelta=%d\nalign=%d\n",oldLimit,delta,newSize,newDelta,align);
And got:
oldLimit=0x791c8fe8
delta=0
newSize=23293952
newDelta=-4096
align=23293952
squeak: /tmp/squeak-svn/platforms/unix/vm/sqUnixMemory.c:175:
uxGrowMemoryBy: Assertion `newDelta >= 0' failed.
Aborted
Does that make sense to anyone?
--
Damien Cassou
http://damiencassou.seasidehosting.st
More information about the Vm-dev
mailing list