Got "Error: basicNew: failed" when running InterpreterSimulator

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

Got "Error: basicNew: failed" when running InterpreterSimulator

Nick.
Hi guys!

In the past few days i tried to get InterpreterSimulator running without success.
First of all, a little context about my goal: I'm digging into the VM because i would like to be able to delegate to some class (that I'll develop) the responsibility for, say, the method lookup algorithm.

With that in mind, here's what i've been doing:
Using the Pharo 1.2 image Mariano Peck's prepared in his exellent article (http://marianopeck.wordpress.com/2011/04/23/how-to-debug-the-vm/),  loaded the VMMaker package with the following script:

    Deprecation raiseWarning: false.
        Gofer new
        squeaksource: 'MetacelloRepository';
        package: 'ConfigurationOfCog';
        load.
    (Smalltalk at: #ConfigurationOfCog) project latestVersion load.

Once it finishes (without errors) I "Save As" the current image as "demo.image", close it and open the original Pharo 1.2 image that Mariano provided.
When, for example, I run:

    (CogVMSimulator new openOn: 'demo.image') test
or
    (InterpreterSimulatorLSB new openOn: 'demo.image') test

I get the following error: "Error: basicNew: failed" (see attached images at the end).
When I tried to load VMMaker in the Pharo 1.3 OneClick release, I got another error (see attached images at the end).

Am I doing something wrong?
Are those the right simulators to use? I can tell the difference between all that are available in VMMaker package.

Thanks in advance!

Nick


Error while trying to run InterpreterSimulator
Error while loading VMMaker in Pharo-1.3-OneClick

Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Mariano Martinez Peck


On Fri, Sep 23, 2011 at 6:40 AM, Nick. <[hidden email]> wrote:
Hi guys!

In the past few days i tried to get InterpreterSimulator running without
success.
First of all, a little context about my goal: I'm digging into the VM
because i would like to be able to delegate to some class (that I'll
develop) the responsibility for, say, the method lookup algorithm.

With that in mind, here's what i've been doing:
Using the Pharo 1.2 image Mariano Peck's prepared in his exellent article
(http://marianopeck.wordpress.com/2011/04/23/how-to-debug-the-vm/),  loaded
the VMMaker package with the following script:

   Deprecation raiseWarning: false.
       Gofer new
       squeaksource: 'MetacelloRepository';
       package: 'ConfigurationOfCog';
       load.
   (Smalltalk at: #ConfigurationOfCog) project latestVersion load.

Once it finishes (without errors) I "Save As" the current image as
"demo.image", close it and open the original Pharo 1.2 image that Mariano
provided.
When, for example, I run:

   (CogVMSimulator new openOn: 'demo.image') test
or
   (InterpreterSimulatorLSB new openOn: 'demo.image') test

I get the following error: "Error: basicNew: failed" (see attached images at
the end).

Weird.  Something I remember about the simulator is that you need to run it with a VM that has the BochsIA32Plugin. Try Eliot's VM that will have it for sure. But anywya, I doesn't look related to your particula problem. 

 
When I tried to load VMMaker in the Pharo 1.3 OneClick release, I got
another error (see attached images at the end).


Yes, because you need some changes in order to make it work. I have attached those changes in the post. But those changes should be already integrated in latests Pharo 1.3.
You don't have that error in the image I put of 1.2 because that image comes already with such changes.
 
Am I doing something wrong?
Are those the right simulators to use? I can tell the difference between all
that are available in VMMaker package.


Well...it depends on what you want. FOr example, if you build a stack VM then you should use instead StackInterpreterSimulator. So..for the Cog VM I guess it is CogVMSimulator.

If you go to here: http://www.squeakvm.org/svn/squeak/branches/Cog/image/
you can see http://www.squeakvm.org/svn/squeak/branches/Cog/image/VM%20Simulation%20Workspace.text
It might be outdated, but it can be a start point.

cheers
 
Thanks in advance!

Nick


http://forum.world.st/file/n3835723/error_while_trying_to_run_InterpreterSimulator.png
http://forum.world.st/file/n3835723/Error_while_loading_VMMaker_in_Pharo-1.3-OneClick.png



--
View this message in context: http://forum.world.st/Got-Error-basicNew-failed-when-running-InterpreterSimulator-tp3835723p3835723.html
Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.
_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners



--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Nick.
Hi Mariano!

Thanks for the directions you gave me. I',m definitely giving them a try and let you know.

About my approach to reifying the method lookup algorithm: do you think that simulating a VM will work as a development strategy, or i will need to compile the whole VM?

My idea was to modify the Interpreter class and just simulate the modified VM to do some tests.

What do you think?

Cheers! (from Argentina :))
Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Mariano Martinez Peck


On Fri, Sep 23, 2011 at 5:53 PM, Nick. <[hidden email]> wrote:
Hi Mariano!

Thanks for the directions you gave me. I',m definitely giving them a try and
let you know.


:)
 
About my approach to reifying the method lookup algorithm: do you think that
simulating a VM will work as a development strategy, or i will need to
compile the whole VM?

From my own experience, it was always easier to compile the VM than using the simulator. But maybe you have luck with the simulator.
 

My idea was to modify the Interpreter class and just simulate the modified
VM to do some tests.

Yes, it make sense. You can start with the simulator and once it seems to work you move to the real VM. But don't get stuck. If you cannot make it work (the simulator) try directly with the real VM.
 

What do you think?

Cheers! (from Argentina :))

