Between the "begin" of the project (
dpr file), which is Entry Point, the execution point when the application get control, and the very next line/code there is hidden InitExe function, it will initialize the app, duh, but also will initialize the Units, this is what i suspect is your problem.
The symptoms, is most likely coming form uninitialized variable, where sometimes it is zeroed and it will work fine and later there is different values, leading to heap corruption, by heap corruption i mean the faulty code had written oven many global and most likely (because you are lucky in this case) it overwritten the pipes, otherwise it will be hidden there and very hard to fix.
suggestion:
1) build a small
unit with initialization clause.
2) put it as first in the
dpr file.
3) make it do Write/Writeln , see if there is an output, if there then you know for sure that there is an abuse in initialization clauses in you other units.
4) Double check your class constructors, if they are expecting some sort of singleton and they are wrong.
On side note, your
exception report, showing 5 threads other than the main, what are they ? where did they come from ?