View Issue Details

IDProjectCategoryView StatusLast Update
0024121FPCCompilerpublic2014-10-13 01:00
ReporterChrisFAssigned ToJonas Maebe 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformi386-win32 OSWindowsOS VersionXP
Product Version2.6.2Product Build 
Target VersionFixed in Version3.0.0 
Summary0024121: Incorrect PPU file produced: CRC for a 'Use Unit' section wrongly stored into calling unit
Description
The PPU CRC value for a depending unit is wrongly stored into the PPU file calling this former unit.
Steps To Reproduce
-Start a new Lazarus/FPC project,

-add this declaration: 'uses IdStreamVCL;' into unit1.pas,

-put the attached files (i.e. IdStreamVCL.pas and other related files) into the project directory. These files are exactly the current concerned files of the Indy 10 package (i.e. Indy10_4967). Note that the IdStreamVCL.pas unit is referring to the IdGlobal.pas one,

-compile (clean compilation) the project,

-the CRC value stored in the IdStreamVCL.ppu file is not the correct value for the 'Use Unit' section concerning the IdGlobal.pas file.

Extracts of PPUDump reports:
----------------------------

Header for IdGlobal.ppu:
...
Checksum : 89F13836
Interface Checksum : B8501FC5
Indirect Checksum : B284D3D9
...

Data in IdStreamVCL.ppu:
...
Uses unit: IdGlobal (Crc: 16EB5A90, IntfcCrc: B8501FC5, IndCrc: B284D3D9)
...

Clearly, 89F13836 <> 16EB5A90 ! Though the other CRC values (Interface Checksum and Indirect Checksum) are always OK.

EDIT: Running several times this test gives -sometimes- a correct CRC value. If it's the case during the tests, try to recompile the whole project again (with a clean compile).
Additional Information
Trying to make a clean installation (i.e. without any errors) of one of the latest versions of the Indy package into Lazarus, turned rapidly into a nightmare (at least in Windows). Briefly, the package compilation is OK, but the reconstruction of the Lazarus IDE gives an error; it occurs when it tries to recompile again one of the file of the Indy package (which should be obviously unnecessary; the whole package compilation has been done just before).

The reason is the bug reported above. The IdStreamVCL.ppu obtained during the package compilation is incorrect, concerning the IdGlobal.pas dependency (as in my sample).

A few more pieces of information:

1/ The wrong CRC value is obtained only during the IdStreamVCL->IdGlobals compilation. If you try this declaration within the unit.pas sample project 'uses IdStreamVCL, IdGlobal;' for instance, the CRC value stored into the unit1.ppu file is OK:
Data in unit1.ppu:
...
Uses unit: IdGlobal (Crc: 89F13836, IntfcCrc: B8501FC5, IndCrc: B284D3D9)
....

2/ If you compile the IdGlobal.pas another way (and before the IdStreamVCL.pas compilation), this time the CRC value stored into the IdStreamVCL.ppu file is OK. For instance, with this declaration into the unit1.pas sample project: 'uses IdGlobal, IdStreamVCL;'. Curiously, the value stored into unit1.ppu file is also OK, though IdGlobal has been this time compiled during the unit1.pas compilation.

3/ The problem seems to be not relative to the main declaration file: replacing the '{$I IdCompilerDefines.inc}' declaration into the IdStreamVCL.pas with a correct equivalence (i.e. '{$DEFINE STREAM_SIZE_64}'), or even with no define at all, gives exactly the same error (providing that the IsGlobal.pas file is still compiled during the compilation of the IdStreamVCL.pas file).


It's possible there is something wrong into the code of the IdStreamVCL.pas Indy unit: I've not really looked at it. Anyway, I can't imagine a good reason and/or situation to have such an improper CRC value when the whole compilation is OK (i.e. without any errors reported).
TagsNo tags attached.
Fixed in Revision27192
FPCOldBugId
FPCTarget
Attached Files

Relationships

parent of 0015218 feedbackDmitry Boyarintsev Lazarus CCR Checksum changes when installing package 
has duplicate 0019673 closedFlorian FPC Problems with circular references and inline procedures. 
has duplicate 0015221 resolvedJonas Maebe FPC Checksum issue 
related to 0025610 resolvedJonas Maebe FPC Unable to find file - magic error. 
related to 0015518 resolvedJonas Maebe FPC Compiler crashes when reading PPU file 
Not all the children of this issue are yet resolved or closed.

Activities

ChrisF

2013-03-22 22:13

reporter  

