View Issue Details

IDProjectCategoryView StatusLast Update
0038451FPCCompilerpublic2021-02-24 21:17
Reporterravi dion Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
OSLinux 
Product Version3.2.1 
Summary0038451: Compilation raised exception internally - Error 217
DescriptionFree Pascal Compiler version 3.2.1-r48511 [2021/02/07] for x86_64


Error: Compilation raised exception internally
Fatal: Compilation aborted
An unhandled exception occurred at $000000000048F18A:
EAccessViolation: Access violation
  $000000000048F18A ADDDEPENDENCY, line 917 of fmodule.pas
  $0000000000647124 LOADUNITS, line 519 of pmodules.pas
  $0000000000648516 PROC_UNIT, line 967 of pmodules.pas
  $0000000000548B70 COMPILE, line 399 of parser.pas
  $000000000053A84F LOADPPU, line 2133 of fppu.pas
  $00000000006470F3 LOADUNITS, line 514 of pmodules.pas
  $000000000064892B PROC_UNIT, line 1058 of pmodules.pas
  $0000000000548B70 COMPILE, line 399 of parser.pas
  $000000000053A84F LOADPPU, line 2133 of fppu.pas
  $00000000006470F3 LOADUNITS, line 514 of pmodules.pas
  $0000000000648516 PROC_UNIT, line 967 of pmodules.pas
  $0000000000548B70 COMPILE, line 399 of parser.pas
  $000000000053A84F LOADPPU, line 2133 of fppu.pas
  $00000000006470F3 LOADUNITS, line 514 of pmodules.pas
  $000000000064892B PROC_UNIT, line 1058 of pmodules.pas
  $0000000000548B70 COMPILE, line 399 of parser.pas
  $000000000053A84F LOADPPU, line 2133 of fppu.pas

make: *** [Makefile:30: prog] Error 217
Steps To ReproduceUnfortunately it's a huge program and I wanted to add command line support and changed:

- before in prog.lpr:
uses console;
begin
  ConsoleStart;
end.

- now which leads to compiler exception:
uses commandlineutil, console;

var
  BinName: String;
  i: Integer;

begin
  BinName := ExtractFileName(ParamStr(0));
  if ParamCount > 3 then
  begin
    for i := 1 to ParamCount do
    begin
      CmdLine := CmdLine + ParamStr(i) + ' ';
    end;
    CmdLine := Trim(CmdLine);

    ParseCommandLine(BinName, CmdLine);
    Exit;
  end;

  ConsoleStart;
end.
Additional Information- mode Delphi
- it should also raise an error because CmdLine isn't defined but it doesn't do that either
- happens with -O3 -Xs
- happens with -O- -Xs
- happens with -O-
-> just happens every time -.-
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

ravi dion

2021-02-07 21:04

reporter   ~0128810

Forgot to add that it still happens even if CmdLine is defined as String

ravi dion

2021-02-07 21:15

reporter   ~0128811

Last edited: 2021-02-07 21:17

View 2 revisions

Remvoing commandlineutil from uses list brings:
Error: Identifier not found "ExtractFileName"
Error: Illegal qualifier
Error: Identifier not found "ParseCommandLine"
but after adding SysUtils to uses list it still crashes. But that error should come up earlier, no? Like at the beginning?

ravi dion

2021-02-07 21:27

reporter   ~0128812

UPDATE:
same issue happens with Free Pascal Compiler version 3.3.1-r48520 [2021/02/07] for x86_64:

Error: Compilation raised exception internally
Fatal: Compilation aborted
An unhandled exception occurred at $000000000049A4E4:
EAccessViolation: Access violation
  $000000000049A4E4 ADDDEPENDENCY, line 943 of fmodule.pas
  $000000000069BEEA LOADUNITS, line 523 of pmodules.pas
  $000000000069D351 PROC_UNIT, line 975 of pmodules.pas
  $000000000056B626 COMPILE, line 401 of parser.pas
  $000000000055BAAF LOADPPU, line 2239 of fppu.pas
  $000000000069BEB3 LOADUNITS, line 518 of pmodules.pas
  $000000000069D789 PROC_UNIT, line 1070 of pmodules.pas
  $000000000056B626 COMPILE, line 401 of parser.pas
  $000000000055BAAF LOADPPU, line 2239 of fppu.pas
  $000000000069BEB3 LOADUNITS, line 518 of pmodules.pas
  $000000000069D351 PROC_UNIT, line 975 of pmodules.pas
  $000000000056B626 COMPILE, line 401 of parser.pas
  $000000000055BAAF LOADPPU, line 2239 of fppu.pas
  $000000000069BEB3 LOADUNITS, line 518 of pmodules.pas
  $000000000069D789 PROC_UNIT, line 1070 of pmodules.pas
  $000000000056B626 COMPILE, line 401 of parser.pas
  $000000000055BAAF LOADPPU, line 2239 of fppu.pas

