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<http://www.squeakvm.org/svn/squeak/branches/Cog/image/VMMaker-Squeak4.1.ima…>
)
cheers
On Mon, Oct 3, 2011 at 4:32 AM, Nick. <nick.lsts(a)gmail.com> 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-InterpreterSim…
> Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.
> _______________________________________________
> VM-beginners mailing list
> VM-beginners(a)lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
>
--
Mariano
http://marianopeck.wordpress.com
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.129.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.129
Author: eem
Time: 3 October 2011, 2:02:35.139 pm
UUID: 1b6f9029-666c-4ca4-b58c-9973784bb7ba
Ancestors: VMMaker.oscog-eem.128
Deal with some realities in the minValidCallAddress checking code.
At least on Mac OS under gcc -O, gcc will reorder code so that
primitiveFail comes before interpret.
Also firm up the signatures of rewriteInlineCacheAt:tag:target: &
rewriteCallAt:target:.
=============== Diff against VMMaker.oscog-eem.128 ===============
Item was changed:
----- Method: CoInterpreter>>interpretAddress (in category 'trampoline support') -----
interpretAddress
"This is used for asserts that check that inline cache editing results in valid addresses.
+ In the C VM primitiveFail is presumed to come before any primitives and so it constitutes
- In the C VM interpret is guaranteed to come before any primitives and so it constitutes
the lowest address in C code that machine code should be linked. In the simulator
+ we just answer something not low."
- we just answer something not low."
<api>
<returnTypeC: #usqInt>
^self cCode: [(self addressOf: #interpret) asUnsignedInteger]
inSmalltalk: [heapBase]!
Item was added:
+ ----- Method: CoInterpreter>>primitiveFailAddress (in category 'trampoline support') -----
+ primitiveFailAddress
+ "This is used for asserts that check that inline cache editing results in valid addresses.
+ In the C VM primitiveFail is presumed to come before any primitives and so it constitutes
+ the lowest address in C code that machine code should be linked. In the simulator
+ we just answer something not low."
+ <api>
+ <returnTypeC: #usqInt>
+ ^self cCode: [(self addressOf: #primitiveFail) asUnsignedInteger]
+ inSmalltalk: [heapBase]!
Item was changed:
----- Method: CogIA32Compiler>>rewriteCallAt:target: (in category 'inline cacheing') -----
rewriteCallAt: callSiteReturnAddress target: callTargetAddress
"Rewrite a call instruction to call a different target. This variant is used to link PICs
in ceSendMiss et al, and to rewrite cached primitive calls. Answer the extent of
the code change which is used to compute the range of the icache to flush."
<var: #callSiteReturnAddress type: #usqInt>
+ <var: #callTargetAddress type: #usqInt>
| callDistance |
"self cCode: ''
inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 10 to: callSiteReturnAddress - 1]."
false
ifTrue: [self assert: callTargetAddress >= cogit minCallAddress]
ifFalse: [callTargetAddress >= cogit minCallAddress ifFalse:
[self error: 'linking callsite to invalid address']].
callDistance := (callTargetAddress - callSiteReturnAddress) signedIntToLong.
objectMemory
byteAt: callSiteReturnAddress - 1 put: (callDistance >> 24 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 2 put: (callDistance >> 16 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 3 put: (callDistance >> 8 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 4 put: (callDistance bitAnd: 16rFF).
self assert: (self callTargetFromReturnAddress: callSiteReturnAddress) signedIntToLong = callTargetAddress.
"self cCode: ''
inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 10 to: callSiteReturnAddress - 1]."
^5!
Item was changed:
----- Method: CogIA32Compiler>>rewriteInlineCacheAt:tag:target: (in category 'inline cacheing') -----
rewriteInlineCacheAt: callSiteReturnAddress tag: cacheTag target: callTargetAddress
"Rewrite an inline cache to call a different target for a new tag. This variant is used
to link unlinked sends in ceSend:to:numArgs: et al. Answer the extent of the code
change which is used to compute the range of the icache to flush."
<var: #callSiteReturnAddress type: #usqInt>
+ <var: #callTargetAddress type: #usqInt>
| callDistance |
"self cCode: ''
inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 10 to: callSiteReturnAddress - 1]."
false
ifTrue: [self assert: callTargetAddress >= cogit minCallAddress]
ifFalse: [callTargetAddress >= cogit minCallAddress ifFalse:
[self error: 'linking callsite to invalid address']].
callDistance := (callTargetAddress - callSiteReturnAddress) signedIntToLong.
objectMemory
byteAt: callSiteReturnAddress - 1 put: (callDistance >> 24 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 2 put: (callDistance >> 16 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 3 put: (callDistance >> 8 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 4 put: (callDistance bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 6 put: (cacheTag >> 24 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 7 put: (cacheTag >> 16 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 8 put: (cacheTag >> 8 bitAnd: 16rFF);
byteAt: callSiteReturnAddress - 9 put: (cacheTag bitAnd: 16rFF).
self assert: (self callTargetFromReturnAddress: callSiteReturnAddress) signedIntToLong = callTargetAddress.
"self cCode: ''
inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 10 to: callSiteReturnAddress - 1]."
^10!
Item was changed:
----- Method: Cogit>>initializeCodeZoneFrom:upTo: (in category 'initialization') -----
initializeCodeZoneFrom: startAddress upTo: endAddress
<api>
self cCode: [self sqMakeMemoryExecutableFrom: startAddress To: endAddress]
inSmalltalk: [self initializeProcessor].
codeBase := methodZoneBase := (self
cCode: [startAddress]
inSmalltalk: [startAddress + guardPageSize]).
+ minValidCallAddress := (codeBase min: coInterpreter interpretAddress)
+ min: coInterpreter primitiveFailAddress.
- minValidCallAddress := codeBase min: coInterpreter interpretAddress.
self initializeBackend.
self maybeGenerateCheckFeatures.
self maybeGenerateICacheFlush.
self generateVMOwnerLockFunctions.
ceGetSP := self cCoerceSimple: self genGetLeafCallStackPointer to: #'unsigned long (*)(void)'.
self generateStackPointerCapture.
self generateTrampolines.
self checkPrimitiveTableEnablers.
methodZone manageFrom: methodZoneBase to: endAddress.
self computeEntryOffsets.
self generateClosedPICPrototype.
"N.B. this is assumed to be the last thing done in initialization; see Cogit>>initialized"
self generateOpenPICPrototype!
Hi Eliot. I am testing your very last VM r2496, CogMT in Mac OS 10.6.8. I am
using the trick of #cannotInterpret: and I discover a problem with it.
Basically, it is when doing something like this:
MyProxy >> cannotInterpret: aMessage
Error signal: 'ups...'.
In this case, the debugger comes in but after one or 2 times I press in the
debugger line of #cannotInterpret: (to debug it), it crashes. As far as I
could see with gdb, the problem is in MethodContext >> #printDetails:
If I comment the contents of such method, I have no crash at all. I think
that in this scenario where I throw an arror inside #cannotInterpret can
reach a situation where you don't have temps or values or receiver or
something and that's why it crash.
Furthermore, previous VM version, do NOT have this problem.
I will try to dig a little more, but if you give me a hint, I appreciate it.
Here is the bt and the stack:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000026
0x000d8356 in methodHasCogMethod ()
(gdb) bt
#0 0x000d8356 in methodHasCogMethod ()
#1 0x000c7899 in cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase ()
#2 0x000d6eea in ceSICMiss ()
#3 0x13ffc35c in ?? ()
#4 0x00107a05 in threadSchedulingLoop ()
#5 0x00108c38 in initStackPagesAndInterpret ()
#6 0x0005d964 in EventLoopEventHandler ()
#7 0x98c66c2f in DispatchEventToHandlers ()
#8 0x98c65ef6 in SendEventToEventTargetInternal ()
#9 0x98c65d55 in SendEventToEventTargetWithOptions ()
#10 0x98c9aa24 in ToolboxEventDispatcherHandler ()
#11 0x98c67080 in DispatchEventToHandlers ()
#12 0x98c65ef6 in SendEventToEventTargetInternal ()
#13 0x98c887f3 in SendEventToEventTarget ()
#14 0x98e11c17 in ToolboxEventDispatcher ()
#15 0x98e11d4f in RunApplicationEventLoop ()
#16 0x0005d18a in RunApplicationEventLoopWithSqueak ()
#17 0x0006ebf7 in main ()
(gdb) call (int) printAllStacks()
Process 0x171793f8 priority 40
0xbff69d64 M [] in MethodContext>printDetails: 387422092: a(n) MethodContext
0xbff69d80 M BlockClosure>on:do: 388720820: a(n) BlockClosure
0xbff69da0 M BlockClosure>ifError: 388720820: a(n) BlockClosure
0xbff69dc8 M MethodContext>printDetails: 387422092: a(n) MethodContext
0xbff69df0 M MethodContext(ContextPart)>errorReportOn: 387418688: a(n)
MethodContext
0xbff69e1c I [] in SmalltalkImage>logError:inContext: 340435416: a(n)
SmalltalkImage
0xbff69e48 I [] in SmalltalkImage>logDuring: 340435416: a(n) SmalltalkImage
0xbff69e68 M BlockClosure>ensure: 388309644: a(n) BlockClosure
0xbff69e90 I SmalltalkImage>logDuring: 340435416: a(n) SmalltalkImage
0xbff69eb4 I SmalltalkImage>logError:inContext: 340435416: a(n)
SmalltalkImage
0xbff69ef0 M [] in
MorphicUIManager>openDebuggerOn:context:label:contents:fullView: 338485116:
a(n) MorphicUIManager
0xbff69f0c M BlockClosure>on:do: 387421948: a(n) BlockClosure
0xbff69f44 M [] in
MorphicUIManager>openDebuggerOn:context:label:contents:fullView: 338485116:
a(n) MorphicUIManager
0xbff69f64 M WorldState>runStepMethodsIn: 338433128: a(n) WorldState
0xbff69f80 M PasteUpMorph>runStepMethods 338272244: a(n) PasteUpMorph
0xbff69f98 M WorldState>doOneCycleNowFor: 338433128: a(n) WorldState
0xbff69fb4 M WorldState>doOneCycleFor: 338433128: a(n) WorldState
0xbff69fd0 M PasteUpMorph>doOneCycle 338272244: a(n) PasteUpMorph
0xbff69ff0 I [] in Project class>spawnNewProcess 338672796: a(n) Project
class
0xbff6a010 I [] in BlockClosure>newProcess 387420956: a(n) BlockClosure
Process 0x1711e7fc priority 50
0xbff5ffd0 M WeakArray class>finalizationProcess 337425280: a(n) WeakArray
class
0xbff5fff0 I [] in WeakArray class>restartFinalizationProcess 337425280:
a(n) WeakArray class
0xbff60010 I [] in BlockClosure>newProcess 387049248: a(n) BlockClosure
Process 0x14a27698 priority 80
0xbff60ff0 M Delay class>handleTimerEvent 337430620: a(n) Delay class
0xbff61010 I Delay class>? 337430620: a(n) Delay class
346191180 s [] in Delay class>?
346191416 s [] in BlockClosure>?
Process 0x15d37dd0 priority 40
366182080 s [] in SHTextStylerST80(SHTextStyler)>styleInBackgroundProcess:
366181744 s [] in BlockClosure>newProcess
Process 0x166a5108 priority 60
0xbff61fd0 I SmalltalkImage>lowSpaceWatcher 340435416: a(n) SmalltalkImage
0xbff61ff0 I [] in SmalltalkImage>installLowSpaceWatcher 340435416: a(n)
SmalltalkImage
0xbff62010 I [] in BlockClosure>newProcess 376066092: a(n) BlockClosure
Process 0x1711c3d8 priority 60
0xbff64f50 M [] in Delay>wait 387040292: a(n) Delay
0xbff64f70 M BlockClosure>ifCurtailed: 387932080: a(n) BlockClosure
0xbff64f8c M Delay>wait 387040292: a(n) Delay
0xbff64fa4 M InputEventPollingFetcher>waitForInput 337872084: a(n)
InputEventPollingFetcher
0xbff64fd0 I InputEventPollingFetcher(InputEventFetcher)>eventLoop
337872084: a(n) InputEventPollingFetcher
0xbff64ff0 I [] in
InputEventPollingFetcher(InputEventFetcher)>installEventLoop 337872084: a(n)
InputEventPollingFetcher
0xbff65010 I [] in BlockClosure>newProcess 387039996: a(n) BlockClosure
processes at priority 10
Process 0x166a52d4 priority 10
0xbff63fd0 M ProcessorScheduler class>idleProcess 337424860: a(n)
ProcessorScheduler class
0xbff63ff0 I [] in ProcessorScheduler class>startUp 337424860: a(n)
ProcessorScheduler class
0xbff64010 I [] in BlockClosure>newProcess 376066552: a(n) BlockClosure
$1 = 0
Thanks in advance,
--
Mariano
http://marianopeck.wordpress.com
...at http://www.mirandabanda.org/files/Cog/VM/VM.r2496/.
CogVM binaries as per VMMaker.oscog-eem.128/r2496
Fix regression in object-as-method/cannot-interpret for single and polymorphic
inline cache misses (lookup:for:methodAndErrorSelectorInto:).
Fix formatting bugette in context printing.
This fixes a regression in objects-as-methods which Nicholas was suffering
from as a crash during Run Coverage in the Test Runner.
--
best,
Eliot
Hi. On an Intel Mac running Mac OS X 10.6.8, I followed the instructions
to install a NativeBoost VM found here:
http://code.google.com/p/nativeboost/wiki/Installation. I downloaded the
latest Mac NBCog VM, and ran into an error after evaluating NBInstaller
install.
I'm using the 4.3alpha-11636.image file. The 4.2 image gives a different
set of errors but also wont install:
The progress bar window says: Compiling NativeBoost-Core-IgorStasenko.36
The window title is "Syntax error" with a split text field. The top
field contains:
nbExternalStructure Fields parsing spec parseFields:byte
The bottom field has a red error message embedded in this line:
stream peek == #Invalid literal character ->; ifTrue: [ stream
next ].
].
Help?