Bug? Compile fails with Lazarus 2.3.0 (Trunk, 2021-06-29) "Access Violation" lazarus / 13-General ---------------------------------------------------------------------- ArminLinder · 2021-07-23 10:24 When I compile, I get the following error message at the very end: Quoteunit1.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. ---------------------------------------------------------------------- marcov · 2021-07-23 10:34 I think FPC trunk is funky atm. I tried to build a snapshot a few days back and it also failed. ---------------------------------------------------------------------- ccrause · 2021-07-23 10:35 Sounds similar to issues #33593 and #34024.  But could be an entirely new bug... ---------------------------------------------------------------------- wp · 2021-07-23 11:25 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. ---------------------------------------------------------------------- AlexTP · 2021-07-23 11:37 Lazarus 2.3.0 (Trunk, 2021-06-29) win x32. Why not the fresh Lazarus version? Now it's 2021-07. ---------------------------------------------------------------------- Bart · 2021-07-23 11:41 Quote from: Alextp on July 23, 2021, 01:37:36 pmWhy 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 · 2021-07-23 13:35 How can Alextp know the Lazarus version used by the OP Nimral? ---------------------------------------------------------------------- ArminLinder · 2021-07-23 14:08 New info: I can reproduce the exact same behavior on macOS (Catalina) too. Quote from: wp on July 23, 2021, 03:35:17 pmHow 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. ---------------------------------------------------------------------- ArminLinder · 2021-07-23 14:22 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. ---------------------------------------------------------------------- ArminLinder · 2021-07-23 14:31 Followed your links ... 0034024 may be hot, the affected project uses generics. I'll do my best to remove them right now ... ---------------------------------------------------------------------- ArminLinder · 2021-07-23 19:35 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: QuoteCompile 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. ---------------------------------------------------------------------- ArminLinder · 2021-07-23 19:40 Installed from stable ... same crash. And I found one of my test projects which crashes (--> Attachment) QuoteHint: (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\GenericFil eDatabase\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 ---------------------------------------------------------------------- wp · 2021-07-23 21:20 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).