Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-10

Fatal: Internal error 200512115

11 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
to Alexander Shishkin
Alexander Shishkin wrote
I`ve got this with 2.5.1 & 2.7.1 1) unable to clean reproduce (real code is https://github.com/alexvins/dwscript/tree/628669df8fd349968e7498ab1da617be6c4f3977) 2) error reported in the middle of EMPTY line.

This internal error indicates that a problem occurred while generating code for a specialization of a generic. This code generation does not happen when the specialization is declared, but only after all the code in the unit has been compiled. That's why you get a bogus error location.

3) no ideas how to to make workaround

Me neither, except for not using generics at all (or disabling your specializations one by one to figure out which one triggers the problem).

Jonas

Reply by email

Sven Barth
to Alexander Shishkin: I`ve got this with 2.5.1 & 2.7.1 1) unable to clean reproduce (real code is…
Alexander Shishkin wrote 9 lines
I`ve got this with 2.5.1 & 2.7.1 1) unable to clean reproduce (real code is https://github.com/alexvins/dwscript/tree/628669df8fd349968e7498ab1da617be6c4f3977) 2) error reported in the middle of EMPTY line. 3) no ideas how to to make workaround Can anyone help?

As Jonas said this error is related to generics. Is the code where this happens dependant on the LCL? If not I could try to compile it using my generic-branch to see whether this problem will go away once my changes are ready and merged.

It might also help if you follow Jonas's advice to find the specialization that triggers the error.

Regards,
Sven

Reply by email

Alexander Shishkin
to Jonas Maebe: This internal error indicates that a problem occurred while generating code for a…

27.10.2011 17:40, Jonas Maebe пишет:

Show quoted text 21 lines
On 27 Oct 2011, at 15:26, Alexander Shishkin wrote: > I`ve got this with 2.5.1 & 2.7.1 > > 1) unable to clean reproduce (real code is > https://github.com/alexvins/dwscript/tree/628669df8fd349968e7498ab1da617be6c4f3977) > > 2) error reported in the middle of EMPTY line. This internal error indicates that a problem occurred while generating code for a specialization of a generic. This code generation does not happen when the specialization is declared, but only after all the code in the unit has been compiled. That's why you get a bogus error location. > 3) no ideas how to to make workaround Me neither, except for not using generics at all (or disabling your specializations one by one to figure out which one triggers the problem).

I found problematic place. BTW the compiler internal error line&col position was right, but unit name was wrong.

Reply by email

Sven Barth
to Alexander Shishkin
Alexander Shishkin wrote 25 lines
27.10.2011 17:40, Jonas Maebe пишет: > > On 27 Oct 2011, at 15:26, Alexander Shishkin wrote: > >> I`ve got this with 2.5.1 & 2.7.1 >> >> 1) unable to clean reproduce (real code is >> https://github.com/alexvins/dwscript/tree/628669df8fd349968e7498ab1da617be6c4f3977) >> >> >> 2) error reported in the middle of EMPTY line. > > This internal error indicates that a problem occurred while generating > code for a specialization of a generic. This code generation does not > happen when the specialization is declared, but only after all the code > in the unit has been compiled. That's why you get a bogus error location. > >> 3) no ideas how to to make workaround > > Me neither, except for not using generics at all (or disabling your > specializations one by one to figure out which one triggers the problem). > > I found problematic place. BTW the compiler internal error line&col position was right, but unit name was wrong.

It would be nice if you'd mention line, column, incorrect unitname and correct unitname. Then I might be able to help you ;)

Regards,
Sven

Reply by email

Alexander Shishkin
to Sven Barth

27.10.2011 18:36, Sven Barth пишет:

Show quoted text 41 lines
Am 27.10.2011 16:19, schrieb Alexander Shishkin: > 27.10.2011 17:40, Jonas Maebe пишет: >> >> On 27 Oct 2011, at 15:26, Alexander Shishkin wrote: >> >>> I`ve got this with 2.5.1 & 2.7.1 >>> >>> 1) unable to clean reproduce (real code is >>> https://github.com/alexvins/dwscript/tree/628669df8fd349968e7498ab1da617be6c4f3977) >>> >>> >>> >>> 2) error reported in the middle of EMPTY line. >> >> This internal error indicates that a problem occurred while generating >> code for a specialization of a generic. This code generation does not >> happen when the specialization is declared, but only after all the code >> in the unit has been compiled. That's why you get a bogus error >> location. >> >>> 3) no ideas how to to make workaround >> >> Me neither, except for not using generics at all (or disabling your >> specializations one by one to figure out which one triggers the >> problem). >> >> > I found problematic place. BTW the compiler internal error line&col > position was right, but unit name was wrong. It would be nice if you'd mention line, column, incorrect unitname and correct unitname. Then I might be able to help you ;) Regards, Sven _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Wrong message:
...\Source\dwsSymbols.pas(264,20) Fatal: Internal error 200512115 Real place:
\Source\dwsUtils.pas(263,20)

Patch for workaround:

Source/dwsUtils.pas | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/Source/dwsUtils.pas b/Source/dwsUtils.pas index a733f57..89b7dbb 100644
--- a/Source/dwsUtils.pas
+++ b/Source/dwsUtils.pas
@@ -231,11 +231,17 @@ TSimpleHashBucket<T> = record

     {: Minimalistic open-addressing hash, subclasses must override
SameItem and GetItemHashCode.
        HashCodes *MUST* be non zero }
+
+   { TSimpleHash }
+
     TSimpleHash<T> = class
        {$IFDEF FPC}
        private
          type
            THashBucket = TSimpleHashBucket<T>;
+      public
+         type
+           THashEnumProc = TSimpleHashProc<T>;
        {$ENDIF}
        private
           {$IFDEF FPC}
@@ -260,7 +266,11 @@    TSimpleHash<T> = class
           function Extract(const anItem : T) : Boolean; // true if
extracted
           function Contains(const anItem : T) : Boolean;
           function Match(var anItem : T) : Boolean;
+         {$IFDEF FPC}
+         procedure Enumerate(const callBack : THashEnumProc);
+         {$ELSE}
           procedure Enumerate(const callBack : TSimpleHashProc<T>);
+         {$ENDIF}
           procedure Clear;
           property Count : Integer read FCount;
@@ -1535,24 +1545,27 @@ function TSimpleHash<T>.Match(var anItem : T) :
Boolean;
  // Enumerate
  //
-procedure TSimpleHash<T>.Enumerate(const callBack : TSimpleHashProc<T>);
+{$IFDEF FPC}
+procedure TSimpleHash<T>.Enumerate(const callBack: THashEnumProc);
  var
     i : Integer;
-{$IFDEF FPC}
    _cb:TSimpleHashProc<T>; //TODO: remove ugly workaround
-{$ENDIF}
  begin
-   {$IFDEF FPC}
     _cb := callBack;
     for i:=0 to High(FBuckets) do
        if FBuckets[i].HashCode0 then
           _cb(FBuckets[i].Value);
-   {$ELSE}
+end;
+{$ELSE}
+procedure TSimpleHash<T>.Enumerate(const callBack : TSimpleHashProc<T>);
+var
+   i : Integer;
+begin
     for i:=0 to High(FBuckets) do
        if FBuckets[i].HashCode0 then
           callBack(FBuckets[i].Value);
-   {$ENDIF}
  end;
+{$ENDIF}
  // Clear
  //

Reply by email

Sven Barth
to Alexander Shishkin
Alexander Shishkin wrote 6 lines
Wrong message: ...\Source\dwsSymbols.pas(264,20) Fatal: Internal error 200512115 Real place: \Source\dwsUtils.pas(263,20) Patch for workaround:

[snip]

Thanks. As this is a bug related to Delphi-style generics it is likely that my branch fixes that, but I'll test that nevertheless.

Regards,
Sven

Reply by email

Alexander Shishkin
to Sven Barth

27.10.2011 18:52, Sven Barth пишет:

Show quoted text 16 lines
Am 27.10.2011 16:49, schrieb Alexander Shishkin: > Wrong message: > ...\Source\dwsSymbols.pas(264,20) Fatal: Internal error 200512115 > Real place: > \Source\dwsUtils.pas(263,20) > > Patch for workaround: [snip] Thanks. As this is a bug related to Delphi-style generics it is likely that my branch fixes that, but I'll test that nevertheless. Regards, Sven

Most bugs that I`ve got today with generics are issues with inline specialization.

Reply by email

Sven Barth
to Alexander Shishkin
Alexander Shishkin wrote 19 lines
27.10.2011 18:52, Sven Barth пишет: > Am 27.10.2011 16:49, schrieb Alexander Shishkin: >> Wrong message: >> ...\Source\dwsSymbols.pas(264,20) Fatal: Internal error 200512115 >> Real place: >> \Source\dwsUtils.pas(263,20) >> >> Patch for workaround: > [snip] > > Thanks. As this is a bug related to Delphi-style generics it is likely > that my branch fixes that, but I'll test that nevertheless. > > Regards, > Sven > Most bugs that I`ve got today with generics are issues with inline specialization.

Most of that bugs should be fixed in my branch, but it seems that I have broken something else so I need to fix that first, before I can compile your problematic spot. ;)

