Forum > Linux

Random "Codetools errors"/"unit not found StdCtrls" on fresh install 2.2.6 / deb

<< < (2/2)


--- Quote from: Martin_fr on August 09, 2023, 09:59:08 pm ---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.

--- End quote ---
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).

--- Quote from: cdbc on August 10, 2023, 05:29:10 am ---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  :D
Regards Benny

--- End quote ---
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?

--- Quote from: Martin_fr on August 10, 2023, 12:06:09 pm ---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)

--- End quote ---
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).

Errors are never random. They have a cause. Always programmer error.
Op. Cit. Hamlet again.


--- Quote from: Thaddy on August 11, 2023, 07:52:29 am ---Errors are never random. They have a cause. Always programmer error.
Op. Cit. Hamlet again.

--- End quote ---
Or HW issues.

Anyway, everyone knows errors always have causes. That doesn't make random errors non-random since random doesn't mean "without cause" (and no, we don't need any cleverness about say Copenhagen interpretation of quantum mechanics). I was kind of pleased by someone knowing this was a somewhat known issue as this at least rules out a completely different problem with completely different application being together with the IDE issue in a more systemic problem with the computer and/or OS. Everything here is new, and I always let trust in the computer and OS build over time so when problem arrives with a new setup, new installed OS and a new installed application, it's easy to start casting wide nets and running memtest86, prime95 and such for hours in order to rule out HW issues than looking for specific problems with the specific application. As I said before, I was a bit late to start this thread since I've thrown away much time in "wide net" searches because my computer is new. And it simply could not be my own code, since my program never needs to run (or be anything other a default form with a button) and the LazSerial package was ruled out too.

Second day of 2.2.2, no hint of any problems yet, everything seems fine.

Are you sure you didn't introduce some (involontary) error in the lazarus source code.

See Topic Ctrl-click is not working for some projects,,63820.0.html

As I wrote: "Random errors" do not exist. (Are not supposed to) That does not mean that the  end user made the error, it means that the complete package of code contains an error. That may have been caused by you or may have been caused deep inside libraries or the compiler itself.


[0] Message Index

[*] Previous page

Go to full version