<div dir="ltr">Ok, we&#39;ll I&quot;m not sure which version of the source code is being compiled here, or how this is being done (Xcode project, cmd line script?) <div><br></div><div>First If the VM is compiled for 32bit it uses NON-ARC memory management, if it is compiled for 64bit then it should be ARC aware. </div><div><br></div><div>The <span style="font-family:menlo;font-size:11px">returnAndRemoveOldest </span>is from the ancient Apple Queue.m/h which is ill named and returns for ARC a retain count of one, which then requires the RELEASEOBJ. </div><div><br></div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>- (</span><span style="color:rgb(187,44,162)">void</span><span>) ioGetNextEvent: (sqInputEvent *) evt {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span><span style="white-space:pre-wrap">        </span></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span>ioProcessEvents();</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span></span><span style="color:rgb(187,44,162)">id</span><span> event = [eventQueue returnAndRemoveOldest];</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span></span><span style="color:rgb(187,44,162)">if</span><span> (event) {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(187,44,162)"><span style="color:rgb(0,0,0)"><span style="white-space:pre-wrap">                </span></span><span>@autoreleasepool</span><span style="color:rgb(0,0,0)"> {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>            [</span><span style="color:rgb(187,44,162)">self</span><span> processAsOldEventOrComplexEven<wbr>t: event placeIn: evt];</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        }</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>        RELEASEOBJ(event);</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span>}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span><span style="white-space:pre-wrap">        </span></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>}</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><br></span></p><p style="margin:0px;line-height:normal">The use of the autoreleasepool here is for the iOS platform where a more complex procedure occurs to return data from the touch data. For OSX it just drops the bytes (length <span style="font-family:menlo;font-size:11px;color:rgb(187,44,162)">sizeof</span><span style="font-family:menlo;font-size:11px">(sqInputEvent))</span>i<wbr>nto the given <span style="font-family:menlo;font-size:11px">sqInputEvent </span>buffer for consumption by Smalltalk. <span style="font-family:menlo;font-size:11px"><br></span></p><p style="margin:0px;line-height:normal"><br></p><p style="margin:0px;line-height:normal">In general it just takes a possible object off the queue and pulls the data bytes into a C structure for consumption. Under non-ARC the object is retained within the Queue.m/h and has to be later released.  I think I should take one of the more standard GCD queue examples and replace the older logic in the near future. </p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>- (</span><span style="color:rgb(187,44,162)">void</span><span> ) processAsOldEventOrComplexEven<wbr>t: (</span><span style="color:rgb(187,44,162)">id</span><span>) event placeIn: (sqInputEvent *) evt {</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span></span><span style="color:rgb(187,44,162)">if</span><span> ([event[</span><span style="color:rgb(39,42,216)">0</span><span>] intValue] == </span><span style="color:rgb(39,42,216)">1</span><span>) {</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">                </span>[(NSData *)event[</span><span style="color:rgb(39,42,216)">1</span><span>] getBytes: evt length: </span><span style="color:rgb(187,44,162)">sizeof</span><span>(sqInputEvent)];</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">                </span></span><span style="color:rgb(187,44,162)">if</span><span> (evt-&gt;type == EventTypeKeyboard) {</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(0,132,0)"><span>//<span style="white-space:pre-wrap">                        </span>NSLog(@&quot;keyboard pc %i cc %i uc %i m %i&quot;,((sqKeyboardEvent *)evt)-&gt;pressCode,((sqKeyboard<wbr>Event *) evt)-&gt;charCode,((sqKeyboardEve<wbr>nt *) evt)-&gt;utf32Code,((sqKeyboardEv<wbr>ent *) evt)-&gt;modifiers);</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">                </span>}</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(187,44,162)"><span style="color:rgb(0,0,0)"><span style="white-space:pre-wrap">                </span></span><span>return</span><span style="color:rgb(0,0,0)">;</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span>}</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo">







