Skip to content

AV in compiler (generics + circular unit references)

Summary

Here is a project on which the compiler crashes with Access Valition. The problem is that in procsym.ProcDefList there are broken references to procdef. In free_unregistered_localsymtable_elements when procdef is deleted it is removed from sym.ProcDefList, but this happens only for those procdefs that are in tmodule.localsymtable. But with the test project you can see that in the chain "tmodule.localsymtable -> trecorddef -> trecord.symtable -> tprocdef -> tprocdef.localst -> tprocdef" the last procdef is deleted but not removed from the tprocsym.ProcDefList, as a result later the compiler crashes with AV when accessing a dangling reference

System Information

  • Operating system: Linux
  • Processor architecture: x86-64
  • Compiler version: trunk abcced55
  • Device: Computer

Steps to reproduce

Try to build example project

Example Project

1.zip

What is the current bug behavior?

Compiler crashes with AV

What is the expected (correct) behavior?

Project should be compiled successfuly

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