VM crash

David T. Lewis lewis at mail.msen.com
Mon Jun 5 02:25:23 UTC 2006


On Sun, Jun 04, 2006 at 10:02:18PM +0100, Bob.Cowdery at CGI-Europe.com wrote:
> David - and anyone else that can help. Things are looking bad now!
> 
> I can now crash my VM in about 10 seconds, guaranteed. I wonder if you would
> be good enough to try this on Linux. I moved your class code to another
> class so I could instance the calling class and then ran this:
> 
> [1 to: 1000 do: [:a|data1 := app1 test]]fork.
> [1 to: 1000 do: [:b|data2 := app2 test]]fork.
> [1 to: 1000 do: [:c|data3 := app3 test]]fork.
> [1 to: 1000 do: [:d|data4 := app4 test]]fork.
> [1 to: 1000 do: [:e|data5 := app5 test]]fork.
> [1 to: 1000 do: [:f|data6 := app6 test]]fork.
> [1 to: 1000 do: [:g|data7 := app7 test]]fork.
> [1 to: 1000 do: [:h|data8 := app8 test]]fork.
> [1 to: 1000 do: [:i|data9 := app9 test]]fork.
> [1 to: 1000 do: [:j|data10 := app10 test]]fork.
> 
> Where app1 to app10 are instances of the calling class. It breaks almost
> every time (now I have taken out the Transcript writes which were slowing it
> down). Maybe there are re-entrancy problems somewhere and what I am doing is
> not valid. The stack trace in the dump I am pretty sure is a consequence of
> where it was in the block execution and not anything to do with the crash.

I tried running this on my system, and I do *not* get a crash.

However, others in this thread pointed out that your return value from the
primitive is incorrect. I should return an object (an OOP) rather than a C
pointer value.  You should definitely fix this, but I don't think it is the
cause of your VM crashes as long as you are not actually making use of the
return value.  However, if you *do* make use of the return value, you will
crash the VM.  I just tried it, and the VM crashed.

So I would say your next step should be to get rid of the "^ data" as the
last line of your primitive, and re-run your crash tests. My guess is that
you will still get crashes, because I suspect that we are all barking up
the wrong tree at this point. But if the crashes stop, then you're home
free.

One more thing to think about: You have been running an image with a
plugin that returns bogus object pointers after callng your primitive.
If these bogus object pointers are somehow accumulating in your image,
and if they are later accessed for any reason (possibly including the
garbage collector), then I would guess that it's possible you have an
image that is waiting to crash on you and unexpected times. You mentioned
that you have two systems (a laptop and something else), and that one of
them crashes, and the other does not. I think that you should copy the
image & changes from the system that does not crash over to the system
that does crash, and see if that image runs OK on both computers. If
so, you may want to just save all of your source code and file it in
to a clean image to start fresh. This is pure speculation, but my
next best guess would have been to blame the hardware on the system
that crashes, and that would almost certainly have been a bad guess ;)

Dave




More information about the Squeak-dev mailing list