View Issue Details

IDProjectCategoryView StatusLast Update
0038591FPCCompilerpublic2021-03-25 08:40
Reporterravi dion Assigned To 
Status newResolutionopen 
Product Version3.2.1 
Summary0038591: Unhandled exception inside compiler for VMT entry
Descriptiontest.lpr(14,40) Error: Identifier not found "IMyInterface"
test.lpr(14,45) Error: Unknown class field or method identifier "FMyInterface"
test.lpr(14,81) Error: Identifier not found "IMyInterface"
test.lpr(14,81) Error: Type used by implements must be an interface
test.lpr(14,81) Error: Implements property must have class or interface type
test.lpr(17,1) Error: Compilation raised exception internally
Fatal: Compilation aborted
An unhandled exception occurred at $00000000006241CC:
EAccessViolation: Access violation
  $00000000006241CC IS_NEW_VMT_ENTRY, line 477 of nobj.pas
  $00000000006266E2 GENERATE_VMT, line 921 of nobj.pas
  $00000000005FACEA TYPES_DEC, line 939 of pdecl.pas
  $00000000005FB275 TYPE_DEC, line 1018 of pdecl.pas
  $0000000000563449 READ_DECLARATIONS, line 2434 of psub.pas
  $000000000055DE98 BLOCK, line 318 of psub.pas
  $000000000056222A PARSE_BODY, line 1909 of psub.pas
  $000000000064B9FC PROC_PROGRAM, line 2166 of pmodules.pas
  $0000000000548BC2 COMPILE, line 407 of parser.pas
  $0000000000435291 COMPILE, line 288 of compiler.pas
  $00000000004012B7 main, line 265 of pp.pas
  $000000000042D350 SYSENTRY, line 141 of system.pp
Steps To Reproducecompile attached program with -MDelphi -O3
TagsNo tags attached.
Fixed in Revision
Attached Files


ravi dion

2021-03-05 21:48


test.lpr (249 bytes)   
program test;

  {$mode Delphi}

uses SysUtils;

  TBug = class
    Foo: TObject;
    property MyInterface: IMyInterface read FMyInterface implements IMyInterface;

test.lpr (249 bytes)   

Thaddy de Koning

2021-03-06 16:28

reporter   ~0129440

You did not define IMyInterface, nor did you initialize it in the constructor.
This belongs on the forum and is NOT a bug in FPC or Lazarus.

ravi dion

2021-03-06 16:50

reporter   ~0129443

Last edited: 2021-03-06 16:50

View 2 revisions

It's surely a bug because it crashes the compiler!! The compiler should never crash for valid or invalid code

Marco van de Voort

2021-03-06 20:42

manager   ~0129451

Indeed. A compiler crash is always a bug.

Thaddy de Koning

2021-03-06 22:41

reporter   ~0129456

Last edited: 2021-03-06 22:44

View 2 revisions

Well, if you feed dogfood to a cat it will eventually die.
Note I could not replictate the compiler crash.... Marco...

Do-wan Kim

2021-03-07 10:20

reporter   ~0129464

FPC trunk 3.3.1 r48894 report error correctly under x86-win32.

Thaddy de Koning

2021-03-07 11:19

reporter   ~0129473

Last edited: 2021-03-07 11:19

View 2 revisions

I still can not reproduce a compiler crash to the exrend that I don't believe it.
On 4 differemt platforms: win32, win64, ln32, lin64
Show us code to test.....and crashes the compiler

Sven Barth

2021-03-07 14:20

manager   ~0129480

@Thaddy: ravi dion's code crashes 3.2.0, but not trunk. Probably some revision fixed it. Maybe I can find and merge it to 3.2.1.

ravi dion

2021-03-08 15:39

reporter   ~0129509

Are you kidding me? Dumbass. If you have nothing to say, shut your mouth!

Code was attached and also added the revision, no idea why it does not appear here. However, FPC 3.2.1-r48511

Sven Barth

2021-03-09 08:44

manager   ~0129523

@ravi dion: please keep it civil. I know that Thaddy's comments can be aggravating at times, but that his no reason to escalate things.

Also as I said I can reproduce your crash with 3.2.0, but not with trunk. That means it got fixed in trunk and I (or someone else) will have to hunt the revision that fixed it so that it can hopefully be merged to 3.2.1.

Sven Barth

2021-03-10 18:26

manager   ~0129556

Okay, the revision that "fixed" it is 43612, though it only adjusted the error recovery due to the missing interface type. I'll need to experiment a bit whether all necessary error cases are indeed "safe" here.

ravi dion

2021-03-24 23:05

reporter   ~0129867

Still occurs with 3.2.1-r49042

Sven Barth

2021-03-25 08:40

manager   ~0129874

Because I did not change anything. If I had I would have resolved this issue.

Issue History

Date Modified Username Field Change
2021-03-05 21:48 ravi dion New Issue
2021-03-05 21:48 ravi dion File Added: test.lpr
2021-03-06 16:28 Thaddy de Koning Note Added: 0129440
2021-03-06 16:50 ravi dion Note Added: 0129443
2021-03-06 16:50 ravi dion Note Edited: 0129443 View Revisions
2021-03-06 20:42 Marco van de Voort Note Added: 0129451
2021-03-06 22:41 Thaddy de Koning Note Added: 0129456
2021-03-06 22:44 Thaddy de Koning Note Edited: 0129456 View Revisions
2021-03-07 10:20 Do-wan Kim Note Added: 0129464
2021-03-07 11:19 Thaddy de Koning Note Added: 0129473
2021-03-07 11:19 Thaddy de Koning Note Edited: 0129473 View Revisions
2021-03-07 14:20 Sven Barth Note Added: 0129480
2021-03-08 15:39 ravi dion Note Added: 0129509
2021-03-09 08:44 Sven Barth Note Added: 0129523
2021-03-10 18:26 Sven Barth Note Added: 0129556
2021-03-24 23:05 ravi dion Note Added: 0129867
2021-03-25 08:40 Sven Barth Note Added: 0129874