Maybe a 3rd party package has optimization on??
Project >Project Options > Additions and Overrides
- "stored in project"
- Add > New Target
enter: *
- Add > custom option
enter: -O- -gw
This will rebuild all packages with no optimization and with debug info.
(except for the RTL / fcl packages)
I've searched for [OnChange] events, of which there are 12, but only one visible on the main Form at start up (and therefore has the 'DATA Not Initialized' test). -- The offending object is a TDateEdit -- By putting a breakpoint in that OnChange Proc. I've discovered that it is being fired before the Application.Run (which would show the main Form)!
Before Application.run is strange. (before Form.Oncreate would be possible)
Do you have the trace for that?
When you look at the frames, going back from your proc, to the caller, and then to the caller's caller ......
Does each Caller actually have an invocation for the called callee?
Or is the (displayed) stack corrupt?
Continued below....
I commented out the call to display the 'DATA Not Initialized' message - though still exiting the proc. - but (predictably) it still ends up at the 331 Error. - which I still have no knowledge of - 
Do you have an FPC/RTL build with debug info? Then you could set a breakpoint in the "exit" code
E.g. in unit system
Procedure fpc_do_exit;[Public,Alias:'FPC_DO_EXIT']; compilerproc;
How is it possible for a procedure buried deep in the .PAS file (line 7061) to be called before the .LPR file has been fully processed ? - or, probably more to the point, what can I do to stop it doing so?!
...Continued
There is a possibility of memory corruption (stack, code, data,...)
In this case it would be possible that the address of the called proc ends up somewhere (like the stack, or in a proc pointer) by pure chance. And so the proc would be called, but as a result of an error much earlier.
Let's try to get the cleanest build possible.
* Open the 1.6 IDE
- Open your project
- Menu: Project > Publish Project
Give a new folder as "destination directory"
Do not compress.
* Do not open your project before mentioned
* Close the old IDE.
- If you want to go the extra mile:
rename the folder in which the old IDE (and FPC) are.
>>>> DO NOT open the old IDE, until you undone the renaming <<<<
* Delete Lazarus 2.2 and Fpc 3.2.2
- Reinstall them => as 2ndary installation
chose a new empty folder for config
- Install each and every package that your project needs.
When you open the package check the path in the status bar to be in the Lazarus 2.2 install
For OPM packages: to be in the config folder
- If you rebuild the IDE => do so without optimizations.
- Now open the published project in you 2.2.x IDE
Build and test.
------
How private is the project. (and how many 3rd party packages does it need).
If it doesn't have too many requirements, could you send it privately?