Recent

Author Topic: Bug? Compile fails with Lazarus 2.3.0 (Trunk, 2021-06-29) "Access Violation"  (Read 4135 times)

Nimral

  • Full Member
  • ***
  • Posts: 186
  • Keep it simple.
When I compile, I get the following error message at the very end:

Quote
unit1.pas(356,64075) Error: Compilation raised exception internally
Verbose: Compilation aborted
Debug: An unhandled exception occurred at $004087E3:
Debug: EAccessViolation: Access violation
Debug:   $004087E3
Debug:   $0056B702
Debug:   $0056C56E
Debug:   $00436BFC
Debug:   $004B81A6
Debug:   $0056B6E4
Debug:   $0056E842
Debug:   $00436C3B
Debug:   $00415065
Debug:
Verbose: C:\Lazarus\fpc\bin\i386-win32\ppc386.exe returned an error exitcode

There is nothing wrong with my program though, if I pick "Clean up and Build" or "Build", the next compile will succeed, and I can run the program *once*. If I touch a source file (add a comment and save without actually changing any code) the error comes back, until I do another "Build". Changing the config between "debug" and "release" will also clear the problem, guess because this triggers a rebuild too.

Anything I can do? Is this a known issue? If not, I'd rather attribute it to the FPC compiler but not Lazarus, right?

Armin.

Lazarus 2.0.12 & 2.3.0  (trunk) on Windows 10, Raspberry Pi OS "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9519
  • FPC developer.
I think FPC trunk is funky atm. I tried to build a snapshot a few days back and it also failed.
« Last Edit: July 23, 2021, 02:03:52 pm by marcov »

ccrause

  • Sr. Member
  • ****
  • Posts: 431
Sounds similar to issues #33593 and #34024.  But could be an entirely new bug...

wp

  • Hero Member
  • *****
  • Posts: 8727
Hey Nimral, do you know how many combinations of Lazarus and FPC versions can exist on any widgetset? I guess it is a high number. Therefore, your notice is useless because you do not specify your FPC and Laz version. (I can guess from the error message that the OS is Windows).

Also the information  which project you compile would be useful. A standard GUI program? A console program? Sometime even empty

I rarely use FPC trunk, so let me exclude this. But any combination of compatible Laz and FPC versions are working - for sure. When you observe such an error it could also be a defective third-party package. Rule of thumb: every additionally installed unneeded package may decrease the stability of your system.

Another option might be the "intelligence" of your anti-virus program which maybe has decided to play fools with Laz/FPC once more. Always put your Lazarus/FPC and project folders on the whitelist of the AV.
« Last Edit: July 23, 2021, 01:37:40 pm by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Alextp

  • Hero Member
  • *****
  • Posts: 1366
    • UVviewsoft
Lazarus 2.3.0 (Trunk, 2021-06-29)
win x32.

Why not the fresh Lazarus version? Now it's 2021-07.

Bart

  • Hero Member
  • *****
  • Posts: 4413
    • Bart en Mariska's Webstek
Why not the fresh Lazarus version? Now it's 2021-07.

It is the compiler that crashes, not Lazarus.
So, the question is: which version of fpc (most likely 3.2.2 or fpc trunk, and in the latter case: which revision of fpc trunk)?

Bart

wp

  • Hero Member
  • *****
  • Posts: 8727
How can Alextp know the Lazarus version used by the OP Nimral?
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Nimral

  • Full Member
  • ***
  • Posts: 186
  • Keep it simple.
New info: I can reproduce the exact same behavior on macOS (Catalina) too.

How can Alextp know the Lazarus version used by the OP Nimral?

Option 1: he is a clairvoyant
Opton 2: he read the caption of my post :-)

For all version infos please see the attachment, the common ground seems to be FPC Version: 3.2.2

OS:
macOS Catalina 10.15.5
Microsoft Windows 10.0.19043.1110

Anything else I can provide?

Armin.
« Last Edit: July 23, 2021, 04:10:25 pm by Nimral »
Lazarus 2.0.12 & 2.3.0  (trunk) on Windows 10, Raspberry Pi OS "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15

