Recompiling units with debug info and inline methods makes Internal error 200601281
Original Reporter info from Mantis: Michalis @michaliskambi
-
Reporter name: Michalis Kamburelis
Original Reporter info from Mantis: Michalis @michaliskambi
- Reporter name: Michalis Kamburelis
Description:
See the attached code (do not pay attention to any unit/identifier names, those are nonsense leftovers from cutting down real code to a testcase :) ).Compiling for the 1st time (or just right after "rm -f *.ppu *.o") works fine:
$ fpc -vi -Mobjfpc -g vrmlscene.pas
Target OS: Linux for i386
Compiling vrmlscene.pas
Compiling vrmlfields.pas
Compiling vrmlscene.pas
Compiling vrmlshape.pas
Compiling vrmlscene.pas
Compiling vrmlshapeoctree.pas
71 lines compiled, 0.1 sec
(Using -g seems needed to trigger the bug.)
Then try to make any change to the interface of vrmlscene.pas. For example, change the name of ChangedActiveLightNode method, to anything else. And try to recompile, with the same command:
$ fpc -vi -Mobjfpc -g vrmlscene.pas
Target OS: Linux for i386
Compiling vrmlscene.pas
Compiling vrmlscene.pas
Compiling vrmlscene.pas
Compiling vrmlshape.pas
Compiling vrmlfields.pas
Compiling vrmlscene.pas
Compiling vrmlscene.pas
vrmlscene.pas(18,1) Fatal: Internal error 200601281
Fatal: Compilation aborted
An unhandled exception occurred at $080560DD :
EAccessViolation : Access violation<br/>
$080560DD
$08048256
This is reproducible with both FPC 2.4.0 and current trunk (svn revision 14873).
Various things seem needed to trigger this bug. Cleaning up some units from uses clauses, and generally moving things between the units, often makes the bug disappear. (Also, sometimes instead of EAccessViolation you can get "EListError : List index exceeds bounds (12)"). Removing "inline" directive inside vrmlfields.pas also makes the bug disappear.
Attaching also a trivial test.sh script that I used. It clears ppu+o, compiles for the 1st time, modifies vrmlscene.pas by simple "sed" call, and tries to recompile. So you can just run "sh test.sh" to reproduce the bug easily.
Mantis conversion info:
- Mantis ID: 15720
- OS: Debian GNU/Linux
- OS Build: (testing)
- Platform: i386
- Version: 2.5.1