--
View this message in context: http://forum.world.st/Got-Error-basicNew-failed-when-running-InterpreterSimulator-tp3835723p3837252.html
Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.
_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners



--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Nick.
Hi Guys,

Im attaching the PharoDebug.log (PharoDebug.log.tar.gz) that was generated when the error came up.

Those are the steps I used to reproduce the problem. The environment used is Ubuntu 11.04:
  - From Jetkins, I downloaded the sources and vm for the "StackVM-Unix" job: https://ci.lille.inria.fr/pharo/view/Cog/job/StackVM-Unix/6/
  - Unzipped the files and loaded [sources dir]/build/generator.image with StackVM.
  - Finally, evaluated (StackInterpreterSimulator new openOn: Smalltalk imageName) test

Also, I tried evaluating the same but running the image from a compiled stack vm (from StackUnixDebugConfig). In this case, the error that came up was different: a MNU on ByteStrinng >> asDisplayText.
The log, named CompiledVM-PharoDebug.log is also attached: CompiledVM-PharoDebug-.log.tar.gz

I'd appreciate any directions on how resolve this one :)

Cheers!
Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Mariano Martinez Peck
Hi Nick. Unfortunatly, few people use the interpreter. Even less (if none) do it in Pharo. The only ones I know that use the simulator right now is Eliot in Squeak and Graig in Spoon.
So...as you can see, the simulator is implemented in image side. Since Eliot uses Squeak for his development, is more likely the simulator will work easier in Squeak than Pharo. Of course that for the Pharo community it would be AWESOME to be able to run the simulator. So if you can help with that, excellent.
As an example, in Pharo you have the error. But in Squeak you have:

String asDisplayText
    "Answer a DisplayText whose text string is the receiver."

    ^DisplayText text: self asText 

:)

So... my suggestion? start with squeak. Once you make it work, please, update it in order to make it work in Pharo :)

In your case, I would try with 3 squeak images: 4.2, 4.3 and the one eliot uses in: http://www.squeakvm.org/svn/squeak/branches/Cog/image/  (VMMaker-Squeak4.1.image)

cheers


On Mon, Oct 3, 2011 at 4:32 AM, Nick. <[hidden email]> wrote:
Hi Guys,

Im attaching the PharoDebug.log (
http://forum.world.st/file/n3866329/PharoDebug.log.tar.gz
PharoDebug.log.tar.gz ) that was generated when the error came up.

Those are the steps I used to reproduce the problem. The environment used is
Ubuntu 11.04:
 - From Jetkins, I downloaded the sources and vm for the "StackVM-Unix"
