Why this hangs the VM?

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

Why this hangs the VM?

hernanmd
Behavior basicNew basicNew.
Class basicNew basicNew.

No .log is generated
Applies to Pharo4 #40460 and Pharo 3.0 (Windows 8.1)

Cheers,

Hernán

Reply | Threaded
Open this post in threaded view
|

Re: Why this hangs the VM?

Marcus Denker-4

> On 25 Jan 2015, at 01:16, Hernán Morales Durand <[hidden email]> wrote:
>
> Behavior basicNew basicNew.
> Class basicNew basicNew.
>
> No .log is generated
> Applies to Pharo4 #40460 and Pharo 3.0 (Windows 8.1)
>
here it does not crash, but:

Behavior basicNew basicNew class

===> LargeNegativeInteger

We do have a test for “Behavior new new”:

testBehaviornewnewShouldNotCrash

 and this works fine.


        Marcus




Reply | Threaded
Open this post in threaded view
|

Re: Why this hangs the VM?

Ben Coman
In reply to this post by hernanmd


On Sun, Jan 25, 2015 at 8:16 AM, Hernán Morales Durand <[hidden email]> wrote:
Behavior basicNew basicNew.

I guess philosophically, #basicNew creates an incomplete object, so sending it messages is in the hands of the gods. Now the following works okay... 
    Behavior new basicNew

So something in its #initialize makes it not crash.  Rolling out Behanior>>initialize and commenting out a line at a time to get the minimum statements to prevent crashing results in the following...  

    behavior := Behavior basicNew.

    "behavior superclass: Object."
    "behavior methodDict: behavior emptyMethodDictionary."

    behavior setFormat: Object format.

    "behavior traitComposition: nil."
    "behavior users: IdentitySet new."

    behavior basicNew.

So the VM will crash if you fail to #setFormat.  That is as far as mu understanding goes. 
cheers -ben
 
Class basicNew basicNew.

No .log is generated
Applies to Pharo4 #40460 and Pharo 3.0 (Windows 8.1)

Cheers,

Hernán


Reply | Threaded
Open this post in threaded view
|

Re: Why this hangs the VM?

hernanmd
Yes, apparently one has to debug the primitive to get what's really happening.
Thanks Ben,

Hernán

2015-01-25 13:08 GMT-03:00 Ben Coman <[hidden email]>:


On Sun, Jan 25, 2015 at 8:16 AM, Hernán Morales Durand <[hidden email]> wrote:
Behavior basicNew basicNew.

I guess philosophically, #basicNew creates an incomplete object, so sending it messages is in the hands of the gods. Now the following works okay... 
    Behavior new basicNew

So something in its #initialize makes it not crash.  Rolling out Behanior>>initialize and commenting out a line at a time to get the minimum statements to prevent crashing results in the following...  

    behavior := Behavior basicNew.

    "behavior superclass: Object."
    "behavior methodDict: behavior emptyMethodDictionary."

    behavior setFormat: Object format.

    "behavior traitComposition: nil."
    "behavior users: IdentitySet new."

    behavior basicNew.

So the VM will crash if you fail to #setFormat.  That is as far as mu understanding goes. 
cheers -ben
 
Class basicNew basicNew.

No .log is generated
Applies to Pharo4 #40460 and Pharo 3.0 (Windows 8.1)

Cheers,

Hernán



Reply | Threaded
Open this post in threaded view
|

Re: Why this hangs the VM?

Eliot Miranda-2
In reply to this post by hernanmd


On Sat, Jan 24, 2015 at 4:16 PM, Hernán Morales Durand <[hidden email]> wrote:
Behavior basicNew basicNew.
Class basicNew basicNew.

Fixed in the Spur VM.
 
No .log is generated
Applies to Pharo4 #40460 and Pharo 3.0 (Windows 8.1)

Cheers,

Hernán
--
best,
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: Why this hangs the VM?

hernanmd
Thank you!

Hernán

2015-01-26 15:30 GMT-03:00 Eliot Miranda <[hidden email]>:
 


On Sat, Jan 24, 2015 at 4:16 PM, Hernán Morales Durand <[hidden email]> wrote:
Behavior basicNew basicNew.
Class basicNew basicNew.

Fixed in the Spur VM.
 
No .log is generated
Applies to Pharo4 #40460 and Pharo 3.0 (Windows 8.1)

Cheers,

Hernán
--
best,
Eliot


Reply | Threaded
Open this post in threaded view
|

Re: Why this hangs the VM?

ccrraaiigg
In reply to this post by Eliot Miranda-2

> Fixed in the Spur VM.

     What was the problem? (I have no time to look at it.)


     thanks,

-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

Re: Why this hangs the VM?

Eliot Miranda-2
If one can create a behavior that doesn't inherit anything (superclass nil) and doesn't have a method dictionary then there will be an infinite recursion in the class faulting code (the code that uses image segments to external use methods).  Every attempt to interact with the nil behaviour results in more of the same.

Eliot (phone)

On Jan 27, 2015, at 2:13 AM, Craig Latta <[hidden email]> wrote:

>
>> Fixed in the Spur VM.
>
>     What was the problem? (I have no time to look at it.)
>
>
>     thanks,
>
> -C
>
> --
> Craig Latta
> netjam.org
> +31   6 2757 7177 (SMS ok)
> + 1 415  287 3547 (no SMS)
>
>