[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squeak-vm-dev
Subject:    Re: [Vm-dev] New Window VM (Closures, FT2Plugin, Large Cursors)
From:       Eliot Miranda <eliot.miranda () gmail ! com>
Date:       2009-03-07 19:31:02
Message-ID: 3ac5ce8a0903071131w66f152aai83a451492ec4b264 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #3 (multipart/alternative)]


On Sat, Mar 7, 2009 at 11:23 AM, John M McIntosh <
johnmci@smalltalkconsulting.com> wrote:

>
> Ah, I have a bias opinion for an answer, but I'll not discuss that here.
>
> However the BIG issue for the 3.8.x and earlier series of macintosh carbon
> VM is their behaviour for opening a closure image.
> What you will find is that if you attempt to open a closure image the
> squeak.app will start then terminate
> It will print a diagnostic message to the console which you can see via
> Apple's Console.app found in Applications/Utilities.
>
> 07/03/09 11:11:51 AM [0x0-0x8d08d].org.squeak.Squeak[1894] This interpreter
> (vers. 6502) cannot read image file (vers. 6504).
> 07/03/09 11:11:51 AM [0x0-0x8d08d].org.squeak.Squeak[1894] Press CR to
> quit...
>
> The reason for this behaviour is that 15 some years back John Maloney coded
> up the version checking logic and  there was a question
> what to do now. At the time CodeWarrior under os-7.5.x would helpfully put
> up a dialog window if you printed to the *console* and did
> a getchar for the answer, that code has moved forward for years now and
> no-one really has tested until now.
>
> Interestingly the getchar on os-x does not block and returns null and we
> terminate the VM, but the behaviour is confusing if you don't
> understand what is going on.
>
> I will at some point push out a 3.8.22 VM that should put up a more helpful
> dialog message, but people who have older VMs underfoot
> should realize this behaviour should be an indication that perhaps your VM
> is too old.


yes, please.  I stumbled across the code this week and the last few
statements don't make sense on a number of platforms, because they presume a
command-line:

checkImageVersionFrom: f startingAt: imageOffset
"Read and verify the image file version number and return true if the the
given image file needs to be byte-swapped. As a side effect, position the
file stream just after the version number of the image header. This code
prints a warning and does a hard-exit if it cannot find a valid version
number."
"This code is based on C code by Ian Piumarta."

| version firstVersion |
<var: #f type: 'sqImageFile '>
<var: #imageOffset type: 'squeakFileOffsetType '>

"check the version number"
self sqImageFile: f Seek: imageOffset.
version := firstVersion := self getLongFromFile: f swap: false.
(self readableFormat: version) ifTrue: [^ false].

"try with bytes reversed"
self sqImageFile: f Seek: imageOffset.
version := self getLongFromFile: f swap: true.
(self readableFormat: version) ifTrue: [^ true].

"Note: The following is only meaningful if not reading an embedded image"
imageOffset = 0 ifTrue:[
"try skipping the first 512 bytes (prepended by certain Mac file transfer
utilities)"
self sqImageFile: f Seek: 512.
version := self getLongFromFile: f swap: false.
(self readableFormat: version) ifTrue: [^ false].

"try skipping the first 512 bytes with bytes reversed"
self sqImageFile: f Seek: 512.
version := self getLongFromFile: f swap: true.
(self readableFormat: version) ifTrue: [^ true]].

"hard failure; abort"
self print: 'This interpreter (vers. '.
self printNum: self imageFormatVersion.
self print: ') cannot read image file (vers. '.
self printNum: firstVersion.
self print: ').'.
self cr.
self print: 'Press CR to quit...'.
self getchar.
self ioExit.

 We should replace the last phrase with something like

    self ioReportImageFormat: firstVersion incompatibleWith: self
imageFormatVersion andThenExit: nil

and let the platform deal with this as it chooses.


>
>
> On 7-Mar-09, at 8:12 AM, Andreas Raab wrote:
>
>  Bert Freudenberg wrote:
>>
>>> John bumped the Mac VM's major version to 4 to signify closure support.
>>> Maybe the other platforms should follow suit?
>>>
>>
>> I figured v4 would signify the Stack VM or later as this VM will no longer
>> be able to run v3 images. The current set of VMs are fully backwards
>> compatible so I consider them logically to be v3 VMs.
>>
>> But I'm willing to reconsider if people prefer the v4 terminology.
>>
>> Cheers,
>>  - Andreas
>>
>
> --
> ===========================================================================
> John M. McIntosh <johnmci@smalltalkconsulting.com>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>

