[squeak-dev] Wrong method source pointer in Squeak5.2

Marcel Taeumel marcel.taeumel at hpi.de
Mon Jan 21 13:00:04 UTC 2019

Hi, there.

Please find attached a changeset that fixes the process-restart issue in the release-building "process". :-)

1) long-living processes restarted in #cleanUp

[NEW] the timer interrupt watcher (see Delay)

2) short-living processes restarted in #startUp

[OK] the user interrupt watcher (see EventSensor)
[OK] the event tickler (see EventSensor)
[OK] the WeakArray finalization process (see WeakArray)

[OK] the low space watcher (see ProcessorScheduler)
[UPDATED] the idle process (see ProcessorScheduler)

3) extra, explicit restart in ReleaseBuilder (might be duplicate due to #cleanUp):

[NEW] the timer interrupt watcher (see ReleaseBuilder class >> #prepareProcesses)
[NEW] the UI process (see ReleaseBuilder class >> #saveAndQuit)

@Fabio: For our squeak-app we might want to adapt line 76 in https://github.com/squeak-smalltalk/squeak-app/blob/squeak-trunk/prepare_image.st [https://github.com/squeak-smalltalk/squeak-app/blob/squeak-trunk/prepare_image.st] to call "ReleaseBuilder saveAndQuit" or similar like lines 60 to 63.


Am 17.01.2019 13:40:59 schrieb Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:

Le jeu. 17 janv. 2019 à 08:48, Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]> a écrit :

Hi, there.

At the moment, processes (should) restart themselves (implicitely) through #cleanUp:. Is there consent that we should make this more explicit in the ReleaseBuilder? If so, when? After condensing changes? After recompiling all?

Normally, condenseChanges should just update the CompiledMethod trailer, not fully replace the method, unless I'm wrong?
A mixture of recompileAll followedBy condenseChanges will lead invariably to the bug mentionned by Max.
So without seeing code, my wild guess is that operations take place in this order.

So I would say that retarting process after recompileAll is mandatory.
If you want to be absolutely sure, or if my blind analysis is incorrect, do it after the latest of these two operations.


Am 16.01.2019 23:18:35 schrieb Eliot Miranda <eliot.miranda at gmail.com [mailto:eliot.miranda at gmail.com]>:
Hi Bert,

On Wed, Jan 16, 2019 at 1:24 PM Bert Freudenberg <bert at freudenbergs.de [mailto:bert at freudenbergs.de]> wrote:

IMHO the ReleaseBuilder should restart all processes.

And this is essential if there are any significant compiler changes (and there were with the inlining of repeat), because the system should be recompiled and for that to be effective all processes must be restarted.

- Bert -

On Sun, Jan 13, 2019 at 12:27 PM Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com [mailto:nicolas.cellier.aka.nice at gmail.com]> wrote:

Thanks Max,
good find!
There is certainly a problem in the release procedures.
We have to make sure that the CompiledMethod running are the one installed.
And we should restart the Process for which it's not the case.
How to proceed next?

I think it's a good subject to discuss in Squeak board.

Le dim. 13 janv. 2019 à 10:49, Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]> a écrit :

Hi, there.

At the moment, "SyntaxError" is not in harmony with the rest of exception handling and debugging. I do have some notes and ideas on how to improve that. Maybe these issues will go away then, too. :-)

I think, we miss a concept to have any kind of interactive tooling for any kind of exception. Right now, there is Debugger and SyntaxError. Etoys has an "Ooops!" dialog. :-) There could be more. Some fancy, some just informative.

Am 13.01.2019 07:59:01 schrieb Max Leske <maxleske at gmail.com [mailto:maxleske at gmail.com]>:
Hi Nicolas, hi Dave,
I did some more digging and found that the problem is actually present in (probably) every 5.2 image. It can easily be found by opening a fresh image and evaluating "self halt". In the debugger, click on "full stack" and scroll down to the first context (BlockClosure>>newProcess) and click on the entry. This will cause a SyntaxError dialog to open.
Closing both the SyntaxError dialog and the debugger makes the problem go away. The reason for this appears to be that opening the debugger as caused the UI process to be replaced with a new instance (the old instance was the one opened in the debugger). You can see this easily by evaluating "[ self halt ] fork" and clicking on the first stack frame, which will not cause the SyntaxError dialog to open. Alternatively, you could evaluate "Project current spawnNewProcessAndTerminateOld: true".
What I've discovered so far is that the problematic contexts in the UI process (there are multiple) are not the CompiledMethod instances installed in the respective classes. You can verify this by comparing "(BlockClosure>>#newProcess) identityHash" with the hash of the method in the context (select the third last frame, inspect the "thisContext" variable and evaluate "self sender sender method identityHash in that inspector"). After the UI process has been replaced those identity hashes are equal again.
The information in the "old/bad" CompiledMethod obviously points to a bad offset in the changes file.
I also now understand why this only affects the one specific test case: the test accesses the method node for each context in the current process, i.e. the UI process, which includes the bad contexts (access to the method node causes decompilation of the method which causes source access).
Please let me know when you've found a solution and also if I can be of more help.
We have an issue in Seaside where a loaded test method holds a bad source pointer. We only noticed because this method accesses the debugger map.
How to reproduce:
clone SmalltalkCI: git clone git at github.com [mailto:git at github.com]:hpi-swa/smalltalkCI.git
clone Seaside: git clone git at github.com [mailto:git at github.com]:SeasideSt/Seaside.git; git checkout 9cb54a7b14cd254ef318294905c4e8dda8dd9f79
install Seaside in Squeak5.2: <path to SmalltalkCI>/run.sh --headful -s Squeak-5.2 <path to Seaside>/.smalltalk.ston
Run the test WAPharoDebuggerTest>>testNamedTempAt and you'll see a debugger pop up for an UndeclaredVariable. The source lookup is performed in the changes file but in the middle of a chunk of binary (font) data.
I can can only speculate that some of that binary data introduces random chunks which messes with the offsets.
We're adding a workaround for that particular test for now.
Let me know if I can help track down the issue.



best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190121/793de360/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stack-fix.2.cs
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190121/793de360/attachment.ksh>

More information about the Squeak-dev mailing list