[Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Martin Frb lazarus at mfriebe.de
Sat Aug 17 22:32:10 CEST 2019


On 17/08/2019 21:52, Bo Berglund via lazarus wrote:
> On Sat, 17 Aug 2019 18:43:01 +0200, Martin Frb via lazarus
> <lazarus at lists.lazarus-ide.org> wrote:
>
>> That means, that this install of Lazarus has either not yet encountered
>> the error, or that the "editormacroscript.xml" was deleted/reset (i.e.
>> error removed from content).
> Could not the actions reported on first start do just that and this is
> what causes the message not to reappear?
If it displays an error, it should create the xml file, and put the 
error into it. That will then stop it from testing again, and therefore 
the error does not happen again.

When you start a newly installed IDE, do you rebuild it (to get your 
packages back?) Then maybe the rebuild on works.
But that would still leave me wonder, what removed the error from the file.


>> ( editormacroscript.xml is in your primary config path. You can find
>> where that is from the menu: View > IDE Internals > About IDE )
> I found it and it contains basically nothing:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <CONFIG/>
Which means no error...


>
>> Anyway if scripting is active, then the self test runs at every start of
>> your IDE. And that leaves the question why it does not report the error
>> anymore. (and when the editormacroscript.xml was deleted/reset)
> Yes, why?

PascalScript can (and needs to) interact with compiled code.
For example the instance of a SourceEDitor SynEdit (with limited access) 
is passed to any macro. The macro can call functions on this SynEdit and 
interact with it.

Because PascalScript is compiled without knowing of all the method 
signatures it may have to deal with, it actually has no code to call them.
Methods are registered at runtime.
If they need to be called, PS manually builds the stack (and cpu 
registers) that the called method would expect. This must match exactly 
what fpc would have done at compiletime.
(there is a 2nd callling method / awaits more testing)

If that goes wrong (maybe fpc changed....), then the behaviour will be 
undefined. the code is called with trashed data....
To avoid happening that while working in the IDE, there is a selftest at 
startup.

Before the selftest starts, it will write that to the xml file.
So if the test crashes, never finishes, then the file says "I am in 
testing".
If at start the xml is found to be "in testing", then this is reported 
as "last test failed" and disables PS.

So your IDE did not crash, as the file is not "in testing" and you said 
you did not use the reset button.

If the test fails, it is reported and written to the XML.
If it succeeds the xml is updated to have nothing in it.

So the self test runs on each start up (since the IDE could have been 
recompiled).
The only way for it not to run, is if it failed or crashed.




More information about the lazarus mailing list