<div dir="ltr">Hi Esteban,<div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 22, 2017 at 3:47 AM, Esteban Lorenzano <span dir="ltr"><<a href="mailto:estebanlm@gmail.com" target="_blank">estebanlm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Eliot, list<br>
<br>
I found a bug :)<br>
With latest VM (32 bits, using PharoVM flavour), I crash the VM when executing this:<br>
<br>
LGitError giterr_last.<br>
<br>
LGitError class>>giterr_last<br>
        ^ self call: #(void *giterr_last()) options: #(  )<br>
<br>
this is a very basic FFI call, and should answer an ExternalData instance (pointing to NULL, in this case).<br>
<br>
Digging into it, I found at a point (when instantiating the pointer) it answers nil instead an instantiated ExternalData, and this is because in<br>
<br>
Spur32BitMemoryManager>><wbr>instantiateClass:<wbr>indexableSize:<br>
<br>
otherwise clause is:<br>
<br>
                otherwise: "non-indexable"<br>
                        [self cppIf: (PharoVM or: [true]) "Leave the old code but ignore it completely unless someone complains."<br>
                                ifTrue:<br>
                                        [^nil]<br>
                                ifFalse:<br>
                                        ["some Squeak images include funky fixed subclasses of abstract variable<br>
                                          superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection.<br>
                                          Allow fixed classes to be instantiated here iff nElements = 0."<br>
                                         (nElements ~= 0 or: [instSpec > self lastPointerFormat]) ifTrue:<br>
                                                [^nil].<br>
                                         numSlots := self fixedFieldsOfClassFormat: classFormat.<br>
                                         fillValue := nilObj]].<br>
<br>
So it will always answer nil/NULL.<br>
Now, I don’t know why it was commented out, but since there it says  "Leave the old code but ignore it completely unless someone complains.”, I complain :D<br>
<br>
Thing is… if I restore old code it works fine.<br>
<br>
Question is: should we restore that code? or this shows a deeper problem?<br></blockquote><div><br></div><div>We can replace it with the ifFalse: branch.  I will do so.  I made this change because Nicolai Hess <a href="http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/2017-August/130685.html">wrote to the Pharo mailing list</a>.  I knew that Squeak relied on the behavior but not Pharo.  So </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">cheers,<br>
Esteban</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>