Lazarus
Programming => General => Topic started by: zoltanleo on September 30, 2022, 10:43:26 am
-
Preamble: I hesitated to create this topic for a long time, but too often a mistake makes me do it.
So, for about 1 year now, I've been seeing a project build error that always points to the same module. She appears from time to time. When rebuilding an unmodified project, the error does not appear and the project starts without errors. As the project grows, the error shows up more often.
The error appears regardless of whether I first build the project (Shift + F9) or immediately run with debugging (F9).
I get this error on any platform I run the project on (Win x64/Debian 11 (gtk2/qt5)/Darwin (Monterey))
I ask the main maintainers to look at what is the likely cause of the bug. Not sure if I can reproduce this error in a test project. Therefore, I am ready to give the maintainers full access to the source code in a private repository.
I hope for your attention.
I use:
FPC revision: git_start-3099-g8c9a07a3e8
Lazarus revision: main-2_3-2276-g1c7122b6ca
-
One question, one suggestion.
When you have the error, are a Run -> Compile and Run -> Build consistent? What happens if you do a File -> Clean Directory... first? There is an extremely elusive problem that some of us have seen but is similarly difficult to track down, possibly related to having pathnames in compiler options and/or uses clauses.
Please edit your message to put the compiler version etc. in the body, not in your signature. Having it in your sig is the worst possible place, since when you change your sig there will no longer be an indication in this thread of what version you're using which makes it worse than useless when Google or the forum's search facility brings somebody else here.
MarkMLl
-
Hi MarkMLl.
Thanks for the hints. I will correct the first post and add new details a bit later. I am currently away from my PC
-
From my experience, when you are working a lot with generics, the "compilation raised exception internally" is something you encounter regularly as soon as the project grows large enough. But on the bright side you get used to. Often the "fix" is just to move a few things around in different units, make un-nest things, move functions from your class into class helpers, etc.
With a bit trial and error you can get around this
-
Please edit your message to put the compiler version etc.
Done
-
From my experience, when you are working a lot with generics, the "compilation raised exception internally" is something you encounter regularly as soon as the project grows large enough. But on the bright side you get used to.
Hi Warfley.
I do use generics quite often in my project. And I also had some hunches about generics. But I don't use generics in the exact unit where I get the error.
-
1. provide compilable code
2. if that is not possible provide code that does not compile but you expect to compile.
3. No code, no answers.
-
Hi Thaddy
In the initial post, I wrote that the project is private and I would not like to post it to the public. I'm not sure if I can reproduce the issue on a test project. But I can link to it for just about anyone who wants to look at the code.
I sent you a link to the archive with the project in the PM
-
could it be ptrint , using negative numbers,
https://www.freepascal.org/docs-html/rtl/system/ptrint.html
-
could it be ptrint , using negative numbers,
https://www.freepascal.org/docs-html/rtl/system/ptrint.html
Hi Josh
Thanks for the idea. I have made some corrections in the code. So far no errors have appeared. But I will be watching for some time.
Upd: I have to report that the errors are still repeated. :'(
-
Build fpc with debug information and give the error stack. Also you need make a minimal example reproducing the bug
-
Is the error there when compiled with all optimization levels?
Any particular compiler options used, that could be causing the issue.
-
Hi Josh.
I answered to PM