<div dir="ltr">&gt;<span style="font-size:13px">compiled with the toolchain for XCode 7.2.</span><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">So how are you doing the compile? </span></div><div><span style="font-size:13px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 16, 2016 at 3:13 PM, Yoshiki Ohshima <span dir="ltr">&lt;<a href="mailto:Yoshiki.Ohshima@acm.org" target="_blank">Yoshiki.Ohshima@acm.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Great!<br>
<br>
The crash happens with the 32-bit VM shipped in the 5.1 all in one.  I<br>
can reproduce it the latest code of opensmalltalk-vm on github, and<br>
compiled with the toolchain for XCode 7.2.1.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Fri, Sep 16, 2016 at 3:04 PM, John McIntosh<br>
&lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.<wbr>com</a>&gt; wrote:<br>
&gt;<br>
&gt; 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?)<br>
&gt;<br>
&gt; 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.<br>
&gt;<br>
&gt; The returnAndRemoveOldest 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.<br>
&gt;<br>
&gt;<br>
&gt; - (void) ioGetNextEvent: (sqInputEvent *) evt {<br>
&gt;<br>
&gt; ioProcessEvents();<br>
&gt;<br>
&gt; id event = [eventQueue returnAndRemoveOldest];<br>
&gt;<br>
&gt; if (event) {<br>
&gt;<br>
&gt; @autoreleasepool {<br>
&gt;<br>
&gt;             [self processAsOldEventOrComplexEven<wbr>t: event placeIn: evt];<br>
&gt;<br>
&gt;         }<br>
&gt;<br>
&gt;         RELEASEOBJ(event);<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; 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 sizeof(sqInputEvent))into the given sqInputEvent buffer for consumption by Smalltalk.<br>
&gt;<br>
&gt;<br>
&gt; 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.<br>
&gt;<br>
&gt;<br>
&gt; - (void ) processAsOldEventOrComplexEven<wbr>t: (id) event placeIn: (sqInputEvent *) evt {<br>
&gt;<br>
&gt; if ([event[0] intValue] == 1) {<br>
&gt;<br>
&gt; [(NSData *)event[1] getBytes: evt length: sizeof(sqInputEvent)];<br>
&gt;<br>
&gt; if (evt-&gt;type == EventTypeKeyboard) {<br>
&gt;<br>
&gt; // NSLog(@&quot;keyboard pc %i cc %i uc %i m %i&quot;,((sqKeyboardEvent *)evt)-&gt;pressCode,((<wbr>sqKeyboardEvent *) evt)-&gt;charCode,((<wbr>sqKeyboardEvent *) evt)-&gt;utf32Code,((<wbr>sqKeyboardEvent *) evt)-&gt;modifiers);<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; return;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; As for the crash. it appears when we are doing the self interpretedKeyEvents<br>
&gt;<br>
&gt; -(void)keyDown:(NSEvent*)<wbr>theEvent {<br>
&gt;<br>
&gt; keyBoardStrokeDetails *aKeyBoardStrokeDetails = AUTORELEASEOBJ([[<wbr>keyBoardStrokeDetails alloc] init]);<br>
&gt;<br>
&gt; aKeyBoardStrokeDetails.keyCode = [theEvent keyCode];<br>
&gt;<br>
&gt; aKeyBoardStrokeDetails.<wbr>modifierFlags = [theEvent modifierFlags];<br>
&gt;<br>
&gt; NSArray *down = @[theEvent];<br>
&gt;<br>
&gt; @synchronized(self) {<br>
&gt;<br>
&gt; lastSeenKeyBoardStrokeDetails = aKeyBoardStrokeDetails;<br>
&gt;<br>
&gt; [self interpretKeyEvents: down];<br>
&gt;<br>
&gt; self.<wbr>lastSeenKeyBoardStrokeDetails = NULL;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; which triggers a failure via...<br>
&gt;<br>
&gt;&gt;&gt; 6   org.squeak.Squeak5.1.32.All-<wbr>in-One 0x00130512 getCrashDumpFilenameInto + 82<br>
&gt;&gt;&gt; 7   com.apple.CoreFoundation       0x98c2ddaf _CFAutoreleasePoolPop + 47<br>
&gt;<br>
&gt;<br>
&gt; 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.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Sep 16, 2016 at 10:16 AM, Tobias Pape &lt;<a href="mailto:Das.Linux@gmx.de">Das.Linux@gmx.de</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 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>
&gt;&gt;<br>
&gt;&gt; &gt; On Fri, Sep 16, 2016 at 6:22 AM, Yoshiki Ohshima<br>
&gt;&gt; &gt; &lt;<a href="mailto:Yoshiki.Ohshima@acm.org">Yoshiki.Ohshima@acm.org</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; Would it be a feasible approach to try to use XCode (clang) Analyze?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I got 9 errors from clang-checker.  One of those that looks most<br>
&gt;&gt; &gt; suspicious is this one attached:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Apparently just commenting the RELEASEOBJ line is not the right<br>
&gt;&gt; &gt; thing... But does anybody has some ideas?<br>
&gt;&gt;<br>
&gt;&gt; Somewhere a RETAINOBJECT might be missing?<br>
&gt;&gt;<br>
&gt;&gt; Best regards<br>
&gt;&gt;         -Tobias<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; -- Yoshiki<br>
&gt;&gt; &gt; &lt;event.png&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; ==============================<wbr>==============================<wbr>===============<br>
&gt; John M. McIntosh. Corporate Smalltalk Consulting Ltd <a href="https://www.linkedin.com/in/smalltalk" rel="noreferrer" target="_blank">https://www.linkedin.com/in/<wbr>smalltalk</a><br>
&gt; ==============================<wbr>==============================<wbr>===============<br>
&gt;<br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
-- Yoshiki<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>