I do not know how exactly fpc 3.0.4 maps the line numbers during specialization.... (Its a bug in 3.0.4)
If you move in your unit, the "specialize" to another line, does the error occur at the same line? Or does in move?
In other words, I do not know if line 996
- is fgl.pas line 996
- or fgl.pal line 996 minus the line of the specialize in your unit.
I would guess the first.
Assuming
TAppList = specialize TFPSList<...>
then
"While idx < Count"
would segfault if self was nil. Or if self was some other uninitialized value (that points to mem not belonging to your app)
So the issue would be in the caller.
assert(self <> nil);
But only if it is not trash...
debugln('Self in GetAPP %u', [PtrUInt(Self)]);
https://wiki.lazarus.freepascal.org/LazLogger