Recent

Author Topic: [Fixed] FPC 3.0.4 Compilation exception (fatal 1018)  (Read 19784 times)

mse

  • Sr. Member
  • ****
  • Posts: 286
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #15 on: April 08, 2018, 05:44:59 pm »
If
Quote
problem signalled by TS appeared for me too
means
Code: [Select]
EAccessViolation: Access violation
  $0044EFB6
  $004E7F50
  $004F8FB4
...
that is a bug in FPC which is "unfixable", please read above.
http://forum.lazarus.freepascal.org/index.php/topic,40839.msg282420.html#msg282420

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #16 on: April 08, 2018, 06:25:18 pm »
You do not specify a {$mode} in your project or units, which means they default to mode fpc (not objfpc, or delphi), which is probably not what you want.
Howard, is this really true? In the Lazarus project options ("Compiler options" > "Parsing") there's a setting for "Syntax mode (-M, {$MODE})". Isn't this the mode used when a mode is not specified for a unit?

Werner, you are right, of course, for Lazarus projects.
I was thinking of FPC command line compilation of .pas files for which mode fpc is the default if no mode is specified (which is not relevant here).

jakubklos

  • New Member
  • *
  • Posts: 11
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #17 on: April 09, 2018, 08:29:52 am »
The issue does not occur on Linux with FPC 2.4.6
We could stick with 2.4.6 but the support for unicode filenames on Windows is crucial for us.
Looks like we will be stuck with old Delphi then :(. I was so hoping to get rid of it and use Lazarus

WooBean

  • Full Member
  • ***
  • Posts: 229
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #18 on: April 09, 2018, 08:47:24 am »
The issue does not occur on Linux with FPC 2.4.6
We could stick with 2.4.6 but the support for unicode filenames on Windows is crucial for us.
Looks like we will be stuck with old Delphi then :(. I was so hoping to get rid of it and use Lazarus
Crazy Monday?
It is not a good time to such strategic decision! The only problem is to press "build" instead of "compile" (or specify -B parameter in comand line for compiler), as far as I can undersand the topic.

WooBean
Platforms: Win7/64, Linux Mint Ulyssa/64

jakubklos

  • New Member
  • *
  • Posts: 11
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #19 on: April 09, 2018, 08:56:34 am »
Yes, that is true. But if you have hundreds of units it takes a few minutes for the build to finish. We wanted to migrate from Delphi because of the IDE horror (instability, slowness etc.) I have been using Lazarus for more than 2 years on Linux and I am happy with it. Now I wanted all developers to work in Lazarus but if there are issues like this they will not like me very much ;)

WooBean

  • Full Member
  • ***
  • Posts: 229
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #20 on: April 09, 2018, 10:27:17 am »
Yes, that is true. But if you have hundreds of units it takes a few minutes for the build to finish. We wanted to migrate from Delphi because of the IDE horror (instability, slowness etc.) I have been using Lazarus for more than 2 years on Linux and I am happy with it. Now I wanted all developers to work in Lazarus but if there are issues like this they will not like me very much ;)
Just guessing why you are in trouble I found in the Net some comments on huge time (minutes) compilation in Delphi (10.2 actually) when using generics. It seems to me,  that generics approache coding touches (in FPC too) so much of existing libraries ("hiddenly" used by a compiler) and needs checking (and replacing something) almost everywhere what forces a user to wait, wait .... . And it is your case, probably.

WooBean
Platforms: Win7/64, Linux Mint Ulyssa/64

Thaddy

  • Hero Member
  • *****
  • Posts: 14199
  • Probably until I exterminate Putin.
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #21 on: April 09, 2018, 11:49:30 am »
I am also guessing, but I am almost sure that my previous answer is the reason. {$mode objfpc} is still the default for Lazarus and he is porting Delphi code....So needs {$mode delphi} or {$mode delphiunicode}.
Once he understands that he should have no problem to port - older - Delphi code to Lazarus. < @@@@@@@@@@@...... O:-)> (yes.. pointer references)


Specialize a type, not a var.

jakubklos

  • New Member
  • *
  • Posts: 11
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #22 on: April 10, 2018, 08:23:26 am »
I have changed the whole project to ObjFPC mode and it does not help. The behavior is the same.
Almost every 2nd unit suffers from this issue btw. So you can imagine how long it took me to re-build and re-build and finish porting the project. It took hours because of this issue.
Would it make a difference if I post this isse directly to the FPC bug tracker?
Thank you

mse

  • Sr. Member
  • ****
  • Posts: 286
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #23 on: April 10, 2018, 09:04:20 am »
Would it make a difference if I post this isse directly to the FPC bug tracker?
If it is reproducible I definitely would submit a bug report.


jakubklos

  • New Member
  • *
  • Posts: 11
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #24 on: April 10, 2018, 10:00:27 am »
Thank you, will do

I compiled a debug version of the compiler and got stack with line numbers:

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

It's definitely a problem with generics as it fails in the determine_generic_def function and it must be new to FPC 3.0 when all the generics have been updated/reworked

jakubklos

  • New Member
  • *
  • Posts: 11
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #25 on: April 10, 2018, 10:21:30 am »
I have filed an issue to the FPC bug trackker
https://bugs.freepascal.org/view.php?id=33593

Thaddy

  • Hero Member
  • *****
  • Posts: 14199
  • Probably until I exterminate Putin.
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #26 on: April 10, 2018, 10:44:16 am »
I have changed the whole project to ObjFPC mode and it does not help. The behavior is the same.
Almost every 2nd unit suffers from this issue btw. So you can imagine how long it took me to re-build and re-build and finish porting the project. It took hours because of this issue.
Would it make a difference if I post this isse directly to the FPC bug tracker?
Thank you
That's what you should NOT have done. Or you should do the opposite! Mode Delphi! when converting manually.
You should ONLY convert visual parts with the  converter and any non-visual units or libraries should be mode delphi.
Usually the converter does a good  job, but not on large projects.
Code: Pascal  [Select][+][-]
  1. {$ifdef fpc}{$mode delphi}{$endif}
Note that I personally would not recommend ObjFpc mode at all. It should be on the way out. But that is opinionated.
The above advice should be sufficient.
« Last Edit: April 10, 2018, 10:45:51 am by Thaddy »
Specialize a type, not a var.

jakubklos

  • New Member
  • *
  • Posts: 11
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #27 on: April 10, 2018, 10:46:42 am »
The whole test project was tested with both the Delphi mode and ObjFPC. None of them work and suffer from the same issue.
There are no visual parts. It is only 3 units for the test purpose

Thaddy

  • Hero Member
  • *****
  • Posts: 14199
  • Probably until I exterminate Putin.
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #28 on: April 10, 2018, 11:20:43 am »
In that case I bet you - if it compiles under Delphi pre X series - I can fix that in less than half a day. If it pure pascal probably in less than an hour. And keep it compatible. If it is pure pascal. With some assembler code it takes max a day. (three units?). I usually win those bets.....

[edit] here you go....
« Last Edit: April 10, 2018, 12:12:55 pm by Thaddy »
Specialize a type, not a var.

jakubklos

  • New Member
  • *
  • Posts: 11
Re: FPC 3.0.4 Compilation exception (fatal 1018)
« Reply #29 on: April 10, 2018, 11:30:41 am »
I am not sure if it compiles on pre X, it does compile with XE2 though. The code involves generics and the crash is in the compiler and is related to generics.
If you really think you can fix the compiler I am willing to take that bet :)

 

TinyPortal © 2005-2018