Just a note of interest, with all the debug checks set to OFF, this code compiles and runs. The code is not complete enough to know if it works properly or not though.

Is that to be expected under certain circumstances ?
EDIT: More Specifically it is the Stack check (-Ct ) that is causing the issue. It works fine when not used.
I am guessing this is because record types are on the stack and the debugger cannot catch up to what the program needs when stack checking is going on ?
Is this a bug ? FPC 3.2.2 from Ubuntu 24.04 LTS repo and Lazarus 4.2 built from GIT