[Attachment #6 (text/html)]

<br><br><div class="gmail_quote">On Sat, Mar 7, 2009 at 11:23 AM, John M McIntosh \
<span dir="ltr">&lt;<a \
href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> <br>
Ah, I have a bias opinion for an answer, but I&#39;ll not discuss that here.<br>
<br>
However the BIG issue for the 3.8.x and earlier series of macintosh carbon VM is \
their behaviour for opening a closure image.<br> What you will find is that if you \
attempt to open a closure image the squeak.app will start then terminate<br> It will \
print a diagnostic message to the console which you can see via Apple&#39;s \
Console.app found in Applications/Utilities.<br> <br>
07/03/09 11:11:51 AM [0x0-0x8d08d].org.squeak.Squeak[1894] This interpreter (vers. \
6502) cannot read image file (vers. 6504).<br> 07/03/09 11:11:51 AM \
[0x0-0x8d08d].org.squeak.Squeak[1894] Press CR to quit...<br> <br>
The reason for this behaviour is that 15 some years back John Maloney coded up the \
version checking logic and  there was a question<br> what to do now. At the time \
CodeWarrior under os-7.5.x would helpfully put up a dialog window if you printed to \
the *console* and did<br> a getchar for the answer, that code has moved forward for \
years now and no-one really has tested until now.<br> <br>
Interestingly the getchar on os-x does not block and returns null and we terminate \
the VM, but the behaviour is confusing if you don&#39;t<br> understand what is going \
on.<br> <br>
I will at some point push out a 3.8.22 VM that should put up a more helpful dialog \
message, but people who have older VMs underfoot<br> should realize this behaviour \
should be an indication that perhaps your VM is too \
old.</blockquote><div><br></div><div>yes, please.  I stumbled across the code this \
week and the last few statements don&#39;t make sense on a number of platforms, \
because they presume a command-line:</div> \
<div><br></div><div><div>checkImageVersionFrom: f startingAt: \
imageOffset</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>&quot;Read and verify the image file version number \
and return true if the the given image file needs to be byte-swapped. As a side \
effect, position the file stream just after the version number of the image header. \
This code prints a warning and does a hard-exit if it cannot find a valid version \
number.&quot;</div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span>&quot;This code is based on C code by Ian \
Piumarta.&quot;</div><div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>| version firstVersion |</div> <div><span \
class="Apple-tab-span" style="white-space:pre">	</span>&lt;var: #f type: \
&#39;sqImageFile &#39;&gt;</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>&lt;var: #imageOffset type: &#39;squeakFileOffsetType \
&#39;&gt;</div> <div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>&quot;check the version number&quot;</div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>self sqImageFile: f Seek: \
imageOffset.</div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span>version := firstVersion := self getLongFromFile: f \
swap: false.</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>(self readableFormat: version) ifTrue: [^ \
false].</div> <div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>&quot;try with bytes reversed&quot;</div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>self sqImageFile: f Seek: \
imageOffset.</div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span>version := self getLongFromFile: f swap: \
true.</div><div><span class="Apple-tab-span" style="white-space:pre">	</span>(self \
readableFormat: version) ifTrue: [^ true].</div> <div><br></div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>&quot;Note: The following is \
only meaningful if not reading an embedded image&quot;</div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>imageOffset = 0 ifTrue:[</div> \
<div><span class="Apple-tab-span" style="white-space:pre">		</span>&quot;try skipping \
the first 512 bytes (prepended by certain Mac file transfer \
utilities)&quot;</div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>self sqImageFile: f Seek: 512.</div> <div><span \
class="Apple-tab-span" style="white-space:pre">		</span>version := self \
getLongFromFile: f swap: false.</div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>(self readableFormat: version) ifTrue: [^ \
false].</div> <div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>&quot;try skipping the first 512 bytes with bytes \
reversed&quot;</div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>self sqImageFile: f Seek: 512.</div> <div><span \
class="Apple-tab-span" style="white-space:pre">		</span>version := self \
getLongFromFile: f swap: true.</div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>(self readableFormat: version) ifTrue: [^ \
true]].</div> <div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>&quot;hard failure; abort&quot;</div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>self print: &#39;This \
interpreter (vers. &#39;.</div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span>self printNum: self \
imageFormatVersion.</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>self print: &#39;) cannot read image file (vers. \
&#39;.</div> <div><span class="Apple-tab-span" style="white-space:pre">	</span>self \
printNum: firstVersion.</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>self print: &#39;).&#39;.</div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>self cr.</div> <div><span \
class="Apple-tab-span" style="white-space:pre">	</span>self print: &#39;Press CR to \
quit...&#39;.</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>self getchar.</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>self ioExit.</div> <div><br></div></div><div> We \
should replace the last phrase with something like</div><div><br></div><div>    self \
ioReportImageFormat: firstVersion incompatibleWith: self imageFormatVersion \
andThenExit: nil</div><div><br> </div><div>and let the platform deal with this as it \
chooses.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div \
class="h5"><br>

<br>
<br>
On 7-Mar-09, at 8:12 AM, Andreas Raab wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Bert Freudenberg wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> John bumped the Mac VM&#39;s major version to 4 to signify \
closure support. Maybe the other platforms should follow suit?<br> </blockquote>
<br>
I figured v4 would signify the Stack VM or later as this VM will no longer be able to \
run v3 images. The current set of VMs are fully backwards compatible so I consider \
them logically to be v3 VMs.<br> <br>
But I&#39;m willing to reconsider if people prefer the v4 terminology.<br>
<br>
Cheers,<br>
 - Andreas<br>
</blockquote>
<br></div></div><font color="#888888">
--<br>
===========================================================================<br>
John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" \
target="_blank">johnmci@smalltalkconsulting.com</a>&gt;<br> Corporate Smalltalk \
Consulting Ltd.  <a href="http://www.smalltalkconsulting.com" \
target="_blank">http://www.smalltalkconsulting.com</a><br> \
===========================================================================<br> <br>
<br>
<br>
</font></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic