[Vm-dev] newDelta >0 failed in sqUnixMemory

David T. Lewis lewis at mail.msen.com
Wed Feb 4 00:55:50 UTC 2009


On Mon, Feb 02, 2009 at 12:28:49PM +0100, Damien Cassou wrote:
>  
> On Sat, Jan 31, 2009 at 5:55 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> > Just a hunch, but I would guess that if you changed valign() from a
> > macro to a function that it would somehow decide to start working.
> 
> I used a function and get the following results.
> 
> int
> myvalign(int x) {
>   return x & pageMask;
> }
> 
>  int argToAlign = oldLimit - heap + delta;
>       int align = myvalign(argToAlign);
>       int newSize= min(align, heapLimit);
>       int newDelta= newSize - heapSize;
> 
> oldLimit=0x7929cfe8
> delta=0
> newSize=23293952
> newDelta=-4096
> align=23293952
> argToAlign=23298024
> heap=2009485312
> heapLimit=1073741824
> squeak: /tmp/squeak-svn/platforms/unix/vm/sqUnixMemory.c:181:
> uxGrowMemoryBy: Assertion `newDelta >= 0' failed.

Hi Damien,

I'm not sure that I can be of much help here, but for what it's worth:

I copied the numbers from your test into a small stand alone test program
(attached for reference). The values that you printed all look reasonable,
and I think that the problem is probably *not* in the uxGrowMemoryBy()
function. The calculations up through newDelta all look correct, which
suggests that either heapSize (static var in sqUnixMemory.c) or oldLimit
(parameter to the function) are not set to the expected values. Of the two,
I would guess that the value of oldLimit is the more likely culprit, because
heapSize looks straightforward, while oldLimit is passed to the the unix
support code from ObjectMemory>>growObjectMemory: (translated Slang), and
goes through a pointerForOop() conversion along the way.

I'm completely guessing about the problem at this point, and obviously it
was related to the version of gcc you are using. Still, it's worth asking the
question, what version of VMMaker are you using?

Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkUxGrowMemoryBy.c
Type: text/x-csrc
Size: 1627 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20090203/6f2105fd/checkUxGrowMemoryBy.c


More information about the Vm-dev mailing list