Skip to content

Compiler gives internal error or Access Violation while compiling complex project with generics or/and helpers

Summary

Now, we porting the project from Delphi to Lazarus (our goal is native Linux). The project has many generics and helpers in the code.

So, sometime when I "compile" the project (not "build"), I got internal compiler error or just AccessViolation.

System Information

  • Operating system: Alt.Linux 10.1
  • Processor architecture: x86-64
  • Compiler version: 7dcd89ed
  • Device: PC

Steps to reproduce

Unfortunately, I unable to reproduce an issue on small project. It seems the issue is related to complex cross-references between units + generics types.

Anyway, we've debug the compiler and found few issues that related to "reset" the module while re/loading ppu files. Some references/fields are not reset properly that may lead to AV on attempt to use it.

Possible fixes

Here suggested changes that solves the issue: 0.fpc_IE_in_generic_helper_and_inprementation_const.patch

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information