Florian

2021-02-07 21:36

administrator   ~0128813

Without a small example which triggers the error I see little chance to fix it.

ravi dion

2021-02-07 22:07

reporter   ~0128814

Looks like it happens if an unit is used in console (ConsoleStart func) and then the same unit is used in commandlineutil (ParseCommandLine procedure) because if I comment out the unit in commandlineutil it compiles fine (all other code commented out in unit except uses and function definition.

Remove the comment for the const definition and variable part of my function with the double used unit commented out:
commandlineutil.pas(27,88) Error: Error in type definition
commandlineutil.pas(27,88) Fatal: Syntax error, "=" expected but ";" found
-> I defined a constant like: const X: 'my text'; which is wrong but didn't appeared before but since I commented out the unit used in both units it throws it directly.
After fixing these it showed some more errors as some variables weren't defined but after fixing these as well the problem still happens.
Maybe I can simplify it to a small project or I can add the project but it's huge...

ravi dion

2021-02-23 21:57

reporter   ~0129128

Nothing?

J. Gareth Moreton

2021-02-24 06:30

developer   ~0129131

Last edited: 2021-02-24 06:37

View 2 revisions

Are you able to isolate which of your source is calling it? I would recommend trying the -va option as that adds in a lot of verbose output.

J. Gareth Moreton

2021-02-24 06:41

developer   ~0129132

Also, I'd use a different host for your downloads, such as Dropbox. The one you use requires browser add-ons and client programs to be downloaded. It just installed Opera WITHOUT PERMISSION.

Michael Van Canneyt

2021-02-24 08:26

administrator   ~0129134

@Gareth,

I don't know what you've been doing on that site, but I downloaded the bugreport
file without problems. I didn't have to install anything, just downloaded a
zip without the need to download or install anything else. The zip file
contains only (a lot of) pascal files.

I agree the method is somewhat unusual but as far as I can see the download
is bona fide.

J. Gareth Moreton

2021-02-24 13:40

developer   ~0129141

Okay, it works as expected for me now too - sorry for the panic. I've just never had something like that happen before.

ravi dion

2021-02-24 21:17

reporter   ~0129152

@Gareth,
I'm sorry. I didn't wanted to cause you any trouble...used anonfiles many times because you don't need to type a captcha and wait several minutes to download the file...
However, I recommend to use the internet with an adblocker - that should also block such 'bad' ads :)

Issue History

Date Modified Username Field Change
2021-02-07 21:03 ravi dion New Issue
2021-02-07 21:04 ravi dion Note Added: 0128810
2021-02-07 21:15 ravi dion Note Added: 0128811
2021-02-07 21:17 ravi dion Note Edited: 0128811 View Revisions
2021-02-07 21:27 ravi dion Note Added: 0128812
2021-02-07 21:36 Florian Status new => feedback
2021-02-07 21:36 Florian FPCTarget => -
2021-02-07 21:36 Florian Note Added: 0128813
2021-02-07 22:07 ravi dion Note Added: 0128814
2021-02-07 22:07 ravi dion Status feedback => new
2021-02-23 21:57 ravi dion Note Added: 0129128
2021-02-24 06:30 J. Gareth Moreton Note Added: 0129131
2021-02-24 06:37 J. Gareth Moreton Note Edited: 0129131 View Revisions
2021-02-24 06:41 J. Gareth Moreton Note Added: 0129132
2021-02-24 08:26 Michael Van Canneyt Note Added: 0129134
2021-02-24 13:40 J. Gareth Moreton Note Added: 0129141
2021-02-24 21:17 ravi dion Note Added: 0129152