TDeque issue on MacOS Arm M1 lazarus / 64-FPC development ---------------------------------------------------------------------- powerpcer · 2021-12-13 06:30 TDeque.ClearData; this method should change to this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TDeque.ClearData;var  i: SizeUint;begin  if IsManagedType(T) then    if FData <> nil then //<--add checking, else When FData is nil(why not happen on Windows?)    for i := Low(FData) to High(FData) do      Finalize(FData[i]);  FillChar(FData[Low(FData)], SizeUInt(Length(FData))*SizeOf(T), 0);end; ---------------------------------------------------------------------- Bart · 2021-12-13 11:06 Please file a bugreport on the FPC issue tracker. Bart ---------------------------------------------------------------------- AlexTP · 2021-12-13 11:30 I don't get your idea, how macOS can be 'bad' here and Windows can be ok here? Code is crossplatform! Show the failing small project. ---------------------------------------------------------------------- PascalDragon · 2021-12-13 12:41 Quote from: powerpcer on December 13, 2021, 07:30:44 amTDeque.ClearData; this method should change to this Please provide a complete example that fails. ---------------------------------------------------------------------- powerpcer · 2021-12-13 21:21 Quote from: Alextp on December 13, 2021, 12:30:40 pmI don't get your idea, how macOS can be 'bad' here and Windows can be ok here? Code is crossplatform! Show the failing small project. i just build your old version CudaText 1.95.x , it work!! but when the App close in the FormDestroy of FormMain, the freeandnil(FconsoleQueue) report me access violation. and follow the debugger, it show me Fdata on TDeque.ClearData is Nil, and Low(Fdata) to High(Fdata) work, so Finalize(Fdata) got access violation. my FPC version is 3.2.2 come from FPCDeluxe project. ---------------------------------------------------------------------- AlexTP · 2021-12-13 21:36 I cannot reproduce this in the CudaText because I don't support such OLD versions! In app 1.152, the code is changed (and no error) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i initialization // proc_globdata.pas  AppConsoleQueue:= TAppConsoleQueue.Create;  finalization  FreeAndNil(AppConsoleQueue); ---------------------------------------------------------------------- powerpcer · 2021-12-13 23:39 Quote from: Alextp on December 13, 2021, 10:36:38 pmI cannot reproduce this in the CudaText because I don't support such OLD versions! In app 1.152, the code is changed (and no error) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i initialization // proc_globdata.pas  AppConsoleQueue:= TAppConsoleQueue.Create;  finalization  FreeAndNil(AppConsoleQueue);   because FConsoleQueue:= TAppConsoleQueue.Create;   was created in FormCreate of FormMain so, that's why FreeAndNil(FConsoleQueue); not explode, . but same time, i build it in x86 MacOS is working correctly. ---------------------------------------------------------------------- AlexTP · 2021-12-13 23:55 So we don't have a repro project / repro in my editor. ---------------------------------------------------------------------- powerpcer · 2021-12-14 01:26 Quote from: Alextp on December 14, 2021, 12:55:28 amSo we don't have a repro project / repro in my editor. Exception: EXC_BAD_ACCESS Reproduce, just make an Application with a Form with code below, very simple Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs,gqueue; type  TAppConsoleQueue = specialize Tqueue;   { TForm1 }   TForm1 = class(TForm)    procedure FormCreate(Sender: TObject);    procedure FormDestroy(Sender: TObject);  private    FConsoleQueue:TAppConsoleQueue;  public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.FormCreate(Sender: TObject);begin   FConsoleQueue:=TAppConsoleQueue.Create;end; procedure TForm1.FormDestroy(Sender: TObject);begin  FreeAndNil(FConsoleQueue);end; end. ---------------------------------------------------------------------- PascalDragon · 2021-12-14 08:17 Quote from: powerpcer on December 14, 2021, 02:26:14 amQuote from: Alextp on December 14, 2021, 12:55:28 amSo we don't have a repro project / repro in my editor. Exception: EXC_BAD_ACCESS Reproduce, just make an Application with a Form with code below, very simple This is not a complete example. Either provide one that doesn't depend on the LCL or use the publish project option to provide the complete project. ---------------------------------------------------------------------- powerpcer · 2021-12-14 10:32 Quote from: PascalDragon on December 14, 2021, 09:17:23 amQuote from: powerpcer on December 14, 2021, 02:26:14 amQuote from: Alextp on December 14, 2021, 12:55:28 amSo we don't have a repro project / repro in my editor. Exception: EXC_BAD_ACCESS Reproduce, just make an Application with a Form with code below, very simple This is not a complete example. Either provide one that doesn't depend on the LCL or use the publish project option to provide the complete project. for what purpose? ---------------------------------------------------------------------- bytebites · 2021-12-14 11:45 Complete Lazarus project attached, no error in linux. ---------------------------------------------------------------------- PascalDragon · 2021-12-14 12:28 Quote from: powerpcer on December 14, 2021, 11:32:11 amQuote from: PascalDragon on December 14, 2021, 09:17:23 amQuote from: powerpcer on December 14, 2021, 02:26:14 amQuote from: Alextp on December 14, 2021, 12:55:28 amSo we don't have a repro project / repro in my editor. Exception: EXC_BAD_ACCESS Reproduce, just make an Application with a Form with code below, very simple This is not a complete example. Either provide one that doesn't depend on the LCL or use the publish project option to provide the complete project. for what purpose? If we can't reproduce the problem then there is no way for us to fix it. And with partial code it is very likely that it's something else that triggers the problem, namely something that was left out. This has happened in the past, thus a complete example to reproduce the problem is very important. Can you reproduce the problem with the project provided by bytebites? ---------------------------------------------------------------------- powerpcer · 2021-12-14 23:10 Quote from: PascalDragon on December 14, 2021, 01:28:39 pmQuote from: powerpcer on December 14, 2021, 11:32:11 amQuote from: PascalDragon on December 14, 2021, 09:17:23 amQuote from: powerpcer on December 14, 2021, 02:26:14 amQuote from: Alextp on December 14, 2021, 12:55:28 amSo we don't have a repro project / repro in my editor. Exception: EXC_BAD_ACCESS Reproduce, just make an Application with a Form with code below, very simple This is not a complete example. Either provide one that doesn't depend on the LCL or use the publish project option to provide the complete project. for what purpose? If we can't reproduce the problem then there is no way for us to fix it. And with partial code it is very likely that it's something else that triggers the problem, namely something that was left out. This has happened in the past, thus a complete example to reproduce the problem is very important. Can you reproduce the problem with the project provided by bytebites? bytebites's code run on ARM M1 MacOS when clicking close button, will raise exception, he reproduced it!! it is simple like that. attach is my build. ---------------------------------------------------------------------- Jonas Maebe · 2022-04-09 18:42 The crash is caused by https://gitlab.com/freepascal.org/fpc/source/-/issues/39179 ---------------------------------------------------------------------- PascalDragon · 2022-04-10 14:11 Quote from: Jonas Maebe on April 09, 2022, 08:42:36 pmThe crash is caused by https://gitlab.com/freepascal.org/fpc/source/-/issues/39179 So this will be fixed with the upcoming 3.2.4. ---------------------------------------------------------------------- 440bx · 2022-04-10 19:44 Quote from: PascalDragon on April 10, 2022, 04:11:56 pmSo this will be fixed with the upcoming 3.2.4. Any "guestimate" as to when 3.2.4 is going to be released ? ---------------------------------------------------------------------- PascalDragon · 2022-04-13 10:17 There is still the issue with linking against C code on Linux platforms that crept up and before that isn't solved we simply can't release a new version, because it would be useless on current Linux distros.