[squeak-dev] The Trunk: ToolsTests-ct.107.mcz

Jaromir Matas mail at jaromir.net
Sun May 22 12:26:27 UTC 2022


Hi Christoph,
I'm enclosing fixed tests 19 and 20 with the test block you suggested and an updated Debugger fix for your review (This is how I think the debugger's Abandon/Terminate should work but you may come up with a better implementation).
Hope this helps :)
Best,


--

Jaromír Matas

mail at jaromir.net

From: Jaromir Matas<mailto:mail at jaromir.net>
Sent: Saturday, May 21, 2022 11:19
To: The general-purpose Squeak developers list<mailto:squeak-dev at lists.squeakfoundation.org>; christoph.thiede at student.hpi.uni-potsdam.de<mailto:christoph.thiede at student.hpi.uni-potsdam.de>
Subject: Re: [squeak-dev] The Trunk: ToolsTests-ct.107.mcz

Hi Christoph,

I enclose a fix for the Debugger issue mentioned below, i.e. the inconsistent behavior when terminating the Debugger – whether via Abandon or via `terminate process`; the only difference between the two should be the choice of the termination method. Currently each of them uses a different execution path leading to an erroneous behavior when terminating the Debugger via `terminate process`.

Thanks for taking a look at this. Would you like me to send it to the Inbox?

Best,


--

Jaromír Matas

mail at jaromir.net

From: Jaromir Matas<mailto:mail at jaromir.net>
Sent: Friday, May 20, 2022 16:49
To: The general-purpose Squeak developers list<mailto:squeak-dev at lists.squeakfoundation.org>; christoph.thiede at student.hpi.uni-potsdam.de<mailto:christoph.thiede at student.hpi.uni-potsdam.de>
Subject: Re: [squeak-dev] The Trunk: ToolsTests-ct.107.mcz

Hi Christoph,

sorry to be a pest: this issue has likely escaped your attention and has recently reemerged in Lauren's test runner report :)
thanks :)

best,
Jaromir


--

Jaromír Matas

mail at jaromir.net


From: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> on behalf of mail at jaromir.net <mail at jaromir.net>
Sent: Monday, January 10, 2022 8:21:14 PM
To: squeak-dev at lists.squeakfoundation.org <squeak-dev at lists.squeakfoundation.org>; christoph.thiede at student.hpi.uni-potsdam.de <christoph.thiede at student.hpi.uni-potsdam.de>
Subject: Re: [squeak-dev] The Trunk: ToolsTests-ct.107.mcz

Hi Christoph,

yes, the expectations for this block are just right :)

I tried to put the block in the testcase but the error windows that pop up behave a bit erratically - I guess it's because of the debugger #windowIsClosing issue described in: (and as a consequence some of the other assertions fail)

http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-December/217724.html

I think all three modes of closing the debugger (destroy, aggressively, normally) should be treated equally to avoid such unexpected side effects. Please review the above and let me know what you think.

Thanks!

