I can just add a few guesses...
High CPU: start your lazarus from a terminal/console => then it may write debug output to the console. Maybe there is anything of interest in there.
Codetools: Have you got any 3rd party packages? Some use features of the Pascal language that codetool does not yet have (certain generics...).
Make sure you have no old files of an earlier fpc or lazarus installation.
Good advice. I did run from the terminal, but I wasn't focused on the CPU thing then, just the "codetool" issue, which was hurting my workflow.
I did have LazSerial installed (one the first packages I usually add) but after a clean install after deleting all traces of Lazarus I decided to try it without any extra packages and just opened a project that can compile and run without any external components. And, at first it seemed to work, but I triggered the problem soon enough. The steps are inconsistent, but usually is to first compile (not run), then place something on a form and clicking it to create a method. Then in the method, just write something that bring up code completion such as "val(". Then do this a few times, compiling, adding, writing something that triggers suggestions, and after any steps the problem occurs. I never need to run my programs, just fooling around in the IDE:
Anyhow, since this was hurting my productivity so bad (even if it still compiles and run, the caret often jumps to the "uses" lines at the top of the project, so I constantly get startled) that I called it quits and installed an older version (2.2.2) and I've used it the whole day without problems (and installing LazSerial).
Hi
I had that particular problem once...
In my case the root of the problem was a "double Free" deeply nested in my own code. But hunting for the reason always threw me deep in the implementation of lclQt?!? (the font-cache), and sometimes "uses"/"StdCtrls". Had nothing whatsoever to do with that... Errors like that can be wimsy and hard to find, that one got me at least 100 new gray hairs
Regards Benny
That's interesting, because it seems to be a wholly other "way" into the issue. I don't even need to run my own code, just open the project and "fooling around" with things on the form, writing things that triggers auto completion-suggestions or parameter lists. I can just start a new project and "adding stuff" without ever running it (so it's code that have never ever ran). I DO seem to need to compile it, but running is not necessary. So an double free on my part is, well, not the reason. But still interesting, as it may indicate some common cause in memory handling.
I have maybe another symptom I forgot to mention yesterday (didn't connect the two). When I open a project (old or created in 2.2.6) I sometimes get a message about the debugger. Something like "wasn't compiled with Ddwarf gtk2" (I didn't pay much attention and it just happens once per project it seems). Related?
In general terms, there is a know issue ("know" as in "has been observed", but not "why it happens").
This issue does cause such random errors, but usually only once in a very long time (once a month, if using the IDE daily). This issue has been around for many years (and despite various efforts the reason has not been found).
For it to happen every few minutes is new / different. => It most likely means that you have a source/pascal file somewhere, either in the wrong place, or with new fpc syntax that isn't supported by codetools.
Or you have some package installed in your IDE that is broken (could be any random package, totally unrelated to codetools and sources). If that package has a bug and causes memory to be incorrectly changed.
Or you recompiled your IDE with settings that trigger a bug in FPC.
Unfortunately the current released FPC (3.2.2) has some such bugs.
Rebuild your IDE with -O-1 and see if that improves anything.
(This is only if you did rebuild / e.g. when installing packages)
Okay, I may try this and investigate further in the future. Maybe I should have asked earlier (have battling with this a week) or not given up so soon after creating the thread, but I got so annoyed that I installed 2.2.2 (from SourcheForges .deb packages) and it seems to work without issues. The 2.2.6 version is "stock" from Debians repos. That made me so confused. I mean, I have had lazarus IDE problems before, but often there has been some tinkering first from my part with versions, packages, custom installs and whatnot. But this time it was just "apt-get install lazarus" and nothing more.
I shall do a mental note of this thread and promise to come back and check it and/or add info if I do new brave attempt at 2.2.6!
My sad and cowardly solution so far, downgrading, seems to work.
Thanks everyone for replies, even tho I chickened out! I usually expect no replies for my problems often seem so odd or unique (and English isn't my first language, so it's an effort to write).