job: https://ci.lille.inria.fr/pharo/view/Cog/job/StackVM-Unix/6/
 - Unzipped the files and loaded [sources dir]/build/generator.image with
StackVM.
 - Finally, evaluated (StackInterpreterSimulator new openOn: Smalltalk
imageName) test

Also, I tried evaluating the same but running the image from a compiled
stack vm (from StackUnixDebugConfig). In this case, the error that came up
was different: a MNU on ByteStrinng >> asDisplayText.
The log, named CompiledVM-PharoDebug.log is also attached:
http://forum.world.st/file/n3866329/CompiledVM-PharoDebug-.log.tar.gz
CompiledVM-PharoDebug-.log.tar.gz


I'd appreciate any directions on how resolve this one :)

Cheers!


--
View this message in context: http://forum.world.st/Got-Error-basicNew-failed-when-running-InterpreterSimulator-tp3835723p3866329.html
Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.
_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners



--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Nick.
Hi Mariano,

Thanks for the advice.
I want to update this post with the results of some tests I've been doing, so it's useful to anyone trying to run the simulator.

I got stuck with an error I describe in the "About running StackInterpreterSimulator in Pharo" section.
Hope someone could give me a clue on fixing that one :)

Simulator in Squeak 2.6/2.7 is working
First of all, if all you need is a simulator for learning/experimenting purposes grab a Squeak 2.6 or 2.7 release (yes, that old). The simulator works right out of the box in those ones. See http://wiki.squeak.org/squeak/2465 for  instructions on how to archieve that.

About running StackInterpreterSimulator in Pharo
Taking Mariano's image as base (grab it here: https://gforge.inria.fr/frs/download.php/28513/Pharo-1.2.1.cog.zip) I found the following issues and fixed them:

To begin, I saved a copy of the image to a new file named "simulated.image". Closed the image and reopened the first one.

1) First problem: "Error: basicNew: failed"
Then, I evaluated the following from the original: (StackInterpreterSimulator new openOn: 'source.image') test.
The error I've got is the one I described in my first post: "Error: basicNew: failled" for "ArrayClass>>new".
Inspecting the stack trace I found that RootTableSize was an instance of UndefinedObject in ObjectMemory>>initialize.
Taking a deeper look, it seemed that RootTableSize was setted in ObjectMemory>>initializeWithOptions, wich wasn't called from StackInterpreterSimulator>>initialize. Instead, ObjectMemory>>initialize was called, but that message didn't initialize RootTableSize.
So, I replaced the call form objectMemoryClass initialize to objectMemoryClass initializeWithOptions: Dictionary new. to get RootTableSize initialized properly.

2) Second problem: same situation with MethodCacheSize
Proceeding with StackInterpreterSimulator's execution, I came across a similar situation with MethodCacheSize in ArrayClass>>basicNew:.
Following the same procedure as before, I found MethodCacheSize uninitialized, and setted it property replacing, in StackInterpreterSimulator>>initialize, the call from StackInterpreter initialize. to StackInterpreter initializeWithOptions: Dictionary new.

3) Third problem: missing method from UtilityClass
Proceeding again, I came across an MNU saying that UtilityClass does not understands "informUser:during:" message. After a message selector search, I replaced the call (that was being done in StackInterpreterSimulator>>openOn:extraMemory:) with UIManager default informUser: (...) during: (...)

4) Fourth problem: "the receiver of / is nil"
Originated from InterpreterStackPage>>headFP:. The cause was that LargeContextBytes was an instance of UndefinedObject.
Once again, using the Method Finder (great tool!) I fixed the problem evaluating: InterpreterStackPage initialize. as said in that method's comment.

5) Fifth problem: Two MNUs in StackInterpreter
Those came up: isContextNonInt:, generated from commonVariable:at:chacheIndex: and commonVaraible:at:put:cacheIndex:.
I fixed those issues by replacing calls from self isContextNonInt: to self objectMemory isContextNonInt:.

