Frank Heckenbach wrote:
Waldek Hebisch wrote:
Adriaan van Os wrote:
procedure Finalize1; begin FlushAllFiles; RestoreTerminal (True); Done_Files; if ErrorMessageString <> '' then WriteStackDump end;
Does Done_Files also operate on StdErr ?? The crash disappears if I comment out the Done_Files call;
It looks so (Frank knows better). Good catch.
Ouch! Yes, `WriteErrorMessage' accesses (via `FileHandle') a field of already disposed `StdErr' variable -- an evil bug, as it happens to work often (especially if the field is in the middle of a bigger structure, as is the case here), so it wasn't noticed so far. But, of course, it's wrong, and now it crashed ...
`Done_Files' probably should go after `WriteStackDump'.
Yes, try swapping the two statements.
It works OK now. Don't we need a testsuite program to test for proper handling of runtime errors ? The rts problem went unnoticed in the previous alpha version. Not sure how to do that. Cause a runtime error and then check the exit code in a shell script ?
Regards,
Adriaan van Os