Recent

Author Topic: Maximum size of unit: Internal Error 200205172  (Read 1383 times)

Grahame Grieve

  • New Member
  • *
  • Posts: 44
Maximum size of unit: Internal Error 200205172
« on: September 12, 2020, 01:38:19 am »
I have a program that compiles ok, but I get an error during linking:

project1.lpr(81,1) Error: Internal Error 200205172

After spending some time investigating, I've narrowed the error down to a large generated unit with 182k lines. if I start commenting out code, I can eventually get it compile and link at about half that size. It doesn't appear be any specific line in the code - I can comment out different parts of the code.

It links at 21,737,733 bytes. It fails to link at 22,777,193 bytes

How big can units get before there's a problem?

details: Lazarus 2.10 on win10, compiling for win64. If you want to reproduce, grab the master of https://github.com/grahamegrieve/delphi-markdown to a directory called 'markdown' and grab the 'fpc-linking-fail' branch of  https://github.com/grahamegrieve/fhirserver
to a sibling directory of the markdown directory, and compile the program. It fails for me, but compiles ok if I disable the define {$DEFINE FHIR_NUTRITIONORDER} on line 61 of library/r2/fhir.r2.inc

jamie

  • Hero Member
  • *****
  • Posts: 3538
Re: Maximum size of unit: Internal Error 200205172
« Reply #1 on: September 12, 2020, 01:49:24 am »
I believe the compiler is still 32 bit in both cases but I could be wrong there..

you need to split your code up in units..
The only true wisdom is knowing you know nothing

Grahame Grieve

  • New Member
  • *
  • Posts: 44
Re: Maximum size of unit: Internal Error 200205172
« Reply #2 on: September 12, 2020, 01:51:22 am »

Grahame Grieve

  • New Member
  • *
  • Posts: 44
Re: Maximum size of unit: Internal Error 200205172
« Reply #3 on: September 12, 2020, 01:52:37 am »
> you need to split your code up in units..

That's pretty challenging. I have much bigger units. Delphi cmopiles them ok in both 32 and 64 bit.

Any actual documentation about maximum size?

winni

  • Hero Member
  • *****
  • Posts: 1813
Re: Maximum size of unit: Internal Error 200205172
« Reply #4 on: September 12, 2020, 02:12:01 am »
I've narrowed the error down to a large generated unit with 182k lines. if I start commenting out code, I can eventually get it compile and link at about half that size. It doesn't appear be any specific line in the code - I can comment out different parts of the code.


Hi!

It sounds like that you haven't understood the unit concept.
The number of units in your project is (nearly ) unlimited.

But as you see: such horrible amount of lines of code in one unit brings trouble.

And the error number makes not hope that this error will be fixed soon:
It is from May 2002.

Seems nobody except you needs a patch.

Winni



jamie

  • Hero Member
  • *****
  • Posts: 3538
Re: Maximum size of unit: Internal Error 200205172
« Reply #5 on: September 12, 2020, 02:19:42 am »
Ok..

I am just curious, have you got you debug info set as external file instead of it building on the end ?

It most likely won't matter in this case But I always use an external debug file.
The only true wisdom is knowing you know nothing

Grahame Grieve

  • New Member
  • *
  • Posts: 44
Re: Maximum size of unit: Internal Error 200205172
« Reply #6 on: September 12, 2020, 02:24:25 am »
how do I do that?

Grahame Grieve

  • New Member
  • *
  • Posts: 44
Re: Maximum size of unit: Internal Error 200205172
« Reply #7 on: September 12, 2020, 02:26:54 am »
> It sounds like that you haven't understood the unit concept.

I've been programming in pascal for 35 year, and commercially for 27. I think I'm doing ok there

> But as you see: such horrible amount of lines of code in one unit brings trouble.

Welcome to industrial scale programming...

jamie

  • Hero Member
  • *****
  • Posts: 3538
Re: Maximum size of unit: Internal Error 200205172
« Reply #8 on: September 12, 2020, 02:29:42 am »
how do I do that?

go to your project Project:Project options:Debugging: Check mark use "External debug symbol file".

 It makes the file much smaller looking space but I can't say that it will fix your issue, most likely not but I always keep it that way.
The only true wisdom is knowing you know nothing

Grahame Grieve

  • New Member
  • *
  • Posts: 44
Re: Maximum size of unit: Internal Error 200205172
« Reply #9 on: September 12, 2020, 02:50:10 am »
thanks. it doesn't make any difference.

jamie

  • Hero Member
  • *****
  • Posts: 3538
Re: Maximum size of unit: Internal Error 200205172
« Reply #10 on: September 12, 2020, 02:51:54 am »
I am not sure which version compiler started using it but there is a large Big obj COFF file format and looking at the fpc compiler switches It looks like it may be in 3.3.1 trunk
https://www.freepascal.org/docs-html/user/userap1.html

I thought maybe it was for the 32 bit target but it seems there.

Quote
Free Pascal Compiler version 3.3.1 [2020/02/05] for x86_64 
Copyright (c) 1993-2020 by Florian Klaempfl and others

So not sure what is happening there but it indicates it should already be in large mode.
The only true wisdom is knowing you know nothing

Grahame Grieve

  • New Member
  • *
  • Posts: 44
Re: Maximum size of unit: Internal Error 200205172
« Reply #11 on: September 12, 2020, 03:37:14 am »
Looks like I should try with FPC 3.3.1 . Lazarus tells me that it's running on 3.2. Im not sure how to change that.

jamie

  • Hero Member
  • *****
  • Posts: 3538
Re: Maximum size of unit: Internal Error 200205172
« Reply #12 on: September 12, 2020, 04:07:56 am »
You may want to report this incident to the bug page ;)

It's very possible it's an oversite, oh no, not that!  :(
The only true wisdom is knowing you know nothing

440bx

  • Hero Member
  • *****
  • Posts: 2001
Re: Maximum size of unit: Internal Error 200205172
« Reply #13 on: September 12, 2020, 05:22:55 am »
project1.lpr(81,1) Error: Internal Error 200205172
I've been told in the past that _any_ internal error is considered a bug in the compiler (which makes sense.)  I believe that @Jamie is right when he suggests reporting it as a bug.

Hopefully, one of the FPC developers will see your post and state what the correct course of action is.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 10482
Re: Maximum size of unit: Internal Error 200205172
« Reply #14 on: September 12, 2020, 08:33:48 am »
Yes, indeed *any* internal error is a bug and should be reported. This is still true and will likely always be true.
When you ask a question that is actually answered in the documentation, you are either lazy or a moron.

 

TinyPortal © 2005-2018