[COG] Random crash with markAndTrace

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[COG] Random crash with markAndTrace

Mariano Martinez Peck
 
Hi folks. I have a crash in Cog, and I am not sure if it is "my fault" or not. Basically, it crashes while during the markAndTrace of an incrementalGC.

In my case, it always fails in the method #startObj , here:

startObj
    "Start tracing the object 'child' and answer the next action.
     The object may be anywhere in the middle of being swept
     itself. See comment in markAndTrace for explanation of
     tracer state variables, and aComment for gory details."
    | header lastFieldOffset |
    <inline: true>
    statMarkCountLocal := statMarkCountLocal + 1.
    ((self oop: child isLessThan: youngStartLocal) "old object; skip it"
     or: [((header := self longAt: child) bitAnd: MarkBit) ~= 0]) "already marked; skip it"

when it does the if..

In C is:

if (((((usqInt) child)) < (((usqInt) youngStartLocal)))
             || ((((header1 = longAt(child))) & MarkBit) != 0)) {

child is 1887948912
youngStartLocal is 466502688

I attach a screenshot with the XCode GDB.

Thanks for any help in advance

Mariano

Screen shot 2010-12-14 at 12.09.49 PM.png (225K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [COG] Random crash with markAndTrace

Mariano Martinez Peck
 
Something important I forget to say....notice in the stacktrace that this GC was dispatched by a handleStackOverflowOrEventAllowContextSwitch

Sometimes....when running my tests, it even fails in handleStackOverflowOrEventAllowContextSwitch
Look for example, the attached screenshot.

So....I guess there is something more general than the GC...something related to the memory allocation.
Maybe this is related to the errors I see when running cog:

mprotect(x,y,PROT_READ | PROT_WRITE): Cannot allocate memory
mprotect(x,y,PROT_READ | PROT_WRITE): Invalid argument
squeak: could not load plugin `MiscPrimitivePlugin'
squeak: could not load plugin `DropPlugin'
squeak: could not load plugin `FilePlugin'
squeak: could not load plugin `SecurityPlugin'
squeak: could not load plugin `MacMenubarPlugin'
squeak: could not load plugin `LargeIntegers'
squeak: could not load plugin `BitBltPlugin'
squeak: could not load plugin `B2DPlugin'
squeak: could not load plugin `InternetConfigPlugin'
squeak: could not load plugin `LocalePlugin'


thanks

mariano

On Tue, Dec 14, 2010 at 12:10 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi folks. I have a crash in Cog, and I am not sure if it is "my fault" or not. Basically, it crashes while during the markAndTrace of an incrementalGC.

In my case, it always fails in the method #startObj , here:

startObj
    "Start tracing the object 'child' and answer the next action.
     The object may be anywhere in the middle of being swept
     itself. See comment in markAndTrace for explanation of
     tracer state variables, and aComment for gory details."
    | header lastFieldOffset |
    <inline: true>
    statMarkCountLocal := statMarkCountLocal + 1.
    ((self oop: child isLessThan: youngStartLocal) "old object; skip it"
     or: [((header := self longAt: child) bitAnd: MarkBit) ~= 0]) "already marked; skip it"

when it does the if..

In C is:

if (((((usqInt) child)) < (((usqInt) youngStartLocal)))
             || ((((header1 = longAt(child))) & MarkBit) != 0)) {

child is 1887948912
youngStartLocal is 466502688

I attach a screenshot with the XCode GDB.

Thanks for any help in advance

Mariano


Screen shot 2010-12-14 at 12.15.44 PM.png (286K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [COG] Random crash with markAndTrace

Eliot Miranda-2
In reply to this post by Mariano Martinez Peck
 
Hi Mariano,

On Tue, Dec 14, 2010 at 3:10 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi folks. I have a crash in Cog, and I am not sure if it is "my fault" or not. Basically, it crashes while during the markAndTrace of an incrementalGC.

The approach to take in cases like these is to try and construct a reproducible test case, ideally one that doesn't require user operations like selecting text and clicking mouse buttons, but one that can be run from the command line.  I like to try and write them as doits that save an image and then evaluate an expression.  e.g.

    Smalltalk saveAs.
    1/0 

constructs an image that will reliably raise the divide-by-zero exception.  So try and narrow down what causes the crash and then construct some doits.  Once the doits seem to be reliably crashing teh system then try the Smalltalk saveAs.  self doSomethingEvil approach.

Once you have a reproducible case the process of apportioning blame can commence ;)  

HTH
Eliot


In my case, it always fails in the method #startObj , here:

startObj
    "Start tracing the object 'child' and answer the next action.
     The object may be anywhere in the middle of being swept
     itself. See comment in markAndTrace for explanation of
     tracer state variables, and aComment for gory details."
    | header lastFieldOffset |
    <inline: true>
    statMarkCountLocal := statMarkCountLocal + 1.
    ((self oop: child isLessThan: youngStartLocal) "old object; skip it"
     or: [((header := self longAt: child) bitAnd: MarkBit) ~= 0]) "already marked; skip it"

when it does the if..

In C is:

if (((((usqInt) child)) < (((usqInt) youngStartLocal)))
             || ((((header1 = longAt(child))) & MarkBit) != 0)) {

child is 1887948912
youngStartLocal is 466502688

I attach a screenshot with the XCode GDB.

Thanks for any help in advance

Mariano


Reply | Threaded
Open this post in threaded view
|

Re: [COG] Random crash with markAndTrace

Ken G. Brown
 
I think you may even be able to use the iMac as your second monitor, I seem to have a tickle about that in the back of my mind. 

Ken,
from my iPhone

On 2010-12-14, at 10:28, Eliot Miranda <[hidden email]> wrote:

Hi Mariano,

On Tue, Dec 14, 2010 at 3:10 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi folks. I have a crash in Cog, and I am not sure if it is "my fault" or not. Basically, it crashes while during the markAndTrace of an incrementalGC.

The approach to take in cases like these is to try and construct a reproducible test case, ideally one that doesn't require user operations like selecting text and clicking mouse buttons, but one that can be run from the command line.  I like to try and write them as doits that save an image and then evaluate an expression.  e.g.

    Smalltalk saveAs.
    1/0 

constructs an image that will reliably raise the divide-by-zero exception.  So try and narrow down what causes the crash and then construct some doits.  Once the doits seem to be reliably crashing teh system then try the Smalltalk saveAs.  self doSomethingEvil approach.

Once you have a reproducible case the process of apportioning blame can commence ;)  

HTH
Eliot


In my case, it always fails in the method #startObj , here:

startObj
    "Start tracing the object 'child' and answer the next action.
     The object may be anywhere in the middle of being swept
     itself. See comment in markAndTrace for explanation of
     tracer state variables, and aComment for gory details."
    | header lastFieldOffset |
    <inline: true>
    statMarkCountLocal := statMarkCountLocal + 1.
    ((self oop: child isLessThan: youngStartLocal) "old object; skip it"
     or: [((header := self longAt: child) bitAnd: MarkBit) ~= 0]) "already marked; skip it"

when it does the if..

In C is:

if (((((usqInt) child)) < (((usqInt) youngStartLocal)))
             || ((((header1 = longAt(child))) & MarkBit) != 0)) {

child is 1887948912
youngStartLocal is 466502688

I attach a screenshot with the XCode GDB.

Thanks for any help in advance

Mariano


Reply | Threaded
Open this post in threaded view
|

Re: [COG] Random crash with markAndTrace

Ken G. Brown
 
Excuse the noise please, sent by mistake. 
Daughter got a new MacBook Pro. 

Ken,
from my iPhone

On 2010-12-14, at 13:21, "Ken G. Brown" <[hidden email]> wrote:

I think you may even be able to use the iMac as your second monitor, I seem to have a tickle about that in the back of my mind. 

Ken,
from my iPhone

On 2010-12-14, at 10:28, Eliot Miranda <[hidden email]> wrote:

Hi Mariano,

On Tue, Dec 14, 2010 at 3:10 AM, Mariano Martinez Peck <[hidden email][hidden email]> wrote:
 
Hi folks. I have a crash in Cog, and I am not sure if it is "my fault" or not. Basically, it crashes while during the markAndTrace of an incrementalGC.

The approach to take in cases like these is to try and construct a reproducible test case, ideally one that doesn't require user operations like selecting text and clicking mouse buttons, but one that can be run from the command line.  I like to try and write them as doits that save an image and then evaluate an expression.  e.g.

    Smalltalk saveAs.
    1/0 

constructs an image that will reliably raise the divide-by-zero exception.  So try and narrow down what causes the crash and then construct some doits.  Once the doits seem to be reliably crashing teh system then try the Smalltalk saveAs.  self doSomethingEvil approach.

Once you have a reproducible case the process of apportioning blame can commence ;)  

HTH
Eliot


In my case, it always fails in the method #startObj , here:

startObj
    "Start tracing the object 'child' and answer the next action.
     The object may be anywhere in the middle of being swept
     itself. See comment in markAndTrace for explanation of
     tracer state variables, and aComment for gory details."
    | header lastFieldOffset |
    <inline: true>
    statMarkCountLocal := statMarkCountLocal + 1.
    ((self oop: child isLessThan: youngStartLocal) "old object; skip it"
     or: [((header := self longAt: child) bitAnd: MarkBit) ~= 0]) "already marked; skip it"

when it does the if..

In C is:

if (((((usqInt) child)) < (((usqInt) youngStartLocal)))
             || ((((header1 = longAt(child))) & MarkBit) != 0)) {

child is 1887948912
youngStartLocal is 466502688

I attach a screenshot with the XCode GDB.

Thanks for any help in advance

Mariano