best,
~~~
^[^    Jaromir

Sent from Squeak Inbox Talk

On 2022-01-10T19:53:09+01:00, christoph.thiede at student.hpi.uni-potsdam.de wrote:

> Hi Jaromir,
>
> you're totally right, sorry for the confusion. How would you think about this test block instead?
>
>        [[x := 1] ensure:
>                [[y := 1.
>                self error: #first.
>                y := 2] ensure:
>                        [z := 1.
>                        self error: #second.
>                        z := 2]].
>        x := 2] value.
>
> If you abandon #first and proceed #second, {x. y. z} will be correctly #(1 1 2).
> If you terminate #first and proceed #second, {x. y. z} should be #(1 2 2).
>
> Would you agree with that? :)
> If yes, I will upload this to the Trunk, try to make the tests more self-explaining, and comment out the #isTerminated assertions for now.
>
> Best,
> Christoph
>
> ---
> Sent from Squeak Inbox Talk
>
> On 2022-01-03T16:23:01+01:00, mail at jaromir.net wrote:
>
> > Hi Christoph,
> >
> > I'm pretty sure this test (test20TerminateProcess) isn't working correctly; the expectations are set as if testing debugger's Proceed, not Terminate. Debugger terminate in this scenario will be answering identically as Abandon because you proceed through the second error inside the ensure argument block :)
> >
> > Thanks,
> >
> > best,
> > ~~~
> > ^[^    Jaromir
> >
> > Sent from Squeak Inbox Talk
> >
> > On 2021-12-19T18:56:48+01:00, mail at jaromir.net wrote:
> >
> > > Hi Christoph,
> > >
> > > I have tested your test20TerminateProcess and I think the expectations are not set correctly:
> > >
> > > If you run your nice test-block in a workspace
> > >
> > > ����[x := 1.
> > > ����[y := 1.
> > > ����self error: #first.
> > > ����y := 2] ensure:
> > > ��������[z := 1.
> > > ��������self error: #second.
> > > ��������z := 2].
> > > ����x := 2] value
> > >
> > > it answers correctly {x. y. z} = #(1 1 2) for both Abandon and terminate options (if you Abandon or terminate the first error outside the ensure block and Proceed the second error inside the ensure block; there are no unfinished unwind blocks present when termination happens and the two mode of termination end identically).
> > >
> > > Please check I understand the test intention correctly (I haven't decoded all the fine details yet but thanks for inspiration!).
> > >
> > > FYI, I've uploaded 4 tests complementing your ones (ToolsTests-jar.109)
> > >
> > > Also, with regard to the latest conversation about multiple terminations / resumptions in http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-December/217695.html I'd like to ask you to wait with assertions about isTerminated until the issue is resolved. At the moment isTerminated is either not 100% truthful and answers yes during termination or is unprotected against multiple termination issue.
> > >
> > > Best,
> > >
> > >
> > > ~~~
> > > ^[^    Jaromir
> > >
> > > Sent from Squeak Inbox Talk
> > >
> > > On 2021-12-16T01:38:57+00:00, commits at source.squeak.org wrote:
> > >
> > > > Christoph Thiede uploaded a new version of ToolsTests to project The Trunk:
> > > > http://source.squeak.org/trunk/ToolsTests-ct.107.mcz
> > > >
> > > > ==================== Summary ====================
> > > >
> > > > Name: ToolsTests-ct.107
> > > > Author: ct
> > > > Time: 16 December 2021, 2:29:44.341664 am
> > > > UUID: 6b771eec-03fe-0a4d-91c9-50480d259573
> > > > Ancestors: ToolsTests-mt.106
> > > >
> > > > Complements Kernel-ct.1434 (revised termination modi on Process). Adds end-to-end tests for abandoning vs. terminating a debugger inside an active unwind context. Makes proper use of new termination modi in clean-ups for other tests.
> > > >
> > > > =============== Diff against ToolsTests-mt.106 ===============
> > > >
> > > > Item was changed:
> > > >   ----- Method: DebuggerTests>>tearDown (in category 'running') -----
> > > >   tearDown
> > > >
> > > >   ����debugger ifNotNil: [debugger close].
> > > > + ����process ifNotNil: [process terminateAggressively].
> > > > - ����process ifNotNil: [process terminate].
> > > >   ����
> > > >   ����process := nil.
> > > >   ����debugger := nil.
> > > >   ����window := nil.
> > > >
> > > >   ����reset do: #value.����
> > > >   ����
> > > >   ����super tearDown.!
> > > >
> > > > Item was changed:
> > > >   ----- Method: DebuggerTests>>test16HandleSimulationError (in category 'tests') -----
> > > >   test16HandleSimulationError
> > > >   ����"Regression test. In the past, the scenario below led to an infinite debugger chain freezing your image. Be careful when running this test in an unpatched image!! For more information, see http://forum.world.st/I-broke-the-debugger-td5110752.html."<http://forum.world.st/I-broke-the-debugger-td5110752.html.%22>
> > > >
> > > >   ����| userProcess |
> > > >   ����process := Process forBlock: [
> > > >   ��������"the faulty user code"
> > > >   ��������thisContext pc: nil].
> > > >   ����debugger := process debug.
> > > >   ����
> > > >   ����[userProcess := [debugger stepThrough] fork.
> > > >   ����Processor yield.
> > > >   ����
> > > >   ����self deny: [process isTerminated].
> > > >   ����self assert: [userProcess isSuspended]]
> > > >   ��������
> > > >   ��������ensure: [
> > > > + ������������process destroy.
> > > > - ������������process suspendedContext: nil; terminate.
> > > >   ������������debugger close.
> > > >   ������������process := userProcess.
> > > >   ������������self findDebugger "for correct tearDown"].!
> > > >
> > > > Item was changed:
> > > >   ----- Method: DebuggerTests>>test17HandleBlockCannotReturn (in category 'tests') -----
> > > >   test17HandleBlockCannotReturn
> > > >   ����"Regression test. In the past, the scenario below led to an infinite debugger chain freezing your image. Be careful when running this test in an unpatched image!! For more information, see http://forum.world.st/I-broke-the-debugger-td5110752.html."<http://forum.world.st/I-broke-the-debugger-td5110752.html.%22>
> > > >
> > > >   ����| userProcess |
> > > >   ����process := Process forBlock: [
> > > >   ��������"the faulty user code"
> > > >   ��������[] ensure: [thisContext privSender: nil]].
> > > >   ����debugger := process debug.
> > > >   ����
> > > >   ����[userProcess := [debugger stepOver] fork.
> > > >   ����Processor yield.
> > > >   ����
> > > >   ����self assert: [process isTerminated].
> > > >   ����self deny: [userProcess isRunnable]]
> > > >   ��������
> > > >   ��������ensure: [
> > > > + ������������process terminateAggressively.
> > > > - ������������process terminate.
> > > >   ������������debugger close.
> > > >   ������������process := userProcess.
> > > >   ������������self findDebugger "for correct tearDown"].!
> > > >
> > > > Item was changed:
> > > >   ----- Method: DebuggerTests>>test18HandleNestedBlockCannotReturn (in category 'tests') -----
> > > >   test18HandleNestedBlockCannotReturn
> > > >   ����"Regression test. In the past, the scenario below led to an infinite debugger chain freezing your image. Be careful when running this test in an unpatched image!! For more information, see http://forum.world.st/I-broke-the-debugger-td5110752.html."<http://forum.world.st/I-broke-the-debugger-td5110752.html.%22>
> > > >
> > > >   ����| metaProcess metaDebugger userProcess |
> > > >   ����process := Process forBlock: [
> > > >   ��������"the faulty user code"
> > > >   ��������[] ensure: [thisContext privSender: nil]].
> > > >   ����debugger := process debug.
> > > >   ����metaProcess := Process forBlock: [
> > > >   ��������debugger stepOver].
> > > >   ����metaDebugger := metaProcess debug.
> > > >   ����
> > > >   ����[userProcess := [metaDebugger stepOver] fork.
> > > >   ����Processor yield.
> > > >   ����
> > > >   ����self assert: [process isTerminated].
> > > >   ����self deny: [userProcess isRunnable]]
> > > >   ��������
> > > >   ��������ensure: [
> > > > + ������������process terminateAggressively.
> > > > - ������������process terminate.
> > > >   ������������debugger close.
> > > > + ������������metaProcess terminateAggressively.
> > > > - ������������metaProcess terminate.
> > > >   ������������metaDebugger close.
> > > >   ������������process := userProcess.
> > > >   ������������self findDebugger "for correct tearDown"].!
> > > >
> > > > Item was added:
> > > > + ----- Method: DebuggerTests>>test19Abandon (in category 'tests') -----
> > > > + test19Abandon
> > > > + ����"When the debugger is abandoned, the interrupted process is terminated aggressively, i.e., all not yet started unwind contexts are executed. Further errors that occur during unwinding lead to another debugger showing up. This is the acceptance test equivalent for ProcessTest >> #testTerminateNestedUnwindAggressively."
> > > > +
> > > > + ����| x y z userProcess |
> > > > + ����process := Process
> > > > + ��������forBlock:
> > > > + ������������[x := 1.
> > > > + ������������[y := 1.
> > > > + ������������self error: #first.
> > > > + ������������y := 2] ensure:
> > > > + ����������������[z := 1.
> > > > + ����������������self error: #second.
> > > > + ����������������z := 2].
> > > > + ������������x := 2]
> > > > + ��������runUntil: [:ctx | y = 1].
> > > > + ����self should: {x. y. z} = {1. 1. nil}.
> > > > + ����debugger := process debug.
> > > > + ����
> > > > + ����userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
> > > > + ����Processor yield.
> > > > + ����self findDebugger.
> > > > + ����
> > > > + ����self deny: process isTerminated.
> > > > + ����self assert: userProcess isTerminated.
> > > > + ����self deny: debugger isNil.
> > > > + ����self assert: {1. 1. nil} equals: {x. y. z}.
> > > > + ����self assert: (debugger containingWindow label includesSubstring: #first).
> > > > + ����
> > > > + ����userProcess := [debugger abandon] forkAt: Processor activePriority + 1.
> > > > + ����Processor yield.
> > > > + ����self findDebugger.
> > > > + ����
> > > > + ����self deny: process isTerminated.
> > > > + ����self assert: userProcess isTerminated.
> > > > + ����self deny: debugger isNil.
> > > > + ����self assert: {1. 1. 1} equals: {x. y. z}.
> > > > + ����self assert: (debugger containingWindow label includesSubstring: #second).
> > > > + ����
> > > > + ����userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
> > > > + ����Processor yield.
> > > > + ����self findDebugger.
> > > > + ����
> > > > + ����self assert: process isTerminated.
> > > > + ����self assert: userProcess isTerminated.
> > > > + ����self assert: debugger isNil.
> > > > + ����self assert: {1. 1. 2} equals: {x. y. z}.!
> > > >
> > > > Item was added:
> > > > + ----- Method: DebuggerTests>>test20TerminateProcess (in category 'tests') -----
> > > > + test20TerminateProcess
> > > > + ����"When the debugger's process is terminated, all unwind contexts, including already entered ones, are executed. Further errors that occur during unwinding lead to another debugger showing up. This is the acceptance test equivalent for ProcessTest >> #testTerminateNestedUnwind."
> > > > +
> > > > + ����| x y z userProcess |
> > > > + ����process := Process
> > > > + ��������forBlock:
> > > > + ������������[x := 1.
> > > > + ������������[y := 1.
> > > > + ������������self error: #first.
> > > > + ������������y := 2] ensure:
> > > > + ����������������[z := 1.
> > > > + ����������������self error: #second.
> > > > + ����������������z := 2].
> > > > + ������������x := 2]
> > > > + ��������runUntil: [:ctx | y = 1].
> > > > + ����self should: {x. y. z} = {1. 1. nil}.
> > > > + ����debugger := process debug.
> > > > + ����
> > > > + ����userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
> > > > + ����Processor yield.
> > > > + ����self findDebugger.
> > > > + ����
> > > > + ����self deny: process isTerminated.
> > > > + ����self assert: userProcess isTerminated.
> > > > + ����self deny: debugger isNil.
> > > > + ����self assert: {1. 1. nil} equals: {x. y. z}.
> > > > + ����self assert: (debugger containingWindow label includesSubstring: #first).
> > > > + ����
> > > > + ����userProcess := [debugger terminateProcess] forkAt: Processor activePriority + 1.
> > > > + ����Processor yield.
> > > > + ����self findDebugger.
> > > > + ����
> > > > + ����self deny: process isTerminated.
> > > > + ����self assert: userProcess isTerminated.
> > > > + ����self deny: debugger isNil.
> > > > + ����self assert: {1. 2. 1} equals: {x. y. z}.
> > > > + ����self assert: (debugger containingWindow label includesSubstring: #second).
> > > > + ����
> > > > + ����userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
> > > > + ����Processor yield.
> > > > + ����self findDebugger.
> > > > + ����
> > > > + ����self assert: process isTerminated.
> > > > + ����self assert: userProcess isTerminated.
> > > > + ����self assert: debugger isNil.
> > > > + ����self assert: {2. 2. 2} equals: {x. y. z}.!
> > > >
> > > >
> > >
> > >
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220110/4124c75c/attachment-0001.html>
>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220522/16ed562f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C0B90C668DF34354B916DE09AD031CDF.png
Type: image/png
Size: 144 bytes
Desc: C0B90C668DF34354B916DE09AD031CDF.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220522/16ed562f/attachment.png>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Debugger.jar.2.cs
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220522/16ed562f/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: DebuggerTests19-20_fixed.jar.1.cs
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220522/16ed562f/attachment-0001.ksh>


More information about the Squeak-dev mailing list