Regards,
Sven

Reply by email

Alexander Shishkin
to Sven Barth

27.10.2011 23:11, Sven Barth пишет:

Show quoted text 33 lines
On 27.10.2011 17:45, Alexander Shishkin wrote: > 27.10.2011 18:52, Sven Barth пишет: >> Am 27.10.2011 16:49, schrieb Alexander Shishkin: >>> Wrong message: >>> ...\Source\dwsSymbols.pas(264,20) Fatal: Internal error 200512115 >>> Real place: >>> \Source\dwsUtils.pas(263,20) >>> >>> Patch for workaround: >> [snip] >> >> Thanks. As this is a bug related to Delphi-style generics it is likely >> that my branch fixes that, but I'll test that nevertheless. >> >> Regards, >> Sven > >> > Most bugs that I`ve got today with generics are issues with inline > specialization. Most of that bugs should be fixed in my branch, but it seems that I have broken something else so I need to fix that first, before I can compile your problematic spot. ;) Regards, Sven _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
New problem is \Source\dwsJSON.pas(1,1) Fatal: Compilation aborted
without any other errors.

Reply by email

Alexander Shishkin
to Alexander Shishkin: I`ve got this with 2.5.1 & 2.7.1 1) unable to clean reproduce (real code is…

27.10.2011 17:26, Alexander Shishkin пишет:

Show quoted text 5 lines
I`ve got this with 2.5.1 & 2.7.1 1) unable to clean reproduce (real code is https://github.com/alexvins/dwscript/tree/628669df8fd349968e7498ab1da617be6c4f3977)

Fatal: Compilation aborted
An unhandled exception occurred at $0043ED8C :
EAccessViolation : Access violation
$0043ED8C line 2092 of symtable.pas
$0051BBEA line 299 of pbase.pas
$005317FB line 1370 of pexpr.pas
$0052DCEF line 2438 of pexpr.pas
$00532615 line 2949 of pexpr.pas
$0053263E line 2951 of pexpr.pas
$0053263E line 2951 of pexpr.pas
$0053263E line 2951 of pexpr.pas
$00532D25 line 3059 of pexpr.pas
$0051E82F line 1172 of pstatmnt.pas
$0051BE7E line 77 of pstatmnt.pas
$0051E71C line 1135 of pstatmnt.pas
$0051ECA5 line 1300 of pstatmnt.pas
$005160A9 line 243 of psub.pas
$00518FE2 line 1411 of psub.pas
$005194B7 line 1576 of psub.pas
$0051A33E line 2028 of psub.pas

On compiling lang_tests.lpr

Reply by email