6) Sixth problem: MNU in StackInterpreter
The selector was isContextHeader: and it was used in StackInterpreter>>stObject:at:.
I replaced calls from self isContextHeader: to self objectMemory isContextHeader:.

7) Seventh problem: primitive clone failed in CArrayAccesor.
I fixes that by adding the clone message in CArrayAccessor as follows:
    clone
            <primitive: 148>   
        ^ self primitiveFailed

8) Lastly, restarting the simulation again I found that the desktop from the simulation image was beign rendered (Pharo logo, some Workpaces that were saved, etc.) and then this error came up: "primitive failed: setGCBiasToGrowGCLimit:".
The thing is that the VM that hosts the simulated one didn't open the debugger on that halt, it was like the simulated image was frozen (I suppose, because that error was in the call stack of snapshot:andQuit:embedded:).

And here is when I wanted to ask you for some help guys, as I couldn't debug the host machine to invesitgate the cause and fix the problem.

Do you have any clue/idea to detect the cause/fix this issue?

FileOut of the changes described
ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip

Cheers and thanks in advance!

Nick



Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Mariano Martinez Peck


On Thu, Oct 13, 2011 at 5:26 AM, Nick. <[hidden email]> wrote:
Hi Mariano,

Thanks for the advice.
I want to update this post with the results of some tests I've been doing,
so it's useful to anyone trying to run the simulator.

I got stuck with an error I describe in the "About running
StackInterpreterSimulator in Pharo" section.
Hope someone could give me a clue on fixing that one :)


Wow Nick. Your experience is really really helpful.
 
*Simulator in Squeak 2.6/2.7 is working*
First of all, if all you need is a simulator for learning/experimenting
purposes grab a Squeak 2.6 or 2.7 release (yes, /that/ old). The simulator
works right out of the box in those ones. See
http://wiki.squeak.org/squeak/2465 for  instructions on how to archieve
that.

*About running StackInterpreterSimulator in Pharo*
Taking Mariano's image as base (grab it here:
https://gforge.inria.fr/frs/download.php/28513/Pharo-1.2.1.cog.zip) I found
the following issues and fixed them:

To begin, I saved a copy of the image to a new file named "simulated.image".
Closed the image and reopened the first one.

1) First problem: "Error: basicNew: failed"
Then, I evaluated the following from the original:
(StackInterpreterSimulator new openOn: 'source.image') test.
The error I've got is the one I described in my first post: "Error:
basicNew: failled" for "ArrayClass>>new".
Inspecting the stack trace I found that RootTableSize was an instance of
UndefinedObject in ObjectMemory>>initialize.
Taking a deeper look, it seemed that RootTableSize was setted in
ObjectMemory>>initializeWithOptions, wich wasn't called from
StackInterpreterSimulator>>initialize. Instead, ObjectMemory>>initialize was
called, but that message didn't initialize RootTableSize.
So, I replaced the call form objectMemoryClass initialize to
objectMemoryClass initializeWithOptions: Dictionary new. to get
RootTableSize initialized properly.

2) Second problem: same situation with MethodCacheSize
Proceeding with StackInterpreterSimulator's execution, I came across a
similar situation with MethodCacheSize in ArrayClass>>basicNew:.
Following the same procedure as before, I found MethodCacheSize
uninitialized, and setted it property replacing, in
StackInterpreterSimulator>>initialize, the call from StackInterpreter
initialize. to StackInterpreter initializeWithOptions: Dictionary new.

3) Third problem: missing method from UtilityClass
Proceeding again, I came across an MNU saying that UtilityClass does not
understands "informUser:during:" message. After a message selector search, I
replaced the call (that was being done in
StackInterpreterSimulator>>openOn:extraMemory:) with UIManager default
informUser: (...) during: (...)

4) Fourth problem: "the receiver of / is nil"
Originated from InterpreterStackPage>>headFP:. The cause was that
LargeContextBytes was an instance of UndefinedObject.
Once again, using the Method Finder (great tool!) I fixed the problem
evaluating: InterpreterStackPage initialize. as said in that method's
comment.



