[Vm-dev] Another JIT + GCC issue?

Igor Stasenko siguctua at gmail.com
Thu Apr 5 16:14:14 UTC 2012


Hi Eliot & all,

i & Esteban were investigating what is wrong with crash on windoze
(see http://code.google.com/p/pharo/issues/detail?id=5568)

what we found:

- a stack vm runs given snippet well.
- a cog vm crashing horribly or throws an exception  (see below)

- if i set -O1 optimization for gcc3x-cointerp.c then everything is _FINE_
but if you build with -O2, there is interesting issue with this.

If you start a fresh 1.4 image and run a following snippet in workspace:

| oldm window aForm startPoint endPoint |
oldm := DisplayObject>>#slideFrom:to:nSteps:delay: .
"self assert: (DisplayObject>>#slideFrom:to:nSteps:delay:  ~~oldm)."
window := SystemWindow allInstances first.
aForm := window imageForm offset: 0 at 0.
startPoint := (-194 at 61).
endPoint := (276.0 at 134.0).
aForm
        slideFrom: startPoint
        to: endPoint
        nSteps: 12
        delay: 15.

At first run it shows a DNU: Smallinteger>>DNU #extent: (or just crashes).

It looks like something happens with stack, since receiver should be a Point,
and if you open the debugger and evaluate the corresponding line:
newLoc := locationBlock value
it will print
(-76 at 79)
as expected

next, if you close the debugger and run the very same doit again, bug
disappears and no longer reproducible, and everything works as it
should be.
So, i presume it is related to place where a compiled method is jit-ed
for a first time, and invoked .. but if it is already jited ,
everything runs smoothly.

The compiler version i using on my machine: gcc.exe (GCC) 4.6.1
The compiler used on jenkins slave machine: GCC 4.5.2

And, of course, concerning why this doesn't crashing on Eliot's VMs :
well, since it is related to compiler optimization(s),
and VM code is a lil-bit different in a branch we using on Jenkins, it
could happen that this is not an issue in one case, while causing
problems in another one.
Another option (not necessary impossible), that we missed some
critical fix when merging code from Eliot's branch :)

So, for the time till the cause of it can be found i will change the
configuration to build windows Cog VMs gcc3x-cointerp.c with -O1 flag.

-- 
Best regards,
Igor Stasenko.


More information about the Vm-dev mailing list