ExtractOfIndy10.zip (62,404 bytes)

Marco van de Voort

2013-03-23 01:40

manager   ~0066501

(The mentioned indy base unit idglobal is one of those that was involved with recompilation cycles in the past)

ChrisF

2013-03-23 17:33

reporter   ~0066510

Thanks to your remark, I've found the same bug report indeed (still opened):
http://bugs.freepascal.org/view.php?id=19673

Please close this one, as it's a duplicate.

ChrisF

2013-04-06 14:52

reporter   ~0066832

Closed (duplicate).

ChrisF

2013-08-05 15:36

reporter   ~0069261

[Preliminary note]
I'm re-opening this report, though it's not the one that I'd like to re-open. As indicated before, this one is only a duplicate of another "main" one, and so, should not be used any more. The problem is that I can't re-open the "main" report (as I'm not the author of it). The concerned report that I'd like to re-open is this one:
http://bugs.freepascal.org/view.php?id=19673

Please, I'd be thankful if someone could re-open the main one, and transfer the following part of this note to it.
[End of Preliminary note]


@Florian:

I'm not quite agree with you. Because the same code compiles correctly within Delphi.

I won't insist upon this problem if Indy's installation was not directly concerned. Because obviously, this problem is certainly not a common one, and once again, if Indy was not concerned, I won't argue any more about it.

The situation for installing Indy inside FPC/Lazarus currently is stuck. People have to ask for the Indy compilation twice in order to install correctly this package. And of course, they don't (it's not supposed to be requested).

I've had a discussion with the current programmer of Indy (i.e. Remy Lebeau):
http://forums2.atozed.com/viewtopic.php?f=7&t=26483 (end of the topic)

The problem is that fixing the current problem inside Indy is complicated.

And I guess it's also very complicated inside FPC.

So, it's complicated in both ends and there is no simple solution: I do agree with that.

But it's not impossible (i.e. Delphi can do it). That's why I'd like to keep this report open, at least until a solution has been found for Indy. I've planned to look at it and try to propose a fix in the future (don't know if it'll concern Indy or FPC), but I've still not had the time for it.

If someone has another proposal, workaround, or anything else that could solve this problem, at least concerning the Indy's installation, please feel free to propose it: I'd certainly be glad to close definitively this report.

Note: I've updated the wiki page concerning Indy's installation inside Lazarus (http://wiki.freepascal.org/Indy_with_Lazarus : "How to install [3] Windows, Indy 10.5.8.0 and above "). But my feelings is that it's certainly not quite sufficient.

Jonas Maebe

2014-03-19 22:53

manager   ~0073856

The availability of an inline function's body will now no longer trigger recompilations.

Issue History

Date Modified Username Field Change
2013-03-22 22:13 ChrisF New Issue
2013-03-22 22:13 ChrisF File Added: ExtractOfIndy10.zip
2013-03-23 01:40 Marco van de Voort Note Added: 0066501
2013-03-23 17:33 ChrisF Note Added: 0066510
2013-03-24 17:11 Florian Relationship added duplicate of 0019673
2013-03-24 17:12 Florian Status new => resolved
2013-03-24 17:12 Florian Resolution open => duplicate
2013-03-24 17:12 Florian Assigned To => Florian
2013-04-06 14:52 ChrisF Note Added: 0066832
2013-04-06 14:52 ChrisF Status resolved => closed
2013-08-05 15:36 ChrisF Note Added: 0069261
2013-08-05 15:36 ChrisF Status closed => feedback
2013-08-05 15:36 ChrisF Resolution duplicate => reopened
2014-03-19 09:23 Mattias Gaertner Relationship added related to 0025610
2014-03-19 09:35 Florian Assigned To Florian =>
2014-03-19 22:53 Jonas Maebe Fixed in Revision => 27192
2014-03-19 22:53 Jonas Maebe Note Added: 0073856
2014-03-19 22:53 Jonas Maebe Status feedback => resolved
2014-03-19 22:53 Jonas Maebe Fixed in Version => 2.7.1
2014-03-19 22:53 Jonas Maebe Resolution reopened => fixed
2014-03-19 22:53 Jonas Maebe Assigned To => Jonas Maebe
2014-03-19 22:54 Jonas Maebe Relationship replaced has duplicate 0019673
2014-03-19 22:57 Jonas Maebe Relationship added related to 0015518
2014-06-17 15:28 Jonas Maebe Relationship added has duplicate 0015221
2014-10-13 01:00 Juha Manninen Relationship added parent of 0015218