View Issue Details

IDProjectCategoryView StatusLast Update
0015518FPCCompilerpublic2015-08-30 23:29
Reportercobines Assigned ToJonas Maebe  
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version2.5.1 
Fixed in Version3.0.0 
Summary0015518: Compiler crashes when reading PPU file
DescriptionI sometimes have these crashes when compiling a project. Two logs are attached, it is always either the one or the other error. It has something to do with reading or writing PPU files because as soon as I delete all the PPU files of the project it compiles successfully. It only happens on further compilations.

Unfortunately I cannot reproduce it on demand and I cannot supply a simple test project (although I've tried to do it). I'm hoping the backtrace will give some info.

When I have this error while compiling whole project then I can pinpoint the specific source file on which this error happens. I get this error:

ufilesource.pas(451,36) Error: Class or Object types "TFileSourceOperation" and "TFileSourceListOperation" are not related
Fatal: Compilation aborted
<backtrace the same as in crashlog1.log>

However, the TFileSourceListOperation inherits from TFileSourceOperation and the compiler states they are not related. Maybe the info about these classes is read from PPU wrongly. If I remove all the code from that source file except a single "uses <something>;" I still get this error. If I also remove the "uses" clause there is no error anymore. As I mentioned, if I delete all PPU files then the file is successfully compiled.

I use FPC 2.5.1 rev. 14644. System is Debian/Sid i386.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0024121 resolvedJonas Maebe Incorrect PPU file produced: CRC for a 'Use Unit' section wrongly stored into calling unit 
has duplicate 0024556 resolvedJonas Maebe Compiler exception 
has duplicate 0024684 closedJonas Maebe Compiler stops for unhandled exception. 
related to 0012058 closedJonas Maebe Compiler crash, probably related to unit symbol checksum changes 
related to 0015720 resolvedJonas Maebe Recompiling units with debug info and inline methods makes Internal error 200601281 

Activities

2010-01-15 01:01

 

crashlog1.log (1,807 bytes)   
An unhandled exception occurred at $080BF579 :
EAccessViolation : Access violation
  $080BF579  SEARCHSYM_IN_CLASS,  line 1898 of symtable.pas
  $0814587F  POSTFIXOPERATORS,  line 2091 of pexpr.pas
  $08143D6F  FACTOR,  line 2259 of pexpr.pas
  $08146CA2  SUB_EXPR,  line 2714 of pexpr.pas
  $08146CB3  SUB_EXPR,  line 2716 of pexpr.pas
  $08146CB3  SUB_EXPR,  line 2716 of pexpr.pas
  $08146CB3  SUB_EXPR,  line 2716 of pexpr.pas
  $081471AD  EXPR,  line 2823 of pexpr.pas
  $081383E0  STATEMENT,  line 1104 of pstatmnt.pas
  $0813788D  TRY_STATEMENT,  line 785 of pstatmnt.pas
  $0813832A  STATEMENT,  line 1082 of pstatmnt.pas
  $08136531  IF_STATEMENT,  line 77 of pstatmnt.pas
  $081382DC  STATEMENT,  line 1070 of pstatmnt.pas
  $08138695  STATEMENT_BLOCK,  line 1204 of pstatmnt.pas
  $081382CF  STATEMENT,  line 1068 of pstatmnt.pas
  $08136531  IF_STATEMENT,  line 77 of pstatmnt.pas
  $081382DC  STATEMENT,  line 1070 of pstatmnt.pas
  $08138695  STATEMENT_BLOCK,  line 1204 of pstatmnt.pas
  $08131BD5  BLOCK,  line 247 of psub.pas
  $08133E9F  TCGPROCINFO__PARSE_BODY,  line 1334 of psub.pas
  $08134704  READ_PROC,  line 1648 of psub.pas
  $08134A5C  READ_DECLARATIONS,  line 1756 of psub.pas
  $08131A30  BLOCK,  line 172 of psub.pas
  $08133E9F  TCGPROCINFO__PARSE_BODY,  line 1334 of psub.pas
  $0816992E  COMPILE,  line 394 of parser.pas
  $081753FC  TPPUMODULE__LOADPPU,  line 1611 of fppu.pas
  $08174E4B  TPPUMODULE__LOAD_USEDUNITS,  line 1342 of fppu.pas
  $081752CE  TPPUMODULE__LOADPPU,  line 1566 of fppu.pas
  $0817CA07  LOADUNITS,  line 767 of pmodules.pas
  $0817D484  PROC_UNIT,  line 1077 of pmodules.pas
  $0816992E  COMPILE,  line 394 of parser.pas
  $081753FC  TPPUMODULE__LOADPPU,  line 1611 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
crashlog1.log (1,807 bytes)   

2010-01-15 01:01

 

crashlog2.log (2,248 bytes)   
An unhandled exception occurred at $080BFEA3 :
EAccessViolation : Access violation
  $080BFEA3  SEARCH_CLASS_MEMBER,  line 2219 of symtable.pas
  $080BDFD1  TOBJECTSYMTABLE__CHECKDUPLICATE,  line 1135 of symtable.pas
  $080BC0F5  TSTOREDSYMTABLE__INSERT,  line 292 of symtable.pas
  $0813EC3A  HANDLE_CALLING_CONVENTION,  line 2591 of pdecsub.pas
  $08153CED  PARSE_OBJECT_MEMBERS,  line 739 of pdecobj.pas
  $0814A535  READ_NAMED_TYPE,  line 1003 of ptype.pas
  $08139500  TYPES_DEC,  line 498 of pdecl.pas
  $08139F2E  TYPE_DEC,  line 640 of pdecl.pas
  $0817D52D  PROC_UNIT,  line 1101 of pmodules.pas
  $0816992E  COMPILE,  line 394 of parser.pas
  $081753FC  TPPUMODULE__LOADPPU,  line 1611 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175031  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
crashlog2.log (2,248 bytes)   

Florian

2010-01-16 22:11

administrator   ~0033688

Without additional info, I see no way to find out what happens.

Jonas Maebe

2010-01-17 00:43

manager   ~0033691

It's probably the same as this problem: http://lists.freepascal.org/lists/fpc-devel/2010-January/019034.html

I've been debugging it, but haven't found the reason yet. I may be caused by the indirect crc stuff I added. I'm fairly close to changing the compiler so it simply stops in case that happens and instead tells the user to delete all ppu files or to recompile everything using -B. The unit reloading logic is really hard to debug/fix (and even harder to automatically test)...

2010-01-18 09:18

 

crashlog3.log (4,457 bytes)   
Linux 32-bit FPC SVN trunk rev. 14737

An unhandled exception occurred at $08088B9D :
EListError : List index exceeds bounds (0)
  $08088B9D  TFPLIST__ERROR,  line 697 of cclasses.pas
  $0808884E  TFPLIST__RAISEINDEXERROR,  line 601 of cclasses.pas
  $080BCDE3  TSTOREDSYMTABLE__DEREFIMPL,  line 516 of symtable.pas
  $081751BE  TPPUMODULE__LOAD_USEDUNITS,  line 1280 of fppu.pas
  $081757EE  TPPUMODULE__LOADPPU,  line 1566 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas

An unhandled exception occurred at $08088B9D :
EListError : List index exceeds bounds (6)
  $08088B9D  TFPLIST__ERROR,  line 697 of cclasses.pas
  $0808884E  TFPLIST__RAISEINDEXERROR,  line 601 of cclasses.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $081751BE  TPPUMODULE__LOAD_USEDUNITS,  line 1280 of fppu.pas
  $081757EE  TPPUMODULE__LOADPPU,  line 1566 of fppu.pas
  $0817CF29  LOADUNITS,  line 767 of pmodules.pas
  $0817D9A4  PROC_UNIT,  line 1077 of pmodules.pas
  $08169C7E  COMPILE,  line 394 of parser.pas
  $0817591C  TPPUMODULE__LOADPPU,  line 1611 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNITS,  line 1439 of fppu.pas
  $08175553  TPPUMODULE__RELOAD_FLAGGED_UNImodule.pas
crashlog3.log (4,457 bytes)   

2010-01-18 09:18

 

crashlog4.log (1,818 bytes)   
Windows XP 32-bit FPC SVN trunk rev. 14214

An unhandled exception occurred at $694C7463 :
EAccessViolation : Access violation
  $694C7463
  $004F4B39  ID_TYPE,  line 373 of ptype.pas
  $004F4DB1  SINGLE_TYPE,  line 458 of ptype.pas
  $004E6106  PARSE_PARAMETER_DEC,  line 568 of pdecsub.pas
  $004E70F3  PARSE_PROC_HEAD,  line 938 of pdecsub.pas
  $004E743F  PARSE_PROC_DEC,  line 1054 of pdecsub.pas
  $004DEE9B  READ_PROC,  line 1558 of psub.pas
  $004DF441  READ_DECLARATIONS,  line 1724 of psub.pas
  $004DC114  BLOCK,  line 172 of psub.pas
  $004DE7DE  TCGPROCINFO__PARSE_BODY,  line 1321 of psub.pas
  $0051EBAB  PROC_UNIT,  line 1121 of pmodules.pas
  $0043155D  COMPILE,  line 394 of parser.pas
  $00516432  TPPUMODULE__LOADPPU,  line 1531 of fppu.pas
  $00515DBC  TPPUMODULE__LOAD_USEDUNI


Windows XP 32-bit FPC 2.4.0

An unhandled exception occurred at $694C7463 :
EAccessViolation : Access violation
  $694C7463
  $004D7C6E  SINGLE_TYPE,  line 454 of ptype.pas
  $004CAE01  PARSE_PROC_HEAD,  line 894 of pdecsub.pas
  $004CB148  PARSE_PROC_DEC,  line 1009 of pdecsub.pas
  $004C43E0  READ_DECLARATIONS,  line 1721 of psub.pas
  $004C1503  BLOCK,  line 172 of psub.pas
  $004C38DF  TCGPROCINFO__PARSE_BODY,  line 1318 of psub.pas
  $0042F26E  COMPILE,  line 394 of parser.pas
  $004F6446  TPPUMODULE__LOADPPU,  line 1531 of fppu.pas
  $004F5F63  TPPUMODULE__LOAD_USEDUNITS,  line 1322 of fppu.pas
  $004F6318  TPPUMODULE__LOADPPU,  line 1486 of fppu.pas
  $004FD697  LOADUNITS,  line 695 of pmodules.pas
  $004FE11C  PROC_UNIT,  line 1003 of pmodules.pas
  $0042F26E  COMPILE,  line 394 of parser.pas
  $004F6446  TPPUMODULE__LOADPPU,  line 1531 of fppu.pas
  $004F299D  RELOAD_FLAGGED_UNITS,  line 123 of fppu.pas
  $0042F26E  COMPILE,  line 394 of parser.pas


crashlog4.log (1,818 bytes)   

cobines

2010-01-18 09:28

reporter   ~0033724

I can produce a crash on demand now. I say _a_ crash because it doesn't always crash with the same backtrace. I have attached few other logs only to show that all crashes I had before and the ones I can produce now have something to do with either:

- TPPUMODULE__LOADPPU or
- TPPUMODULE__LOAD_USEDUNITS or
- TPPUMODULE__RELOAD_FLAGGED_UNITS.

I can cause a crash only when building our full project. It is a Lazarus project and I tried to at least get rid of Lazarus dependency but I couldn't get the resulting smaller project to crash when compiling.

How I reproduce it (on Linux and Windows the same way):
1. clean output dir (all ppu, o, etc.)
2. build project -> success
3. change something in interface section in one of the source files - I change parameter type String -> UTF8String:
  sed -e 's/GetPathType(sPath : String)/GetPathType(sPath : utf8String)/'
4. build project -> crash

If I build project again it usually builds successfully, although sometimes still crashes.

I did more tests with different FPC versions. I get similar crashes on Windows XP (32-bit). I get crashes when using:
- FPC 2.5.1
- FPC 2.4.0
- FPC 2.2.4
- FPC 2.2.2 (only on Windows, on Linux I could not get it to crash).

I did not test earlier versions.

I will try changing some compiler switches and see if that affects anything. Currently I have: "-MDelphi -Scaghi -Ciro -g -gl -gh -vewnhi -l".

I didn't have these crashes before, only since a few weeks ago, so maybe something we changed in our project exposed the bug. Since trying to find recent changes in FPC that might have caused this failed, I'll try to find what changes in our project caused these crashes to appear.

Jonas Maebe

2010-01-18 13:28

manager   ~0033727

I can already reproduce at least one crash with the compiler sources, and I know what it's caused by. I spent half the weekend trying to fix it, but didn't succeed yet (one crash was always replaced by another).

Jonas Maebe

2014-03-19 22:56

manager   ~0073858

Now that the availability of inline info no longer triggers recompilations, such issues will happen a lot less. It's still not perfect, but at least in the compiler such problems no longer occur in the cases where they used to occur

Issue History

Date Modified Username Field Change
2010-01-15 00:59 cobines New Issue
2010-01-15 01:01 cobines File Added: crashlog1.log
2010-01-15 01:01 cobines File Added: crashlog2.log
2010-01-16 22:11 Florian Note Added: 0033688
2010-01-16 22:11 Florian Status new => feedback
2010-01-17 00:43 Jonas Maebe Note Added: 0033691
2010-01-17 11:11 Jonas Maebe Status feedback => assigned
2010-01-17 11:11 Jonas Maebe Assigned To => Jonas Maebe
2010-01-18 09:18 cobines File Added: crashlog3.log
2010-01-18 09:18 cobines File Added: crashlog4.log
2010-01-18 09:28 cobines Note Added: 0033724
2010-01-18 13:28 Jonas Maebe Note Added: 0033727
2010-01-23 10:59 Jonas Maebe Relationship added related to 0012058
2010-02-09 14:31 Jonas Maebe Relationship added related to 0015720
2013-06-05 10:27 Jonas Maebe Relationship added has duplicate 0024556
2013-06-28 11:06 Jonas Maebe Relationship added has duplicate 0024684
2014-03-19 22:56 Jonas Maebe Note Added: 0073858
2014-03-19 22:56 Jonas Maebe Status assigned => resolved
2014-03-19 22:56 Jonas Maebe Resolution open => fixed
2014-03-19 22:57 Jonas Maebe Relationship added related to 0024121
2015-08-30 23:29 Joost van der Sluis Fixed in Version => 3.0.1