FPC 3.0.4 Compilation exception (fatal 1018)
Original Reporter info from Mantis: jakubklos
-
Reporter name: Jakub Klos - IceWarp
Original Reporter info from Mantis: jakubklos
- Reporter name: Jakub Klos - IceWarp
Description:
When I touch a file (change a timestamp) FPC compiler crashes with an access violation. If I build the whole project it works properly.
This happens almost in any other unit and forces you to permanently rebuild the whole project which is time consuming and unusable. It is 100% reproducable
$ fpc SimpleObjectsTest.dpr -MObjFPC -gw2 -l -g -gl -gp -XMPASCALMAIN_ALIAS -dFPC_RTL
Free Pascal Compiler version 3.0.4 [2018/04/10] for i386
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling SimpleObjectsTest.dpr
Compiling TestUnit.pas
Fatal: Compilation aborted
An unhandled exception occurred at $004575E9:
EAccessViolation: Access violation
$004575E9 line 370 of symbase.pas
$004FBB62 line 401 of pdecl.pas
$004FB016 line 626 of pdecl.pas
$004FBBF3 line 876 of pdecl.pas
$0050D967 line 2218 of psub.pas
$00509EFF line 307 of psub.pas
$0050CCE9 line 1808 of psub.pas
$0050D158 line 1959 of psub.pas
$0050DE78 line 2394 of psub.pas
$0050DD01 line 2425 of psub.pas
$00422D0C line 1756 of cclasses.pas
$0050DF71 line 2434 of psub.pas
$005544A0 line 1057 of pmodules.pas
$005543AC line 981 of pmodules.pas
$00438D5D line 368 of parser.pas
$0054B4D4 line 1734 of fppu.pas
$005532E6 line 484 of pmodules.pas
Error: C:\lazarus\fpc\3.0.4\bin\i386-win32\ppc386.exe returned an error exitcode
Steps to reproduce:
-
Extract the test.zip
-
Compile it with:
fpc SimpleObjectsTest.dpr -MObjFPC -gw2 -l -g -gl -gp -XMPASCALMAIN_ALIAS -dFPC_RTL -
Edit the TestUnit.pas so you only modify the timestamp (or you can add a comment...)
-
Compile again with the same command as in 2)
You have the exception
Additional information:
Does not happen in FPC 2.4.6
Must be probably related to generics implementation (changes in FPC 3.x).
I compiled a debug version of the FPC compiler so I can see the stack line numbers and units. It fails in the determine_generic_def function on line 401:
sym:=tsym(tprocdef(pd.genericdef).localst.findwithhash(hashedid));
I would say this is a rather critical bug.
Please, let me know how I can help to fix this issue.
Thank you
Mantis conversion info:
- Mantis ID: 33593
- Platform: Windows
- Version: 3.0.4
- Fixed in version: 3.3.1
- Monitored by: » Vincent (Vincent Snijders)
- Target version: 3.1.1