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

List:       squeak-vm-dev
Subject:    [Vm-dev] Re: SpaceTally>>spaceForInstancesOf: crashes the VM (was: [squeak-dev] Squeak 4.5 Release C
From:       Eliot Miranda <eliot.miranda () gmail ! com>
Date:       2014-02-17 19:10:30
Message-ID: CAC20JE1W1BtG+r=HsXUPkG+eRysTds9NA-bD3Hf62GCfefqWBQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #3 (multipart/alternative)]


On Mon, Feb 17, 2014 at 10:59 AM, Eliot Miranda <eliot.miranda@gmail.com>wrote:

>
>
>
> On Sat, Feb 15, 2014 at 6:38 PM, David T. Lewis <lewis@mail.msen.com>wrote:
>
>> On Sat, Feb 15, 2014 at 08:08:19PM -0500, David T. Lewis wrote:
>> > Yikes! Good catch, thank you.
>> >
>> > This very likely *is* a VM problem. I can reproduce it with a standard
>> > interpreter VM, and the crash does not happen when I run the same thing
>> > on Cog.
>>
>>
>> The problem happens in SpaceTally>>spaceForInstancesOf:
>>
>> This eventually does "CompiledMethod basicNew" which crashes the VM.
>>
>
> That's funny :-).  You can print CompiledMethod basicNew, but woe betide
> you if you try and inspect it. I think the VM primitives should fail for
> CompiledMethod.
>

and my reason is that one can always get at the primitives somehow, e.g.

CompiledMethod perform: #basicNew: withArguments: #(0) inSuperclass:
CompiledMethod class superclass!

so the VM can only preserve its integrity by refusing to instantiate bogus
objects.  I've already changed the VM to fail at:[put:] for CompiledMethod
when accessing bytes in the literal frame (hence the change to
CompiledMethod hash), & IIRC to instVarAt:[put:] when accessing outside the
literal frame.  Changing the basicNew[:] primitives would be consistent
with that.

CompiledMethod class>basicNew seems to cause problems with both Cog and
>> interpreter VM, so I may have been wrong in saying that the issue was
>> specific to the interpreter VM.
>>
>> The format of CompiledMethod is special (see its class comment), and it
>> appears that #basicNew is problematic.
>>
>> Dave
>>
>>
>> >
>> > To reproduce:
>> >
>> > Help -> About this System, then select "Space Analysis" in the System
>> > Reporter. Result is:
>> >
>> > Segmentation fault
>> >
>> > 17369460 Behavior>new
>> > 17369368 Fraction class>numerator:denominator:
>> > 17369272 SmallInteger>/
>> > 17369180 Number>roundUpTo:
>> > 17369088 SpaceTally>spaceForInstancesOf:
>> >
>> > Dave
>> >
>> >
>> > On Sat, Feb 15, 2014 at 11:58:29PM +0100, Michael wrote:
>> > > Hi,
>> > >
>> > > I am new to squeak and smalltalk, but I noticed the 4.5 release notes
>> > > mention a "System space analysis" feature/function.
>> > > However when I try it, I consistently crash the virtual machine with a
>> > > segmentation fault.
>> > >
>> > > I have tried both on a Raspberry Pi with the latest version of the
>> > > virtual machine and on 64 bit Slackware 14.1 with version 4.10.2.2614
>> > > from slackbuilds.org. So I assume it is not a VM problem.
>> > >
>> > > The complete output from the command line is:
>> > > bash-4.2$ squeak Squeak4.5-13675.image
>> > > CHECKING cogvm
>> > > which: no cogvm in (/usr/bin:/bin)
>> > > CHECKING squeakvm
>> > >
>> > > Segmentation fault
>> > >
>> > > 17254592 Behavior>new
>> > > Segmentation fault
>> > >
>> > >
>> > > Michael
>>
>>
>
>
> --
> best,
> Eliot
>



-- 
best,
Eliot

[Attachment #6 (text/html)]

<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, \
Feb 17, 2014 at 10:59 AM, Eliot Miranda <span dir="ltr">&lt;<a \
href="mailto:eliot.miranda@gmail.com" \
target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"> <div \
class="im">On Sat, Feb 15, 2014 at 6:38 PM, David T. Lewis <span dir="ltr">&lt;<a \
href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On \
Sat, Feb 15, 2014 at 08:08:19PM -0500, David T. Lewis wrote:<br>

&gt; Yikes! Good catch, thank you.<br>
&gt;<br>
&gt; This very likely *is* a VM problem. I can reproduce it with a standard<br>
&gt; interpreter VM, and the crash does not happen when I run the same thing<br>
&gt; on Cog.<br>
<br>
<br>
The problem happens in SpaceTally&gt;&gt;spaceForInstancesOf:<br>
<br>
This eventually does &quot;CompiledMethod basicNew&quot; which crashes the \
VM.<br></blockquote><div><br></div></div><div>That&#39;s funny :-).  You can print \
CompiledMethod basicNew, but woe betide you if you try and inspect it. I think the VM \
primitives should fail for CompiledMethod.</div> \
</div></div></div></blockquote><div><br></div><div>and my reason is that one can \
always get at the primitives somehow, e.g.</div><div><br></div><div>CompiledMethod \
perform: #basicNew: withArguments: #(0) inSuperclass: CompiledMethod class \
superclass!</div> <div><br></div><div>so the VM can only preserve its integrity by \
refusing to instantiate bogus objects.  I&#39;ve already changed the VM to fail \
at:[put:] for CompiledMethod when accessing bytes in the literal frame (hence the \
change to CompiledMethod hash), &amp; IIRC to instVarAt:[put:] when accessing outside \
the literal frame.  Changing the basicNew[:] primitives would be consistent with \
that.</div> <div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
dir="ltr"><div class="gmail_extra"><div class="gmail_quote"> <div><div class="h5">
<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">CompiledMethod \
class&gt;basicNew seems to cause problems with both Cog and<br>

interpreter VM, so I may have been wrong in saying that the issue was<br>
specific to the interpreter VM.<br>
<br>
The format of CompiledMethod is special (see its class comment), and it<br>
appears that #basicNew is problematic.<br>
<br>
Dave<br>
<br>
<br>
&gt;<br>
&gt; To reproduce:<br>
&gt;<br>
&gt; Help -&gt; About this System, then select &quot;Space Analysis&quot; in the \
System<br> &gt; Reporter. Result is:<br>
&gt;<br>
&gt; Segmentation fault<br>
&gt;<br>
&gt; 17369460 Behavior&gt;new<br>
&gt; 17369368 Fraction class&gt;numerator:denominator:<br>
&gt; 17369272 SmallInteger&gt;/<br>
&gt; 17369180 Number&gt;roundUpTo:<br>
&gt; 17369088 SpaceTally&gt;spaceForInstancesOf:<br>
&gt;<br>
&gt; Dave<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Feb 15, 2014 at 11:58:29PM +0100, Michael wrote:<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; I am new to squeak and smalltalk, but I noticed the 4.5 release notes<br>
&gt; &gt; mention a &quot;System space analysis&quot; feature/function.<br>
&gt; &gt; However when I try it, I consistently crash the virtual machine with a<br>
&gt; &gt; segmentation fault.<br>
&gt; &gt;<br>
&gt; &gt; I have tried both on a Raspberry Pi with the latest version of the<br>
&gt; &gt; virtual machine and on 64 bit Slackware 14.1 with version 4.10.2.2614<br>
&gt; &gt; from <a href="http://slackbuilds.org" target="_blank">slackbuilds.org</a>. \
So I assume it is not a VM problem.<br> &gt; &gt;<br>
&gt; &gt; The complete output from the command line is:<br>
&gt; &gt; bash-4.2$ squeak Squeak4.5-13675.image<br>
&gt; &gt; CHECKING cogvm<br>
&gt; &gt; which: no cogvm in (/usr/bin:/bin)<br>
&gt; &gt; CHECKING squeakvm<br>
&gt; &gt;<br>
&gt; &gt; Segmentation fault<br>
&gt; &gt;<br>
&gt; &gt; 17254592 Behavior&gt;new<br>
&gt; &gt; Segmentation fault<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Michael<br>
<br>
</blockquote></div></div></div><span class=""><font color="#888888"><br><br \
clear="all"><div><br></div>-- <br>best,<div>Eliot</div> </font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>



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

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