Can you put the exact code to initialize all this points of 1) 2) and 4) ?
I mean, can you provide the final script you had to use before being able to do the
(StackInterpreterSimulator new openOn: 'source.image') test.
 
5) Fifth problem: Two MNUs in StackInterpreter
Those came up: isContextNonInt:, generated from
commonVariable:at:chacheIndex: and commonVaraible:at:put:cacheIndex:.
I fixed those issues by replacing calls from self isContextNonInt: to self
objectMemory isContextNonInt:.

6) Sixth problem: MNU in StackInterpreter
The selector was isContextHeader: and it was used in
StackInterpreter>>stObject:at:.
I replaced calls from self isContextHeader: to self objectMemory
isContextHeader:.

for 5) and 6) .. which version of VMMaker are you using?  because maybe this was already fixed in new versions?
 

7) Seventh problem: primitive clone failed in CArrayAccesor.
I fixes that by adding the clone message in CArrayAccessor as follows:
   clone
           <primitive: 148>
       ^ self primitiveFailed

8) Lastly, restarting the simulation again I found that the desktop from the
simulation image was beign rendered (Pharo logo, some Workpaces that were
saved, etc.) and then this error came up: "primitive failed:
setGCBiasToGrowGCLimit:".
The thing is that the VM that hosts the simulated one didn't open the
debugger on that halt, it was like the simulated image was frozen (I
suppose, because that error was in the call stack of
snapshot:andQuit:embedded:).

And here is when I wanted to ask you for some help guys, as I couldn't debug
the host machine to invesitgate the cause and fix the problem.

Do you have any clue/idea to detect the cause/fix this issue?


No, I have no idea :(
but maybe someone does.

 
*FileOut of the changes described*
http://forum.world.st/file/n3900467/ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip
ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip


Excellent!   At the end you can also provide an image (that mine) with those changes + a workspace with all the needed initialize code and the snippet to start the simulator.

Cheers
  
Cheers and thanks in advance!

Nick





--
View this message in context: http://forum.world.st/Got-Error-basicNew-failed-when-running-InterpreterSimulator-tp3835723p3900467.html
Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.
_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners



--
Mariano
http://marianopeck.wordpress.com


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Nick.
Hi Mariano!

Mariano Martinez Peck wrote
On Thu, Oct 13, 2011 at 5:26 AM, Nick. <[hidden email]> wrote:

> Hi Mariano,
>
> Thanks for the advice.
> I want to update this post with the results of some tests I've been doing,
> so it's useful to anyone trying to run the simulator.
>
> I got stuck with an error I describe in the "About running
> StackInterpreterSimulator in Pharo" section.
> Hope someone could give me a clue on fixing that one :)
>
>
Wow Nick. Your experience is really really helpful.


> *Simulator in Squeak 2.6/2.7 is working*
> First of all, if all you need is a simulator for learning/experimenting
> purposes grab a Squeak 2.6 or 2.7 release (yes, /that/ old). The simulator
> works right out of the box in those ones. See
> http://wiki.squeak.org/squeak/2465 for  instructions on how to archieve
> that.
>
> *About running StackInterpreterSimulator in Pharo*
> Taking Mariano's image as base (grab it here:
> https://gforge.inria.fr/frs/download.php/28513/Pharo-1.2.1.cog.zip) I
> found
> the following issues and fixed them:
>
> To begin, I saved a copy of the image to a new file named
> "simulated.image".
> Closed the image and reopened the first one.
>
> 1) First problem: "Error: basicNew: failed"
> Then, I evaluated the following from the original:
> (StackInterpreterSimulator new openOn: 'source.image') test.
> The error I've got is the one I described in my first post: "Error:
> basicNew: failled" for "ArrayClass>>new".
> Inspecting the stack trace I found that RootTableSize was an instance of
> UndefinedObject in ObjectMemory>>initialize.
> Taking a deeper look, it seemed that RootTableSize was setted in
> ObjectMemory>>initializeWithOptions, wich wasn't called from
> StackInterpreterSimulator>>initialize. Instead, ObjectMemory>>initialize
> was
> called, but that message didn't initialize RootTableSize.
> So, I replaced the call form objectMemoryClass initialize to
> objectMemoryClass initializeWithOptions: Dictionary new. to get
> RootTableSize initialized properly.
>
> 2) Second problem: same situation with MethodCacheSize
> Proceeding with StackInterpreterSimulator's execution, I came across a
> similar situation with MethodCacheSize in ArrayClass>>basicNew:.
> Following the same procedure as before, I found MethodCacheSize
> uninitialized, and setted it property replacing, in
> StackInterpreterSimulator>>initialize, the call from StackInterpreter
> initialize. to StackInterpreter initializeWithOptions: Dictionary new.
>
> 3) Third problem: missing method from UtilityClass
> Proceeding again, I came across an MNU saying that UtilityClass does not
> understands "informUser:during:" message. After a message selector search,
> I
> replaced the call (that was being done in
> StackInterpreterSimulator>>openOn:extraMemory:) with UIManager default
> informUser: (...) during: (...)
>
> 4) Fourth problem: "the receiver of / is nil"
> Originated from InterpreterStackPage>>headFP:. The cause was that
> LargeContextBytes was an instance of UndefinedObject.
> Once again, using the Method Finder (great tool!) I fixed the problem
> evaluating: InterpreterStackPage initialize. as said in that method's
> comment.
>
>

Can you put the exact code to initialize all this points of 1) 2) and 4) ?
I mean, can you provide the final script you had to use before being able to
do the
(StackInterpreterSimulator new openOn: 'source.image') test.

Sure, here it goes:

    Deprecation raiseWarning: false.

    Gofer new
        squeaksource: 'MetacelloRepository';
        package: 'ConfigurationOfCog';
        load.
       
        ((Smalltalk at: #ConfigurationOfCog) project latestVersion) load.

The version of ConfigurationOfCog loaded was 3.3.

Mariano Martinez Peck wrote
> 5) Fifth problem: Two MNUs in StackInterpreter
> Those came up: isContextNonInt:, generated from
> commonVariable:at:chacheIndex: and commonVaraible:at:put:cacheIndex:.
> I fixed those issues by replacing calls from self isContextNonInt: to self
> objectMemory isContextNonInt:.
>
> 6) Sixth problem: MNU in StackInterpreter
> The selector was isContextHeader: and it was used in
> StackInterpreter>>stObject:at:.
> I replaced calls from self isContextHeader: to self objectMemory
> isContextHeader:.
>

for 5) and 6) .. which version of VMMaker are you using?  because maybe this
was already fixed in new versions?
I'm using VMMaker-oscog-IgorStasenko.123.
I've checked updating to the latest version, VMMaker-oscog-dtl.125, and those two seems to be fixed.

Mariano Martinez Peck wrote
>
> 7) Seventh problem: primitive clone failed in CArrayAccesor.
> I fixes that by adding the clone message in CArrayAccessor as follows:
>    clone
>            <primitive: 148>
>        ^ self primitiveFailed
>
> 8) Lastly, restarting the simulation again I found that the desktop from
> the
> simulation image was beign rendered (Pharo logo, some Workpaces that were
> saved, etc.) and then this error came up: "primitive failed:
> setGCBiasToGrowGCLimit:".
> The thing is that the VM that hosts the simulated one didn't open the
> debugger on that halt, it was like the simulated image was frozen (I
> suppose, because that error was in the call stack of
> snapshot:andQuit:embedded:).
>
> And here is when I wanted to ask you for some help guys, as I couldn't
> debug
> the host machine to invesitgate the cause and fix the problem.
>
> Do you have any clue/idea to detect the cause/fix this issue?
>
>
No, I have no idea :(
but maybe someone does.



> *FileOut of the changes described*
>
> http://forum.world.st/file/n3900467/ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip
> ChangesSoFarToMakeSimulatorWorkInPharo-1.2.1.zip
>
>
Excellent!   At the end you can also provide an image (that mine) with those
changes + a workspace with all the needed initialize code and the snippet to
start the simulator.
Done! :)
I've shared a file, http://dl.dropbox.com/u/45558068/Pharo-1.2.1.cog-ChangesSoFarToMakeSimulatorWork-images.7z, containing two images:
  - Pharo-1.2.1.cog.image: this is your original image, with all the changes I commented, and a workspace with all the needed code to initialize and run the simulator.
  - simulated.image: a snapshot Pharo-1.2.1.cog.image to be simulated

