View Issue Details

IDProjectCategoryView StatusLast Update
0015720FPCCompilerpublic2011-10-21 16:16
ReporterMichalis Kamburelis Assigned ToJonas Maebe  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformi386OSDebian GNU/Linux 
Product Version2.5.1 
Summary0015720: Recompiling units with debug info and inline methods makes Internal error 200601281
DescriptionSee 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
  $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.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0015518 resolvedJonas Maebe Compiler crashes when reading PPU file 

Activities

2010-02-09 13:40

 

Jonas Maebe

2010-02-09 14:31

manager   ~0034327

It's probably caused by the same thing as 0015518

cobines

2011-10-10 20:31

reporter   ~0052839

I tried compiling the attached code:
- With fixes_2_4 it crashes when I use "-g"
- With fixes_2_4 it does not crash when I use "-gw"
- With fixes_2_6 it does not crash regardless of debugging info
- With trunk it does not crash regardless of debugging info

Jonas Maebe

2011-10-21 16:16

manager   ~0053243

Thanks for the test. The underlying problem is unfortunately not yet solved in the compiler, but that's tracked in the related bug report.

Issue History

Date Modified Username Field Change
2010-02-09 13:40 Michalis Kamburelis New Issue
2010-02-09 13:40 Michalis Kamburelis File Added: fpc-recompile-segfault.tar.gz
2010-02-09 14:31 Jonas Maebe Relationship added related to 0015518
2010-02-09 14:31 Jonas Maebe Note Added: 0034327
2011-10-10 20:31 cobines Note Added: 0052839
2011-10-21 16:16 Jonas Maebe Status new => resolved
2011-10-21 16:16 Jonas Maebe Resolution open => fixed
2011-10-21 16:16 Jonas Maebe Assigned To => Jonas Maebe
2011-10-21 16:16 Jonas Maebe Note Added: 0053243