</p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>}</span></p></div><div><br></div><div>As for the crash. it appears when we are doing the self interpretedKeyEvents</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>-(</span><span style="color:rgb(187,44,162)">void</span><span>)keyDown:(</span><span style="color:rgb(112,61,170)">NSEvent</span><span>*)<wbr>theEvent {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(79,129,135)"><span style="color:rgb(0,0,0)"><span style="white-space:pre-wrap">        </span></span><span>keyBoardStrokeDetails</span><span style="color:rgb(0,0,0)"> *aKeyBoardStrokeDetails = </span><span style="color:rgb(120,73,42)">AUTORELEASEOBJ</span><span style="color:rgb(0,0,0)">([[</span><span>keyBoardStrok<wbr>eDetails</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(61,29,129)">alloc</span><span style="color:rgb(0,0,0)">] </span><span style="color:rgb(61,29,129)">init</span><span style="color:rgb(0,0,0)">]);</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span>aKeyBoardStrokeDetails.</span><span style="color:rgb(79,129,135)">keyCode</span><span> = [theEvent </span><span style="color:rgb(61,29,129)">keyCode</span><span>];</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span>aKeyBoardStrokeDetails.</span><span style="color:rgb(79,129,135)">modifie<wbr>rFlags</span><span> = [theEvent </span><span style="color:rgb(61,29,129)">modifierFlags</span><span>];</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px"><span><span style="white-space:pre-wrap">        </span></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span></span><span style="color:rgb(112,61,170)">NSArray</span><span> *down = </span><span style="color:rgb(39,42,216)">@[</span><span>theEvent</span><span style="color:rgb(39,42,216)">]</span><span>;</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(187,44,162)"><span style="color:rgb(0,0,0)"><span style="white-space:pre-wrap">        </span></span><span>@synchronized</span><span style="color:rgb(0,0,0)">(</span><span>self</span><span style="color:rgb(0,0,0)">) {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(79,129,135)"><span style="color:rgb(0,0,0)"><span style="white-space:pre-wrap">                </span></span><span>lastSeenKeyBoardStrokeDetails</span><span style="color:rgb(0,0,0)"> = aKeyBoardStrokeDetails;</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(61,29,129)"><span style="color:rgb(0,0,0)"><span style="white-space:pre-wrap">                </span>[</span><span style="color:rgb(187,44,162)">self</span><span style="color:rgb(0,0,0)"> </span><span>interpretKeyEvents</span><span style="color:rgb(0,0,0)">: down];</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;color:rgb(79,129,135)"><span style="color:rgb(0,0,0)"><span style="white-space:pre-wrap">                </span></span><span style="color:rgb(187,44,162)">self</span><span style="color:rgb(0,0,0)">.</span><span>lastSeenKeyBoardStrokeDet<wbr>ails</span><span style="color:rgb(0,0,0)"> = </span><span style="color:rgb(187,44,162)">NULL</span><span style="color:rgb(0,0,0)">;</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><span style="white-space:pre-wrap">        </span>}</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span>}</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span><b>which triggers a failure via...  </b></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:13px">&gt;&gt; 6   org.squeak.Squeak5.1.32.All-</span><wbr style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">in-One 0x00130512 getCrashDumpFilenameInto + 82</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">&gt;&gt; 7   com.apple.CoreFoundation       0x98c2ddaf _CFAutoreleasePoolPop + 47</span><span><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:13px">On saturday I&quot;ll see if I can recreate it and see what might be causing it, mind nothing comes to mind at the moment. </span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="font-family:arial,sans-serif;font-size:13px"><br></span></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 16, 2016 at 10:16 AM, Tobias Pape <span dir="ltr">&lt;<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 16.09.2016, at 19:09, Yoshiki Ohshima &lt;<a href="mailto:Yoshiki.Ohshima@acm.org">Yoshiki.Ohshima@acm.org</a>&gt; wrote:<br>
<span class=""><br>
&gt; On Fri, Sep 16, 2016 at 6:22 AM, Yoshiki Ohshima<br>
&gt; &lt;<a href="mailto:Yoshiki.Ohshima@acm.org">Yoshiki.Ohshima@acm.org</a>&gt; wrote:<br>
&gt;&gt; Would it be a feasible approach to try to use XCode (clang) Analyze?<br>
&gt;<br>
</span>&gt; I got 9 errors from clang-checker.  One of those that looks most<br>
&gt; suspicious is this one attached:<br>
&gt;<br>
&gt; Apparently just commenting the RELEASEOBJ line is not the right<br>
&gt; thing... But does anybody has some ideas?<br>
<br>
Somewhere a RETAINOBJECT might be missing?<br>
<br>
Best regards<br>
<span class="HOEnZb"><font color="#888888">        -Tobias<br>
<br>
&gt;<br>
&gt; --<br>
&gt; -- Yoshiki<br>
&gt; &lt;event.png&gt;<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">===========================================================================<br>John M. McIntosh. Corporate Smalltalk Consulting Ltd <a href="https://www.linkedin.com/in/smalltalk" target="_blank">https://www.linkedin.com/in/smalltalk</a><br>===========================================================================<br></div></div></div></div>
</div>