Recent

Author Topic: How to analyze / debug compiler crashes?  (Read 436 times)

SirTwist

  • New Member
  • *
  • Posts: 28
Re: How to analyze / debug compiler crashes?
« Reply #15 on: June 21, 2026, 03:44:24 pm »
FPC 3.3.1 (maybe even 3.2.3) had some fixes around ppu loading. But you then need to adapt any code that doesn't compile.
3.2.3 would be preferable as it likely is more stable.

Yes, I upgraded to 3.3.1, but some external components wouldn't compile (BGRA, EyeCandy Controls, ...)
I downgraded to 3.2.3 and the crashes still ocure.

Quote
Have you tried to really remove **all** ppu from all folders/packages before the build?
Yes, before posting initially.

Quote
In general such errors have in part been known to be caused by circular unit references (uses in implementation). You may want to try to get rid of them if you can. (I know, easier said ...)
That might be a problem, or THE problem. My units are heavily cross linked. I try to clean this up as far as I get. Thank you!

Okay, Update: I tried to remove the dependencies (in the implementation part) and the crash now ocures on other files. I count that as progress...

Code: [Select]
¨BÆiø'mUUlcDmxUniverses.pas(361,53899) Error: Duplicate identifier "UlcPrjObjEditors"
¨BÆiø'mUUlcDmxUniverses.pas(361,53899) Hint: Identifier already defined in UlcDmxUniverses.pas at line 9
¨BÆiø'mUUlcDmxUniverses.pas(361,53899) Error: Compilation raised exception internally

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 456
  • I use FPC [main] 💪🐯💪
Re: How to analyze / debug compiler crashes?
« Reply #16 on: June 21, 2026, 05:32:22 pm »
How to analyze / debug compiler crashes?
It may also be helpful to try to reduce the project to a minimal reproducible example.
Or, at the very least, to a state where it can be made publicly available, if it’s a closed-source project.
Or, if it’s open source, at least provide a link to the source code and instructions on how to reproduce the bug.
I may seem rude - please don't take it personally

SirTwist

  • New Member
  • *
  • Posts: 28
Re: How to analyze / debug compiler crashes?
« Reply #17 on: June 21, 2026, 05:33:46 pm »

@Martin_fr and @Thaddy thanks for your input. I've now created a completly senseless project with just 30 units, and I wanted to irrationally cross link those units. But already with a generic definition in the first Unit "UTest01" and using that in "UTest02" is crashing the compiler. Tested with 3.2.3, currently fpcupdeluxe is installing 3.3.1.
I will raise a bug report.

Fibonacci

  • Hero Member
  • *****
  • Posts: 1029
  • Behold, I bring salvation - FPC Unleashed
Re: How to analyze / debug compiler crashes?
« Reply #18 on: June 21, 2026, 05:42:10 pm »
It does crash 3.2.2, but not 3.3.1 trunk/main.
FPC Unleashed: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub

SirTwist

  • New Member
  • *
  • Posts: 28
Re: How to analyze / debug compiler crashes?
« Reply #19 on: June 21, 2026, 06:46:34 pm »
It does crash 3.2.2, but not 3.3.1 trunk/main.

Thank you for trying it out!
Lazarus 4.9 (rev a181bda46a) FPC 3.2.3 x86_64-win64-win32/win64
is also crashing.

I have raised a bug report. Thank you all!

Fibonacci

  • Hero Member
  • *****
  • Posts: 1029
  • Behold, I bring salvation - FPC Unleashed
Re: How to analyze / debug compiler crashes?
« Reply #20 on: June 21, 2026, 06:52:14 pm »
Good luck - though the official 3.2.4 will probably take years to land, and may not even include the fix you need. I'd just use trunk and adjust your project to work with the latest trunk instead.
FPC Unleashed: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub

jamie

  • Hero Member
  • *****
  • Posts: 7832
Re: How to analyze / debug compiler crashes?
« Reply #21 on: June 21, 2026, 07:09:16 pm »
The recircle reference is the problem in the implementation section of unit01, remove the reference to unit02 and it's ok.

So, there are issues with generics in that respect.

P.S.
 Corrected, sorry.

Jamie
« Last Edit: June 21, 2026, 07:11:01 pm by jamie »
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018