View Issue Details

IDProjectCategoryView StatusLast Update
0015518FPCCompilerpublic2015-08-30 23:29
ReportercobinesAssigned ToJonas Maebe 
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version2.5.1Product Build 
Target VersionFixed 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)

2010-01-15 01:01

 

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)

2010-01-18 09:18

 

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