Nimral

  • Full Member
  • ***
  • Posts: 186
  • Keep it simple.
More info: some of my projects are affected, others are not. I haven't found any common ground yet. Unfortunately the one I have right now I cannot publish, I'll try to derive a smaller version and strip it down as far as possible and then post it here.

With the most simple "Hello World" GUI program, 1 form, 1 button, 1 messagebox, freshly created on the Mac, the problem does not arise.

Finding this by comparing project files and options could take quite some time ... almost indefinite possibilities ... any hint from a compiler guru where to start looking would be a great time and nerve saver.

Armin.
« Last Edit: July 23, 2021, 04:27:04 pm by Nimral »
Lazarus 2.0.12 & 2.3.0  (trunk) on Windows 10, Raspberry Pi OS "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15

Nimral

  • Full Member
  • ***
  • Posts: 186
  • Keep it simple.
Followed your links ...

0034024 may be hot, the affected project uses generics.

I'll do my best to remove them right now ...
Lazarus 2.0.12 & 2.3.0  (trunk) on Windows 10, Raspberry Pi OS "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15

Nimral

  • Full Member
  • ***
  • Posts: 186
  • Keep it simple.
Ok, I'll quit for today, but I think I got more hints.

I could not find any clear indication that Generics are involved. Actually I have only found this one single project which shows the crash, I thought I had occasionally seen it before, but didn't care much since the projects involved were only test stuff. Unfortunately this project is also the largest one. And the source has been shuffled back and forth between Windows and macOS, there is a certain chance that it picked up *something* which causes this effect.

Mabe this approach helps: I used FPCUpDeluxe with debug option set to install another Lazarus from latest trunk, and got better exception infos. The effect is still reproducible. Since I compiled with debug, this time I got better infos:

