<div dir="ltr">Hi Juan, Hi All,<div><br></div><div>  </div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 6, 2017 at 6:06 AM, Juan Vuletich <span dir="ltr"><<a href="mailto:JuanVuletich@zoho.com" target="_blank">JuanVuletich@zoho.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"> <br><u></u>

  
    
  
  <div bgcolor="#ffffff">
    I finally understood what was happening. The problem with is
    primitive 136:<br>
    <br>
    primSignal: aSemaphore atMilliseconds: aSmallInteger<br>
        "Signal the semaphore when the millisecond clock reaches the
    value of the second argument. Fail if the first argument is neither
    a Semaphore nor nil. Essential. See Object documentation
    whatIsAPrimitive."<br>
        <primitive: 136><br>
        ^self primitiveFailed<br></div></blockquote><div><br></div><div>Yes, but primitive 136 *should not be used* :-).  You should use primitive 242:</div><div>primSignal: aSemaphore atUTCMicroseconds: anInteger</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     </span>"Signal the semaphore when the UTC microsecond clock reaches the value of the second argument.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span> Fail if the first argument is neither a Semaphore nor nil, or if the second argument is not an integer.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span> Essential. See Object documentation whatIsAPrimitive."</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span><primitive: 242></div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>^self primitiveFailed</div><div><br></div><div>The use of the UTC microsecond count eliminates any and all wrapping issues for about 50,000 years [puhleaze Mr Pruitt can you try and do your bit to make it possible that we'll make it that far. hic. ed.].  The old primitive 136 primSignal:atMilliseconds: is subject to wrapping problems.  I see that primSignal:atMilliseconds: is still used in Squeak 5.x but only to turn off signaling:</div><div><br></div><div>Delay class>>shutDown</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>"Suspend the active delay, if any, before snapshotting. It will be reactived when the snapshot is resumed."</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>"Details: This prevents a timer interrupt from waking up the active delay in the midst snapshoting, since the active delay will be restarted when resuming the snapshot and we don't want to process the delay twice."</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>AccessProtect wait.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span>self primSignal: nil atMilliseconds: 0.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>self saveResumptionTimes.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>DelaySuspended := true.</div><div><br></div><div><div>Delay class>>stopTimerInterruptWatcher</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>"Reset the class variables that keep track of active Delays and re-start the timer interrupt watcher process. Any currently scheduled delays are forgotten."</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>"Delay startTimerInterruptWatcher"</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span>self primSignal: nil atMilliseconds: 0.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>TimingSemaphore ifNotNil:[TimingSemaphore terminateProcess].</div></div><div><br></div><div>I will change this now.</div><div><br></div><div><br></div><div>HTH</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 bgcolor="#ffffff">
    <br>
    If the requested tick is already in the past, all the VMs except for
    Spur-64 will signal the semaphore anyway. Spur-64 won't. Taking care
    of this in the Cuis image was easy enough.<br>
    <br>
    Squeak seems not to be affected because it uses a newer primitive,
    that takes the large integer microsecond ticker, that might have the
    older behavior (signaling anyway). I'm not really sure, and maybe
    someone could check the primitive behavior and the corresponding
    assumptions in Squeak.<br>
    <br>
    Older Squeak images are not affected, as they are all 32-bit. So
    maybe there's no action required. In any case, making the behavior
    consistent across VMs and in both primitives would be nice.<br>
    <br>
    Cheers,<br>
    <br>
    On 3/3/2017 3:55 PM, Juan Vuletich wrote:
    <blockquote type="cite">
      <pre> </pre>
      <br>
      <fieldset class="gmail-m_-1330229773501571486mimeAttachmentHeader"></fieldset>
      <br>
      
      Hi Folks,<br>
      <br>
      Today, I was able to get closer to the origin of the problem. The
      problem is when Morphic tries to do a Delay (inter-cycle-pause) of
      1 or two milliseconds. (Usually they are quite larger, and the
      problem does not appear). With the 64-bit VM, sometimes very short
      delays hang the complete system. I don't know why, but this: <br>
      <br>
      waitDelay _ Delay forMilliseconds: 50. <br>
      [ true ] whileTrue: [ <br>
          1000 atRandom print. <br>
          waitDelay setDelay: 1; wait ]. <br>
      <br>
      is enough to hang Cuis in a short time. When trying to reproduce
      the problem in Squeak I had mixed results. It doesn't seem to hang
      there, but if I let this run for a couple of minutes and then try
      to halt with alt-. , then the hang occurs, and Squeak becomes
      irresponsibe. As a workaround, in Cuis in the inter cycle pause,
      I'm avoiding very short delays.<br>
      <br>
      I'm not sure if the bug is in the VM, in  the image, or both, but
      it is still there, and it also affects Squeak. I haven't tried it,
      but Pharo might also have the problem (if not, it can show a
      possible solution).<br>
      <br>
      BTW, Bert, I guess Squeak never does short delays in
      #interCyclePause: ...<br>
      <br>
      Thanks,<br>
      <br>
      On 2/6/2017 12:28 PM, Bert Freudenberg wrote:
      <blockquote type="cite">
        <pre> </pre>
        <br>
        <fieldset class="gmail-m_-1330229773501571486mimeAttachmentHeader"></fieldset>
        <br>
        <div dir="ltr">Yes, I tried with Spur64. Have not seen it freeze
          yet on Mac in Squeak, but we possibly have not replicated the
          test well enough yet.
          <div><br>
          </div>
          <div>It *did* freeze in Cuis Spur64 on Mac too. <br>
            <div><br>
            </div>
            <div>
              <div>- Bert -<br>
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Mon, Feb 6, 2017 at 2:08
                    PM, Juan Vuletich <span dir="ltr"><<a href="mailto:juanvuletich@zoho.com" target="_blank">juanvuletich@zoho.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <br>
                      <div>
                        <div style="font-size:10pt;font-family:verdana,arial,helvetica,sans-serif">Were you
                          usig Spur64? On Debian it does not freeze with
                          CogV3 or Spur32. Only with Spur64.<br>
                          <br>
                          Thanks,<br>
                          Juan<br id="gmail-m_-1330229773501571486m_5696784572827578869br3">
                          <div id="gmail-m_-1330229773501571486m_5696784572827578869signature">
                            <p style="color:rgb(42,42,42)">Sent
                              using <a style="color:rgb(89,143,222)" href="https://www.zoho.com/mail/" target="_blank">Zoho Mail</a></p>
                          </div>
                          <div id="gmail-m_-1330229773501571486m_5696784572827578869content">
                            <blockquote><br>
                              ---- On Mon, 06 Feb 2017 09:19:48 -0300 <b>
                                <a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>
                              </b> wrote ----<br>
                              <br>
                              <div>
                                <div dir="ltr">
                                  <div>
                                    <div>On Mon, Feb 6, 2017 at 3:15 AM,
                                      David T. Lewis <span><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span>
                                      wrote:<br>
                                      <blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">It would be
                                        interesting to try reproducing
                                        this in a Squeak image, but I<br>
                                        have not quite figured out how
                                        to make the Tokenish example
                                        work in Squeak.<br>
                                      </blockquote>
                                      <div><br>
                                      </div>
                                      <div>See attachment. Did not
                                        freeze on Mac with 10 Tokenish
                                        jumping.</div>
                                      <div>- Bert -</div>
                                      <div> </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                          </div>
                        </div>
                      </div>
                      <br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </blockquote>
      <br>
      <br>
      <pre class="gmail-m_-1330229773501571486moz-signature" cols="72">-- 
Juan Vuletich
<a class="gmail-m_-1330229773501571486moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a class="gmail-m_-1330229773501571486moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-<wbr>Smalltalk/Cuis-Smalltalk-Dev</a>
@JuanVuletich</pre>
    </blockquote>
    <br>
    <br>
    <pre class="gmail-m_-1330229773501571486moz-signature" cols="72">-- 
Juan Vuletich
<a class="gmail-m_-1330229773501571486moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a class="gmail-m_-1330229773501571486moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-<wbr>Smalltalk/Cuis-Smalltalk-Dev</a>
@JuanVuletich</pre>
  </div>

<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="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>