[Vm-dev] Crash on start-up.

Michael van der Gulik mikevdg at gmail.com
Sun Mar 22 03:55:18 UTC 2009


<snip>
>>> Hi VM guys.
>>>
>>> Does anybody have any insights into the following?:
>>>
>>> I get the following crash. I've tried this on a Windows VM of unknown
>>> version and a 3.9-alpha Linux VM with the same result:
>>>
>>> Segmentation fault
>>> I suspect this may have caused it:
>>>
>>> !EventSensor methodsFor: 'as yet unclassified' stamp: 'mvdg 3/17/2009
>>> 21:54' prior: 36505616!
>>> startUp
>>>  [
>>>   panicButtonPressed := false.
>>>
>>>   Smalltalk.Sensor shutDown.
>>>   inputSemaphore := Semaphore new.
>>>   Smalltalk.ExternalSemaphoreTable registerExternalObject:
>>> inputSemaphore.
>>>   self primSetInputSemaphore: inputSemaphore.
>>>
>>>   self enterEventLoop.
>>>  ] ensure: [
>>>   Smalltalk.Sensor startUp.
>>>   Smalltalk.Display restore.
>>>  ].! !
>>>

gdb says:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210165584 (LWP 21449)]
0x0807db94 in transferTo (aProc=599900164) at
/home/mikevdg/squeak/vmmaker/Squeak-3.9-7/platforms/unix/src/vm/interp.c:22468
22468                   tmp = longAt(((longAt((newProc +
BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord))) +
BaseHeaderSize) + (MethodIndex << ShiftForWord));
(gdb) bt
#0  0x0807db94 in transferTo (aProc=599900164) at
/home/mikevdg/squeak/vmmaker/Squeak-3.9-7/platforms/unix/src/vm/interp.c:22468
#1  0x0807be70 in resume (aProcess=599900164) at
/home/mikevdg/squeak/vmmaker/Squeak-3.9-7/platforms/unix/src/vm/interp.c:21277
#2  0x0807da45 in synchronousSignal (aSemaphore=600188584) at
/home/mikevdg/squeak/vmmaker/Squeak-3.9-7/platforms/unix/src/vm/interp.c:22424
#3  0x08077859 in primitiveSignal () at
/home/mikevdg/squeak/vmmaker/Squeak-3.9-7/platforms/unix/src/vm/interp.c:18722
#4  0x08060ac6 in dispatchFunctionPointer (aFunctionPointer=0x80777a1)
at /home/mikevdg/squeak/vmmaker/Squeak-3.9-7/platforms/unix/src/vm/interp.c:3949
#5  0x080667cf in interpret () at
/home/mikevdg/squeak/vmmaker/Squeak-3.9-7/platforms/unix/src/vm/interp.c:7756
#6  0x0805d652 in main ()
(gdb) l
22463                   if ((longAt((newProc + BaseHeaderSize) +
(SuspendedContextIndex << ShiftForWord))) < foo->youngStart) {
22464                           beRootIfOld(longAt((newProc +
BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord)));
22465                   }
22466                   foo->activeContext = longAt((newProc +
BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord));
22467                   /* begin fetchContextRegisters: */
22468                   tmp = longAt(((longAt((newProc +
BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord))) +
BaseHeaderSize) + (MethodIndex << ShiftForWord));
22469                   if ((tmp & 1)) {
22470                           tmp = longAt(((longAt((newProc +
BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord))) +
BaseHeaderSize) + (HomeIndex << ShiftForWord));
22471                           if (tmp < foo->youngStart) {
22472                                   beRootIfOld(tmp);
(gdb) p newProc
$1 = 599900164

By my understanding, Interpreter>>fetchContextRegisters: is reading
from a corrupted method context when it changes processes (in
Semaphore>>critical:) . My next step would be to manually dissect that
context using gdb. I suspect this is related to start-up code somehow
which is changing processes before something is initialised (??).

I can recreate this problem very easily. If anybody is interested in
debugging this more, I can send you an image.

Otherwise I'll report this on bugs.squeak.org assigned to myself and
hack at it again when it annoys me enough.

Gulik.

-- 
http://gulik.pbwiki.com/


More information about the Vm-dev mailing list