<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=utf-8 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT size=2 face=Arial>Hi Eliot,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Got home from my new job and started looking into
this. It turns out that this morning I found that I had a button bar that
was stepping and part of the step was a Smalltalk garbageCollect to force
collection before checking for instances. It may be something I don't need
to do anymore, however it helps expose this seg fault. Both stack dumps
were in the garbageCollect. I removed the button bar, uploaded the image,
and ran it. CPU% dropped from 33% to 2%. I let it run all day.
At some point it exited, for an unknown reason, as it was gone when I returned
tonight.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I have reinstated the button bar, to help this bug
occur, and uploaded it to the server. </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Now I just need to enable -leakcheck. From
sqUnixMain.c it looks like it takes an argument. What is that
argument?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Thanks,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Rob</FONT></DIV>
<DIV> </DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=eliot.miranda@gmail.com
href="mailto:eliot.miranda@gmail.com">Eliot Miranda</A> </DIV>
<DIV><B>Sent:</B> Monday, July 19, 2010 1:47 PM</DIV>
<DIV><B>To:</B> <A title=reefedjib@yahoo.com
href="mailto:reefedjib@yahoo.com">Rob Withers</A> </DIV>
<DIV><B>Cc:</B> <A
title="mailto:vm-dev@lists.squeakfoundation.org CTRL + Click to follow link"
href="mailto:vm-dev@lists.squeakfoundation.org">Squeak Virtual Machine
Development Discussion</A> </DIV>
<DIV><B>Subject:</B> Re: Cog segmentation fault on Linux</DIV></DIV></DIV>
<DIV><BR></DIV>Hi Rob,<BR><BR>
<DIV class=gmail_quote>On Mon, Jul 19, 2010 at 3:10 AM, Rob Withers <SPAN
dir=ltr><<A
href="mailto:reefedjib@yahoo.com">reefedjib@yahoo.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Eliot,<BR><BR>I am getting a segmentation fault running Cog
headless on linux. Here is the stack dump. Below is a second stack
dump that looks different.<BR></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>While the heap corruption might be a bug in Cog it might also be heap
corruption from external code (e.g. objects passed through FFI calls to external
code that overwrites those objects' bounds).</DIV>
<DIV><BR></DIV>
<DIV>There's a leak checker in Cog (see the -leakcheck argument
in platforms/unix/vm/sqUnixMain.c) that can help you localise this.
Its best to distrust your code before you distrust the VM, simply because
thinking it's the VM can blind-side you to potential bugs in your own code or
other parts of the system. The goal here is a reproducible case. If
you get a reproducible case that doesn't use any external code then the bug is
in the VM.</DIV>
<DIV><BR></DIV>
<DIV>HTH</DIV>
<DIV>Eliot</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>HTH,<BR>Rob<BR><BR>FIRST STACK DUMP<BR><BR><A
href="mailto:vawhigso@vawhigs.org" target=_blank>vawhigso@vawhigs.org</A>
[~/public_html/squeakelib/Cog]# kill -USR1 30247<BR><A
href="mailto:vawhigso@vawhigs.org" target=_blank>vawhigso@vawhigs.org</A>
[~/public_html/squeakelib/Cog]#<BR>Received user signal, printing active
stack:<BR><BR>0xff940ab8 I SmalltalkImage>garbageCollect -1207282732: a(n)
SmalltalkImage<BR>0xff940ad0 M Introducer class>areVatsRunning -1144872564:
a(n) Introducer class<BR>0xff940ae8 M PluggableButtonMorph>getModelState
-1134952004: a(n) PluggableButtonMorph<BR>0xff940b00 M
PluggableButtonMorph>update: -1134952004: a(n)
PluggableButtonMorph<BR>0xff940b1c M StepMessage(MessageSend)>value
-1134947088: a(n) StepMessage<BR>0xff940b38 M
StepMessage(MorphicAlarm)>value: -1134947088: a(n)
StepMessage<BR>0xff940b64 M WorldState>runLocalStepMethodsIn: -1215450852:
a(n) WorldState<BR>0xff940b90 M WorldState>runStepMethodsIn: -1215450852:
a(n) WorldState<BR>0xff940bac M PasteUpMorph>runStepMethods -1215450600:
a(n) PasteUpMorph<BR>0xff940bc8 M WorldState>doOneCycleNowFor: -1215450852:
a(n) WorldState<BR>0xff940be4 M WorldState>doOneCycleFor: -1215450852: a(n)
WorldState<BR>0xff940c00 M PasteUpMorph>doOneCycle -1215450600: a(n)
PasteUpMorph<BR>0xff940c20 I [] in Project class>spawnNewProcess
-1138060792: a(n) Project class<BR>-1133485544 s [] in<BR>Segmentation
fault<BR><BR><BR><BR>Smalltalk stack dump:<BR>0xff940ab8 I
SmalltalkImage>garbageCollect -1207282732: a(n)
SmalltalkImage<BR>0xff940ad0 M Introducer class>areVatsRunning -1144872564:
a(n) Introducer class<BR>0xff940ae8 M PluggableButtonMorph>getModelState
-1134952004: a(n) PluggableButtonMorph<BR>0xff940b00 M
PluggableButtonMorph>update: -1134952004: a(n)
PluggableButtonMorph<BR>0xff940b1c M StepMessage(MessageSend)>value
-1134947088: a(n) StepMessage<BR>0xff940b38 M
StepMessage(MorphicAlarm)>value: -1134947088: a(n)
StepMessage<BR>0xff940b64 M WorldState>runLocalStepMethodsIn: -1215450852:
a(n) WorldState<BR>0xff940b90 M WorldState>runStepMethodsIn: -1215450852:
a(n) WorldState<BR>0xff940bac M PasteUpMorph>runStepMethods -1215450600:
a(n) PasteUpMorph<BR>0xff940bc8 M WorldState>doOneCycleNowFor: -1215450852:
a(n) WorldState<BR>0xff940be4 M WorldState>doOneCycleFor: -1215450852: a(n)
WorldState<BR>0xff940c00 M PasteUpMorph>doOneCycle -1215450600: a(n)
PasteUpMorph<BR>0xff940c20 I [] in Project class>spawnNewProcess
-1138060792: a(n) Project class<BR><BR><BR>SECOND STACK DUMP<BR><BR><A
href="mailto:vawhigso@vawhigs.org" target=_blank>vawhigso@vawhigs.org</A>
[~/public_html/squeakelib/Cog]# kill -USR1 7340<BR><BR>Received user signal,
printing active stack:<BR><BR><A href="mailto:vawhigso@vawhigs.org"
target=_blank>vawhigso@vawhigs.org</A> [~/public_html/squeakelib/Cog]#
0xffaf3398 I SmalltalkImage>garbageCollect -1207897132: a(n)
SmalltalkImage<BR>0xffaf33b0 M Introducer class>areVatsRunning -1145486964:
a(n) Introducer class<BR>0xffaf33c8 M PluggableButtonMorph>getModelState
-1135564980: a(n) PluggableButtonMorph<BR>0xffaf33e0 M
PluggableButtonMorph>update: -1135564980: a(n)
PluggableButtonMorph<BR>0xffaf33fc M StepMessage(MessageSend)>value
-1135561416: a(n) StepMessage<BR>0xffaf3418 M
StepMessage(MorphicAlarm)>value: -1135561416: a(n)
StepMessage<BR>0xffaf3444 M WorldState>runLocalStepMethodsIn: -1216065252:
a(n) WorldState<BR>0xffaf3470 M WorldState>runStepMethodsIn: -1216065252:
a(n) WorldState<BR>0xffaf348c M PasteUpMorph>runStepMethods -1216065000:
a(n) PasteUpMorph<BR>0xffaf34a8 M WorldState>doOneCycleNowFor: -1216065252:
a(n) WorldState<BR>0xffaf34c4 M WorldState>doOneCycleFor: -1216065252: a(n)
WorldState<BR>0xffaf34e0 M PasteUpMorph>doOneCycle -1216065000: a(n)
PasteUpMorph<BR>0xffaf3500 I [] in Project class>spawnNewProcess
-1138675192: a(n) Project class<BR>-1134099944 s [] in
BlockClosure>newProcess<BR><BR>Received user signal, printing all
processes:<BR><BR>Process 0xbc670278 priority 40<BR>0xffaf3398 I
SmalltalkImage>garbageCollect -1207897132: a(n)
SmalltalkImage<BR>0xffaf33b0 M Introducer class>areVatsRunning -1145486964:
a(n) Introducer class<BR>0xffaf33c8 M PluggableButtonMorph>getModelState
-1135564980: a(n) PluggableButtonMorph<BR>0xffaf33e0 M
PluggableButtonMorph>update: -1135564980: a(n)
PluggableButtonMorph<BR>0xffaf33fc M StepMessage(MessageSend)>value
-1135561416: a(n) StepMessage<BR>0xffaf3418 M
StepMessage(MorphicAlarm)>value: -1135561416: a(n)
StepMessage<BR>0xffaf3444 M WorldState>runLocalStepMethodsIn: -1216065252:
a(n) WorldState<BR>0xffaf3470 M WorldState>runStepMethodsIn: -1216065252:
a(n) WorldState<BR>0xffaf348c M PasteUpMorph>runStepMethods -1216065000:
a(n) PasteUpMorph<BR>0xffaf34a8 M WorldState>doOneCycleNowFor: -1216065252:
a(n) WorldState<BR>0xffaf34c4 M WorldState>doOneCycleFor: -1216065252: a(n)
WorldState<BR>0xffaf34e0 M PasteUpMorph>doOneCycle -1216065000: a(n)
PasteUpMorph<BR>0xffaf3500 I [] in Project class>spawnNewProcess
-1138675192: a(n) Project class<BR>-1134099944 s [] in
BlockClosure>newProcess<BR><BR>Process 0xbc97fc44 priority 50<BR>0xffafa4c0
M WeakArray class>finalizationProcess -1210174624: a(n) WeakArray
class<BR>0xffafa4e0 I [] in WeakArray class>restartFinalizationProcess
-1210174624: a(n) WeakArray class<BR>0xffafa500 I [] in
BlockClosure>newProcess -1130890396: a(n) BlockClosure<BR><BR>Process
0xb8125518 priority 80<BR>widowed caller frame<BR><BR>EventualProcess
0xbbbd6e10 priority 60<BR>-1134095516 s [] in Delay>wait<BR>-1134049404 s
BlockClosure>ifCurtailed:<BR>-1134095648 s Delay>wait<BR>-1134049312 s
[] in VatTPManager class>finalizationLoop<BR>-1145210696 s
BlockClosure>repeat<BR>-1145213336 s VatTPManager
class>finalizationLoop<BR>-1145213520 s [] in VatTPManager
class>?<BR><BR>EventualProcess 0xbc5c9174 priority 30<BR>-1134783048 s
SharedQueue>next<BR>-1134783140 s [] in Vat>processSends<BR>-1134751716
s BlockClosure>ifCurtailed:<BR>-1134783276 s
Vat>processSends<BR>-1134783984 s [] in
EventualProcess>setupContext<BR><BR>Process 0xbc86c01c priority
60<BR>0xffaf44c0 I RFBEventSensor(InputSensor)>userInterruptWatcher
-1130865472: a(n) RFBEventSensor<BR>0xffaf44e0 I [] in
RFBEventSensor(InputSensor)>installInterruptWatcher -1130865472: a(n)
RFBEventSensor<BR>0xffaf4500 I [] in BlockClosure>newProcess -1132019908:
a(n) BlockClosure<BR><BR>Process 0xbc86c1dc priority 60<BR>widowed caller
frame
8TŊĸ"Ļr·Zžð·ð·Zžð·ļ§r·TTŊĸōr·ĻZžZžÂž4Zžir·tTŊĸT·ÂžüYžÂžĀ\žð··TŊĸĶ·sZžðZžð·8·s·ĀTŊĸ(õq·$ZžĪ*îZžüYžÂžĀ\ž
]đ·<BR><BR>Process 0xbc86c3c8 priority 60<BR>0xffaf74c0 I
SmalltalkImage>lowSpaceWatcher -1207897132: a(n)
SmalltalkImage<BR>0xffaf74e0 I [] in SmalltalkImage>installLowSpaceWatcher
-1207897132: a(n) SmalltalkImage<BR>0xffaf7500 I [] in
BlockClosure>newProcess -1132018968: a(n) BlockClosure<BR><BR>Process
0xbc985ef0 priority 60<BR>widowed caller frame HÓŊĸúq·Ā\žð·ð·Ā\žð·
úq·lÓŊĸ(õq·Ô\žĀ\žD\žļ·<BR><BR>Segmentation fault<BR><BR><BR>Can't dump
Smalltalk stack. Not in VM thread<BR><BR>Most recent
primitives<BR>wait<BR>signal<BR>millisecondClockValue<BR>wait<BR>signal<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>perform:with:<BR>basicNew:<BR>basicNew<BR>value:<BR>millisecondClockValue<BR>basicNew<BR>basicNew<BR>new:<BR>at:put:<BR>at:put:<BR>at:put:<BR>basicNew<BR>basicNew<BR>basicNew<BR>basicNew:<BR>at:put:<BR>replaceFrom:to:with:startingAt:<BR>replaceFrom:to:with:startingAt:<BR>basicNew:<BR>at:put:<BR>replaceFrom:to:with:startingAt:<BR>replaceFrom:to:with:startingAt:<BR>species<BR>basicNew:<BR>replaceFrom:to:with:startingAt:<BR>compare:with:collated:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>perform:withArguments:<BR>perform:<BR>species<BR>basicNew:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>species<BR>basicNew:<BR>basicReplaceFrom:to:with:startingAt:<BR>species<BR>basicNew:<BR>basicAt:put:<BR>basicAt:put:<BR>species<BR>basicNew:<BR>basicReplaceFrom:to:with:startingAt:<BR>species<BR>basicNew:<BR>basicAt:put:<BR>species<BR>basicNew:<BR>basicReplaceFrom:to:with:startingAt:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>primitiveGarbageCollect<BR>millisecondClockValue<BR>signal<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>suspend<BR>primitiveResume<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>suspend<BR>primitiveResume<BR>at:put:<BR>at:put:<BR>primSignal:atMilliseconds:<BR>millisecondClockValue<BR>wait<BR>millisecondClockValue<BR>millisecondClockValue<BR>wait<BR>signal<BR>at:put:<BR>at:put:<BR>millisecondClockValue<BR>primSignal:atMilliseconds:<BR>millisecondClockValue<BR>wait<BR>value<BR>wait<BR>signal<BR>wait<BR>value<BR>signal<BR>millisecondClockValue<BR>primSignal:atMilliseconds:<BR>millisecondClockValue<BR>wait<BR>signal<BR>primSocketConnectionStatus:<BR>millisecondClockValue<BR>basicNew:<BR>byteAt:put:<BR>byteAt:put:<BR>species<BR>basicNew:<BR>replaceFrom:to:with:startingAt:<BR>replaceFrom:to:with:startingAt:<BR>species<BR>basicNew:<BR>replaceFrom:to:with:startingAt:<BR>replaceFrom:to:with:startingAt:<BR>basicNew<BR>findNextHandlerContextStarting<BR>tempAt:<BR>tempAt:<BR>tempAt:put:<BR>valueNoContextSwitch<BR>tempAt:<BR>valueWithArguments:<BR>findNextUnwindContextUpTo:<BR>tempAt:<BR>tempAt:put:<BR>tempAt:<BR>terminateTo:<BR>value<BR>tempAt:put:<BR>findNextUnwindContextUpTo:<BR>terminateTo:<BR>primSocketConnectionStatus:<BR>value<BR>value<BR>millisecondClockValue<BR>primSocketConnectionStatus:<BR>millisecondClockValue<BR>millisecondClockValue<BR>basicNew<BR>valueNoContextSwitch<BR>millisecondClockValue<BR>wait<BR>signal<BR>at:put:<BR>at:put:<BR>at:put:<BR>millisecondClockValue<BR>primSignal:atMilliseconds:<BR>millisecondClockValue<BR>wait<BR>signal<BR>wait<BR>basicNew<BR>new:<BR>someInstance<BR>nextInstance<BR>at:put:<BR>species<BR>new:<BR>replaceFrom:to:with:startingAt:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>at:put:<BR>perform:withArguments:<BR>perform:<BR>species<BR>basicNew:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>basicAt:put:<BR>species<BR>basicNew:<BR>basicReplaceFrom:to:with:startingAt:<BR>species<BR>basicNew:<BR>basicAt:put:<BR>basicAt:put:<BR>species<BR>basicNew:<BR>basicReplaceFrom:to:with:startingAt:<BR>species<BR>basicNew:<BR>basicAt:put:<BR>species<BR>basicNew:<BR>basicReplaceFrom:to:with:startingAt:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>new:<BR>basicNew<BR>at:put:<BR>at:put:<BR>at:put:<BR>primitiveGarbageCollect<BR><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>