[Cuis-dev] Debugger Bug - Through can make system to hang up
Santiago Dandois
santids97 at gmail.com
Wed Dec 4 14:55:17 PST 2019
Hi, everyone
I wanted to report a bug (which I found in unfortunately circumstances,
during an exam). This can make the image freeze, and in some cases, you end
up loosing your unsaved changes.
*Reproducing the bug*
To reproduce the bug, you can:
1. Create a class BugTests that sub-classifies TestCase
2. Make a test with the code:
self fail.
3. Run the test, which should open the debugger since the test fails.
4. Click "Restart"
5. Click "Through"
The system should hang.
*Research made*
After making some research, I found out that the problem comes from
Process>>stepToHome: context method.
This method basically makes the suspendedContext to step many times in a
loop, until the suspendedContext and aContext "home contexts" are the same.
The problem comes when suspendingContexts execution signals an Exception,
in which case, suspendedContext and aContext home are never equal. Luckily,
there is "a really nice if" which, long story made short, checks if an
UnhandledError has been signaled, in which case, the method returns the
context in which was signaled.
Now, there is another issue. TestCase>>fail signals a TestFailure
exception, which sub-classifies Exception, but as opposed to Error, the
defaultAction is not to signal an UnhnadledError, but to to open the
debugger.
It is for this reason, that the stepToHome loop never finishes.
*Quick Solution*
A quick solution I found was to change TestFailure>>defaultAction to be the
same that Error>>defaultAction. However, with this solution, the problem
will rise again every time a Exception implements its defaultAction method
doing something else.
I've attached the change to TestFailure.
I hope you find this contribution useful.
Cheers, Santiago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191204/3d7e3e54/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3959-CuisCore-SantiagoJoseDandois-2019Dec03-18h00m-sjd.1.cs.st
Type: application/octet-stream
Size: 185 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191204/3d7e3e54/attachment.obj>
More information about the Cuis-dev
mailing list