Also, I managed to get the PharoDebug.log from simulated.image (I think) and not from Pharo-1.2.1.cog.image describing the "Error: setGCBiasToGrowGCLimit: failed" error.
That file, named PharoDebug - setGCBiasToGrowGCLimit - failed.log, can also be found on the .7z file.

Mariano Martinez Peck wrote
Cheers


> Cheers and thanks in advance!
>
> Nick
>
>
>
>
>
> --
> View this message in context:
> http://forum.world.st/Got-Error-basicNew-failed-when-running-InterpreterSimulator-tp3835723p3900467.html
> Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.
> _______________________________________________
> VM-beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
>



--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Cheers!

Nick
Reply | Threaded
Open this post in threaded view
|

Re: Got "Error: basicNew: failed" when running InterpreterSimulator

Nick.
In reply to this post by Mariano Martinez Peck
Hi Guys,

Just wanted to give you an update. I managed to fix this one:

Mariano Martinez Peck wrote
> 8) Lastly, restarting the simulation again I found that the desktop from
> the
> simulation image was beign rendered (Pharo logo, some Workpaces that were
> saved, etc.) and then this error came up: "primitive failed:
> setGCBiasToGrowGCLimit:".
> The thing is that the VM that hosts the simulated one didn't open the
> debugger on that halt, it was like the simulated image was frozen (I
> suppose, because that error was in the call stack of
> snapshot:andQuit:embedded:).
>
> And here is when I wanted to ask you for some help guys, as I couldn't
> debug
> the host machine to invesitgate the cause and fix the problem.
>
> Do you have any clue/idea to detect the cause/fix this issue?
>
>
No, I have no idea :(
but maybe someone does.
Here´s how I fixed it:

The first thing I tried to do was to put a halt on the VM implementetion of #setGCBiasToGrowGCLimit: to see what's going on. That didn't work because the primitive wasn't called at all, it was failing for another reason.

So, the next thing I did was to halt the interpreter when the selector matched #primitiveFailed. That allowed me to inspect the call stack, and finally determine that this bug was caused by StackInterpreterSimulator >> #loadNewPlugin:.

How did I found that? First of all, I noticed that the primitive pragma in #setGCBiasToGrowGCLimit: didn't include the "module" parameter: <primitive: 'primitiveSetGCBiasToGrowGCLimit'> .
For primitives implemented inside plugins class, the module is assumed to be the plugin's class name if it's missing (more on that at: http://marianopeck.wordpress.com/2011/07/06/named-primitives/).

The thing is that this primitive is implemented in the interpreter itself, so this case wasn't taken into account in #loadNewPlugin:

So, to fix this bug (after doing some research) I borrowed the implementation from CogVMSimulator >> #loadNewPlugin: and replaced the one in StackInterpreterSimulator with it: turned out to be the same, except for this little fragment of code (that did just what I needed!):
          pluginString isEmpty
                   ifTrue: [plugin := self]


After that, the simulator started the image correctly (even the Pharo logo was rendered!) , but now presenting me a new issue to be solve: mouse clicks doesn't do anything on the simulated machine. The funny thing is that, when I exit from it by pressing CMD+"." all those clicks are executed on the host VM. Somehow they're not passed to the simulated VM, and are "remembered" in the host VM.

That's all (for the moment).

Cheers,

Nick