Quote
Compile Project, Target: project1.exe: Exit code 1, Errors: 1, Hints: 38
Hint: Start of reading config file C:\fpcupdeluxetrunk\fpc\bin\i386-win32\fpc.cfg
Hint: End of reading config file C:\fpcupdeluxetrunk\fpc\bin\i386-win32\fpc.cfg
Verbose: Free Pascal Compiler version 3.3.1-r49632 [2021/07/23] for i386
Verbose: Copyright (c) 1993-2021 by Florian Klaempfl and others
Verbose: Target OS: Win32 for i386
Verbose: Compiling project1.lpr
Verbose: Compiling unit1.pas
Verbose: Compiling unit1.pas
fgl.pp(926,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(926,1) Hint: Inlining disabled
fgl.pp(941,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(941,1) Hint: Inlining disabled
fgl.pp(1001,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(1001,1) Hint: Inlining disabled
fgl.pp(1006,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(1006,1) Hint: Inlining disabled
fgl.pp(959,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(959,1) Hint: Inlining disabled
fgl.pp(964,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(964,1) Hint: Inlining disabled
fgl.pp(946,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(946,1) Hint: Inlining disabled
fgl.pp(951,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(951,1) Hint: Inlining disabled
fgl.pp(993,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(993,1) Hint: Inlining disabled
fgl.pp(926,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(926,1) Hint: Inlining disabled
fgl.pp(941,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(941,1) Hint: Inlining disabled
fgl.pp(1001,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(1001,1) Hint: Inlining disabled
fgl.pp(1006,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(1006,1) Hint: Inlining disabled
fgl.pp(959,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(959,1) Hint: Inlining disabled
fgl.pp(964,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(964,1) Hint: Inlining disabled
fgl.pp(946,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(946,1) Hint: Inlining disabled
fgl.pp(951,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(951,1) Hint: Inlining disabled
fgl.pp(993,1) Note: "inherited" not yet supported inside inline procedure/function
fgl.pp(993,1) Hint: Inlining disabled
unit1.pas(37,33) Verbose: Parameter "Sender" not used
unit1.pas(36,36) Verbose: Parameter "Sender" not used
unit1.pas(38,33) Verbose: Parameter "Sender" not used
unit1.pas(41,28) Verbose: Parameter "Sender" not used
unit1.pas(46,33) Verbose: Parameter "Sender" not used
unit1.pas(42,26) Verbose: Parameter "Sender" not used
unit1.pas(43,27) Verbose: Parameter "Sender" not used
unit1.pas(372,63623) Error: Compilation raised exception internally
Verbose: Compilation aborted
Debug: An unhandled exception occurred at $00408783:
Debug: EAccessViolation: Access violation
Debug:   $00408783  fpc_shortstr_to_ansistr,  line 509 of C:/fpcupdeluxetrunk/fpcsrc/rtl/inc/astrings.inc
Debug:   $0059D160  LOADUNITS,  line 523 of pmodules.pas
Debug:   $0059DF90  PROC_UNIT,  line 978 of pmodules.pas
Debug:   $0043B09A  COMPILE,  line 402 of parser.pas
Debug:   $004C9F7A  TPPUMODULE__LOADPPU,  line 2251 of fppu.pas
Debug:   $0059D143  LOADUNITS,  line 518 of pmodules.pas
Debug:   $005A01C1  PROC_PROGRAM,  line 2141 of pmodules.pas
Debug:   $0043B0E1  COMPILE,  line 410 of parser.pas
Debug:   $004169C6  COMPILE,  line 288 of compiler.pas
Debug:
Verbose: C:\fpcupdeluxetrunk\fpc\bin\i386-win32\ppc386.exe returned an error exitcode

Maybe this helps?

Armin.



Lazarus 2.0.12 & 2.3.0  (trunk) on Windows 10, Raspberry Pi OS "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15

Nimral

  • Full Member
  • ***
  • Posts: 186
  • Keep it simple.
Installed from stable ... same crash. And I found one of my test projects which crashes (--> Attachment)

Quote
Hint: (11030) Start of reading config file C:\fpcupdeluxestable\fpc\bin\i386-win32\fpc.cfg
Hint: (11031) End of reading config file C:\fpcupdeluxestable\fpc\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 3.2.2-r49371 [2021/07/23] for i386
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Win32 for i386
(3104) Compiling project1.lpr
(3104) Compiling unit1.pas
(3104) Compiling unit1.pas

[...]

D:\Users\Linder\Documents\Programmierung\lazarus\Components\GenericFileDatabase\unit1.pas(373,63617) Error: (1026) Compilation raised exception internally
Fatal: (1018) Compilation aborted
An unhandled exception occurred at $004087F3:
EAccessViolation: Access violation
  $004087F3  fpc_shortstr_to_ansistr,  line 505 of C:/fpcupdeluxestable/fpcsrc/rtl/inc/astrings.inc
  $0056C772  LOADUNITS,  line 519 of pmodules.pas
  $0056D5DE  PROC_UNIT,  line 967 of pmodules.pas
  $00437C6C  COMPILE,  line 399 of parser.pas
  $004B9216  TPPUMODULE__LOADPPU,  line 2133 of fppu.pas
  $0056C754  LOADUNITS,  line 514 of pmodules.pas
  $0056F8B2  PROC_PROGRAM,  line 2090 of pmodules.pas
  $00437CAB  COMPILE,  line 407 of parser.pas
  $004160D5  COMPILE,  line 288 of compiler.pas

Error: C:\fpcupdeluxestable\fpc\bin\i386-win32\ppc386.exe returned an error exitcode

« Last Edit: July 23, 2021, 09:53:18 pm by Nimral »
Lazarus 2.0.12 & 2.3.0  (trunk) on Windows 10, Raspberry Pi OS "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15

wp

  • Hero Member
  • *****
  • Posts: 8727
Same problem with Laz trunk/fpc 3.2.0, Laz trunk / fpc 3.2.2 (32 bit), Laz 2.2RC1 / FPC 3.2.2, Laz 2.0.12 / FPC 3.2  on Win 10.

Laz 2.0.8/FPC 3.0.4 does not compile for another reason (in DataUnit, GetMem(PBuffer, FRecSize) where PBuffer is ^T).
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018