On 29/11/2019 17:27, Bo Berglund via lazarus wrote:
I also wonder exactly what you meant for me to do above concerning the
debug-log?
Do you mean for me to use that command inside gdb to start lazarus?
In that case I also need to set the --pcp option, right?

Or did you mean it as an alternative test to what I tried just before
with a *regular* start but with lazarus rather than startlazarus?

I.e. in terminal:
/home/pi/dev/lazarus/2.6.0/lazarus --pcp=/home/pi/.lazarus_2.0.6
--debug-log=/home/pi/log/good-log.txt  > /home/pi/log/bad-log.txt


As an alternative test, with a command line as you wrote above.

Background (not sure if it applies on all OS....):
- If you start a GUI app from your desktop it usually has no stdout/stdin. Those handles are closed. - If you use write/read on such a closed handle, then that usually leads to a crash. - Most code in Lazarus uses the debug logger, which only writes to stdout if it is open

When you start from gdb, gdb has stdin/out => and lazarus inherits those handles. "write" will therefore be fine.

In the above "--debug-log" you redirect all the safe output to one file (which you can periodically clean), and leave any other "writeln" output to go to the other file.

If you check "bad-log" for any content, then we will know if (and even what) was written in a maybe un-safe way (the code could still be governed by appropriate checks, but that could be verified). Also knowing where such text is written, it could be asserted if it might be related to mouse clicks (or other actions)  in the source editor.

Of course this is just a guess. But it may be worth following it through.

The only odd part is, that if there was such a writeln, I would expect a lot more people having problems.... But one never knows. Maybe something particular in your code causes this "write". Or a package added to the IDE....
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to