<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Christoph --<div><br></div><div>I double-checked with Tom (tobe) on this. We could not think of a serious issue to use a helper process for termination. It's not quite different to what the debugger itself does and we also use helper processes to, for example, handle CMD+Dot.</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
                        <p style='color: #AAAAAA; margin-top: 10px;'>Am 13.06.2022 14:03:13 schrieb Christoph Thiede <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style='font-family:Arial,Helvetica,sans-serif'><div dir="auto">Hi Jaromir,<div dir="auto"><br></div><div dir="auto">sorry for not responding earlier!</div><div dir="auto"><br></div><div dir="auto">> Replace termination of the debugged process with an indirect termination via a forked process (otherwise the debugger waits until the debugged process is terminated but if another error is raised during unwind the termination is halted and the assertion fail).</div><div dir="auto"><br></div><div dir="auto">Could you elaborate further on that? I have a bad feeling with it. If the termination behaves suspiciously and takes a longer time, or the process never ends (e.g. via a non-local return), this was visible in the past because the UI was blocked. Now it's no longer possible to see this directly. Furthermore, anything might happen during the termination which now happens in a separate process, opening a potential can of worm of concurrency issues (see also "async hell"). Couldn't we simply keep the termination running synchronously? User interrupt will still work if something goes wrong with the termination, but at least the user will notice.</div><div dir="auto"><br></div><div dir="auto">Best,</div><div dir="auto">Christoph</div><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">Am 13.06.2022 09:42 schrieb commits@source.squeak.org:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Marcel Taeumel uploaded a new version of Tools to project The Trunk:<br>
http://source.squeak.org/trunk/Tools-jar.1161.mcz</p>
<p dir="ltr">==================== Summary ====================</p>
<p dir="ltr">Name: Tools-jar.1161<br>
Author: jar<br>
Time: 9 June 2022, 1:57:46.549529 pm<br>
UUID: f3921b2b-5628-104d-98a9-1e99671344a2<br>
Ancestors: Tools-ct.1160</p>
<p dir="ltr">Fix an inconsistent Debugger behavior WRT the new alternative abandon/terminate/destroy modes introduced by Kernel-ct.1434 and Tools-ct.1092.</p>
<p dir="ltr">The suggestion is to make all three termination methods equal in terms of how the chosen termination mode is propagated to #windowIsClosing. Current asymmetrical approach leads to an incorrect debugger termination via #terminate mode. </p>
<p dir="ltr">Replace termination of the debugged process with an indirect termination via a forked process (otherwise the debugger waits until the debugged process is terminated but if another error is raised during unwind the termination is halted and the assertion fail).</p>
<p dir="ltr">Following up a conversation in http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-May/220675.html</p>
<p dir="ltr">Complemented by ToolsTests-jar.111 fixing the failing/incorrects tests in ToolsTests-ct.107</p>
<p dir="ltr">Please review as I'm no debugger expert and this is just my suggestion.</p>
<p dir="ltr">Superseeds (or replaces) Tools-jar.1159 (please kindly remove from Inbox)</p>
<p dir="ltr">=============== Diff against Tools-ct.1160 ===============</p>
<p dir="ltr">Item was changed:<br>
  CodeHolder subclass: #Debugger<br>
+   instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression terminationMethod'<br>
-       instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression'<br>
   classVariableNames: 'ContextStackKeystrokes ErrorReportServer FullStackSize InterruptUIProcessIfBlockedOnErrorInBackgroundProcess NotifierStackSize SavedExtent StackSizeLimit WantsAnnotationPane'<br>
   poolDictionaries: ''<br>
   category: 'Tools-Debugger'!<br>
  <br>
  !Debugger commentStamp: 'mt 12/17/2019 12:19' prior: 0!<br>
  I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.<br>
  <br>
  Special note on recursive errors:<br>
  Some errors affect Squeak's ability to present a debugger.  This is normally an unrecoverable situation.  However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger.  Here is the chain of events in such a recovery.<br>
  <br>
   * A recursive error is detected.<br>
   * The current project is queried for an isolationHead<br>
   * Changes in the isolationHead are revoked<br>
   * The parent project of isolated project is returned to<br>
   * The debugger is opened there and execution resumes.<br>
  <br>
  If the user closes that debugger, execution continues in the outer project and layer.  If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world. <br>
  <br>
  ---<br>
  <br>
  In September 2019, we added MorphicDebugger and MVCDebugger to untangle framework-specific features in our debugger infrastructure. However, this is just an intermediate step. The overall goal would be to remove those two subclasses again while preserving their functionality. Mostly, MVC and Morphic differ in their GUI-process management. This means that "proceed" and "close" work differently depending on the process that is being debugged. --- One idea is to attach that framework-specific information to the process objects. See Process >> #environmentAt: and #environmentAt:put:. Also see ToolSet's #handle* and #debug* methods.!</p>
<p dir="ltr">Item was changed:<br>
  ----- Method: Debugger>>abandon (in category 'context stack menu') -----<br>
  abandon<br>
+   "close the debugger and terminate the debugged process"<br>
-       "abandon the debugger from its pre-debug notifier"<br>
   <br>
+   terminationMethod := #terminateAggressively.<br>
+   self close<br>
+ !<br>
-       self close.!</p>
<p dir="ltr">Item was changed:<br>
  ----- Method: Debugger>>initialize (in category 'initialize') -----<br>
  initialize<br>
  <br>
   super initialize.<br>
  <br>
   Smalltalk at: #MessageTally ifPresentAndInMemory: [ :tally |<br>
           tally terminateTimerProcess].<br>
  <br>
   externalInterrupt := false.<br>
   selectingPC := true.<br>
   <br>
+   contextStackIndex := 0.<br>
+   <br>
+   terminationMethod := #terminateAggressively "debugger's default termination method"!<br>
-       contextStackIndex := 0.!</p>
<p dir="ltr">Item was changed:<br>
  ----- Method: Debugger>>terminateProcess (in category 'context stack menu') -----<br>
  terminateProcess<br>
+   "close the debugger and terminate the debugged process"<br>
  <br>
+   terminationMethod := #terminate.<br>
+   self close<br>
+ !<br>
-       interruptedProcess terminate.<br>
-       interruptedProcess := nil.<br>
-       self close.!</p>
<p dir="ltr">Item was changed:<br>
  ----- Method: Debugger>>windowIsClosing (in category 'initialize') -----<br>
  windowIsClosing<br>
   "My window is being closed; clean up. Restart the low space watcher."<br>
  <br>
   contextStack := nil.<br>
   receiverInspector := nil.<br>
   contextVariablesInspector := nil.<br>
   <br>
   interruptedProcess == nil ifTrue: [^ self].<br>
+   [interruptedProcess perform: terminationMethod.<br>
+   interruptedProcess := nil] fork.<br>
-       interruptedProcess terminateAggressively.<br>
-       interruptedProcess := nil.<br>
   <br>
   Smalltalk installLowSpaceWatcher.  "restart low space handler"!<br></p>
</blockquote></div><br></div></div>
</div></blockquote>
                                        </div></body>