<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"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></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"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></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>
> Yikes! Good catch, thank you.<br>
><br>
> This very likely *is* a VM problem. I can reproduce it with a standard<br>
> interpreter VM, and the crash does not happen when I run the same thing<br>
> on Cog.<br>
<br>
<br>
The problem happens in SpaceTally>>spaceForInstancesOf:<br>
<br>
This eventually does "CompiledMethod basicNew" which crashes the VM.<br></blockquote><div><br></div></div><div>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.</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'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.</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>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>
><br>
> To reproduce:<br>
><br>
> Help -> About this System, then select "Space Analysis" in the System<br>
> Reporter. Result is:<br>
><br>
> Segmentation fault<br>
><br>
> 17369460 Behavior>new<br>
> 17369368 Fraction class>numerator:denominator:<br>
> 17369272 SmallInteger>/<br>
> 17369180 Number>roundUpTo:<br>
> 17369088 SpaceTally>spaceForInstancesOf:<br>
><br>
> Dave<br>
><br>
><br>
> On Sat, Feb 15, 2014 at 11:58:29PM +0100, Michael wrote:<br>
> > Hi,<br>
> ><br>
> > I am new to squeak and smalltalk, but I noticed the 4.5 release notes<br>
> > mention a "System space analysis" feature/function.<br>
> > However when I try it, I consistently crash the virtual machine with a<br>
> > segmentation fault.<br>
> ><br>
> > I have tried both on a Raspberry Pi with the latest version of the<br>
> > virtual machine and on 64 bit Slackware 14.1 with version 4.10.2.2614<br>
> > from <a href="http://slackbuilds.org" target="_blank">slackbuilds.org</a>. So I assume it is not a VM problem.<br>
> ><br>
> > The complete output from the command line is:<br>
> > bash-4.2$ squeak Squeak4.5-13675.image<br>
> > CHECKING cogvm<br>
> > which: no cogvm in (/usr/bin:/bin)<br>
> > CHECKING squeakvm<br>
> ><br>
> > Segmentation fault<br>
> ><br>
> > 17254592 Behavior>new<br>
> > Segmentation fault<br>
> ><br>
> ><br>
> > 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>