Compiler crash when try reuse compiled ppu`s
Original Reporter info from Mantis: Bishop
-
Reporter name: Emelyanov Roman
Original Reporter info from Mantis: Bishop
- Reporter name: Emelyanov Roman
Description:
I work in Lazarus. When i use my own RTL in my project (key thing in that: my RTL dont use precompiler files and every time compile with app) first build runs normaly, but when i try make rebuild (compiler try use already builded ppu`s) compiler crashs. So i make little investigation.
First i build compiler with debug symbols (look down). Then i find than when compiler try load PPU it ref to something with too high ID. Next i find that this problem start from r33492. After it i localized problem in tppumodule.buildderefunitimportsyms (fppu.pas). Continue seaching show me that problem in tderef.build (symtype.pas). Looks like this function is serialize something to store in PPU. But it have side effect in "if not tsym(s).registered then tsym(s).register_sym;". I dont look deeper, but looks like error somewhere is in this place.
Steps to reproduce:
Compile and compile again any project that compile all units than it use.
Additional information:
Warning: (2081) PIC directive or switch ignored
(1002) Target OS: Win64 for x64
(3104) Compiling Bug.lpr
D:\Work\CatFramework\Source\CRTL\Win\system.pas(3,1) Error: (1026) Compilation raised exception internally
Fatal: (1018) Compilation aborted
An unhandled exception occurred at $0000000100024477:
EListError: List index exceeds bounds (1880)
$0000000100024477 RAISEINDEXERROR, line 716 of cclasses.pas
$0000000100024502 PUT, line 729 of cclasses.pas
$00000001000252F1 SETITEM, line 1071 of cclasses.pas
$000000010006B6E6 PPULOAD, line 563 of symsym.pas
$0000000100071807 PPULOAD, line 2596 of symsym.pas
$000000010004295B LOADSYMS, line 557 of symtable.pas
$0000000100042334 PPULOAD, line 477 of symtable.pas
$0000000100046D30 PPULOAD, line 2443 of symtable.pas
$00000001001A43E7 LOAD_USEDUNITS, line 1605 of fppu.pas
$00000001001A4DEF LOADPPU, line 1892 of fppu.pas
$00000001001AFDD2 ADDUNIT, line 184 of pmodules.pas
$00000001001B01EF LOADDEFAULTUNITS, line 301 of pmodules.pas
$00000001001B436C PROC_PROGRAM, line 1963 of pmodules.pas
$00000001000421DA COMPILE, line 391 of parser.pas
$0000000100019A48 COMPILE, line 272 of compiler.pas
$00000001000018E2 main, line 227 of pp.pas
$0000000100001906
Error: C:\fpc\3.1.1\bin\x86_64-win64\ppcx64.exe returned an error exitcode
Mantis conversion info:
- Mantis ID: 30289
- OS: Windows
- OS Build: 7
- Build: r33996
- Platform: x86_64
- Version: 3.1.1