Lazarus

Announcements => Lazarus => Topic started by: mattias on January 05, 2022, 11:57:19 pm

Title: Lazarus Release 2.2.0
Post by: mattias on January 05, 2022, 11:57:19 pm
The Lazarus team is glad to announce the release of Lazarus 2.2.

This release was built with FPC 3.2.2.

Here is the list of changes for Lazarus and Free Pascal:
http://wiki.lazarus.freepascal.org/Lazarus_2.2.0_release_notes
http://wiki.lazarus.freepascal.org/User_Changes_3.2.2

Here is the list of fixes for Lazarus 2.2.x:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commits/fixes_2_2

The release is available for download on SourceForge:
http://sourceforge.net/projects/lazarus/files/

Choose your CPU, OS, distro and then the "Lazarus 2.2.0" directory.

Checksums for the SourceForge files:
https://www.lazarus-ide.org/index.php?page=checksums#2_2_0

Minimum requirements:

Windows:
   2k, XP, Vista, 7, 8, 8.1 and 10, 32 or 64bit.

FreeBSD/Linux:
   gtk 2.8 for gtk2, qt4.5 for qt, qt5.6 for qt5, 32 or 64bit.

Mac OS X:
   Cocoa (64bit) 10.12 to 11.4, Carbon (32bit) 10.5 to 10.14, qt and
   qt5 (32 or 64bit).

The gitlab page:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/lazarus_2_2_0

For people who are blocked by SF, the Lazarus releases from SourceForge are mirrored at:ftp://ftp.freepascal.org/pub/lazarus/releases/
Title: Re: Lazarus Release 2.2.0
Post by: dbannon on January 06, 2022, 12:04:05 am
Wow, can I be the first to thank and congratulate the team for this great work ?

Davo
Title: Re: Lazarus Release 2.2.0
Post by: piola on January 06, 2022, 12:18:50 am
Long awaited, thank you very much! Will try immediately.

Please keep up the great work.
Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 06, 2022, 12:19:51 am
As a side note:

For x86_64,both FPC 3.2.0 and FPC 3.2.2 have a bug in the optimizer.

From current observation this issue is extremely rarely triggered. However, if the IDE for x86_64 is compiled with O2 or higher, then at least FpDebug will be broken (The affected code is a generic in LazUtils: TLazThreadedQueue or TLazFifoQueue).
Other parts of the IDE have not yet been observed, however even if the bug is in effect, the broken code needs to be executed with very specific arguments. Therefore, actual faulty behaviour could occur rather seldom. Yet, as any bug, it can strike at any time.

Compiling with -O1 is save
Compiling with -O2 -OoNoPeepHole  should also be save..

It is recommended for x86_64 users, to build your IDE with -O1 only.

This issue also affects 2.0.x (or potentially other code) if build with 3.2.0 or 3.2.2.
Since the triggers for this issue (complier going wrong, and resulting broken code actually failing) are extremely complex, not every IDE build (with 3.2.0/2 and -O2 up) will immediately show symptoms. It is possible that an affected build runs without issues, or fails once every few month only.

As for your own projects, you need to come to your own decision.  I have not seen any reports of this issue (other for the IDE), and 3.2.0 has been out for a good time.
Yet, no guarantees.

The issue is fixed in 3.2.3, so with the upcoming 3.2.4 this problem will be gone.
https://gitlab.com/freepascal.org/fpc/source/-/commit/e9d318e7e2f772bf455a92461cd5c229e69858d8

32 bit users should not be affected by this.
Non intel platforms should also not be affected.
Title: Re: Lazarus Release 2.2.0
Post by: dseligo on January 06, 2022, 02:39:06 am
Nice, thanks  :)
Title: Re: Lazarus Release 2.2.0
Post by: VTwin on January 06, 2022, 03:04:40 am
Excellent! Many thanks to the devs. I am excited to install it.
Title: Re: Lazarus Release 2.2.0
Post by: loaded on January 06, 2022, 06:04:14 am
Respect for the effort, thank you very much .
Title: Re: Lazarus Release 2.2.0
Post by: 12398890 on January 06, 2022, 06:57:54 am
Thank you very much! Please keep up the great work!
Title: Re: Lazarus Release 2.2.0
Post by: bigfoot75 on January 06, 2022, 08:16:17 am
Does anyone use RichMemopack?
I got an error message

class function TRichEditManager.LoadRichText(RichEditWnd: Handle; ASrc: TStream): Boolean;
var
  cbs : TEditStream_;
begin
  cbs.dwCookie := PDWORD(ASrc);
  cbs.dwError := 0;
  cbs.pfnCallback := @RTFLoadCallback;
  SendMessage(RichEditWnd, EM_STREAMIN, SF_RTF, LPARAM(@cbs) );
  Result := cbs.dwError = 0;
end;   


win32richmemoproc.pas(730,22) Error: Incompatible types: got "<address of function(PDWord;PByte;LongInt;var LongInt):DWord;StdCall>" expected "<procedure variable type of function(LongWord;PByte;LongInt;var LongInt):DWord;StdCall>"
Title: Re: Lazarus Release 2.2.0
Post by: dsiders on January 06, 2022, 08:35:48 am
Does anyone use RichMemopack?
I got an error message

class function TRichEditManager.LoadRichText(RichEditWnd: Handle; ASrc: TStream): Boolean;
var
  cbs : TEditStream_;
begin
  cbs.dwCookie := PDWORD(ASrc);
  cbs.dwError := 0;
  cbs.pfnCallback := @RTFLoadCallback;
  SendMessage(RichEditWnd, EM_STREAMIN, SF_RTF, LPARAM(@cbs) );
  Result := cbs.dwError = 0;
end;   


win32richmemoproc.pas(730,22) Error: Incompatible types: got "<address of function(PDWord;PByte;LongInt;var LongInt):DWord;StdCall>" expected "<procedure variable type of function(LongWord;PByte;LongInt;var LongInt):DWord;StdCall>"

RichMemo has a github repository with issue tracking: https://github.com/skalogryz/richmemo/.
Probably best to report the issue there. Or, start a separate thread.
Title: Re: Lazarus Release 2.2.0
Post by: bigfoot75 on January 06, 2022, 09:08:54 am
Does anyone use RichMemopack?
I got an error message

class function TRichEditManager.LoadRichText(RichEditWnd: Handle; ASrc: TStream): Boolean;
var
  cbs : TEditStream_;
begin
  cbs.dwCookie := PDWORD(ASrc);
  cbs.dwError := 0;
  cbs.pfnCallback := @RTFLoadCallback;
  SendMessage(RichEditWnd, EM_STREAMIN, SF_RTF, LPARAM(@cbs) );
  Result := cbs.dwError = 0;
end;   


win32richmemoproc.pas(730,22) Error: Incompatible types: got "<address of function(PDWord;PByte;LongInt;var LongInt):DWord;StdCall>" expected "<procedure variable type of function(LongWord;PByte;LongInt;var LongInt):DWord;StdCall>"

RichMemo has a github repository with issue tracking: https://github.com/skalogryz/richmemo/.
Probably best to report the issue there. Or, start a separate thread.

I got the latest version from github,and complied it successful,thanks!
Title: Re: Lazarus Release 2.2.0
Post by: 440bx on January 06, 2022, 09:16:29 am
Another thank you! to the developers for a great IDE :)
Title: Re: Lazarus Release 2.2.0
Post by: Roelof on January 06, 2022, 10:58:03 am
Wonderful! Thanks to all that put their effort in.
Title: Re: Lazarus Release 2.2.0
Post by: Al-Eid on January 06, 2022, 11:45:51 am
thank you all
Title: Re: Lazarus Release 2.2.0
Post by: jwdietrich on January 06, 2022, 01:10:02 pm
When compiling one of my apps and also on recompiling the IDE it stops with the error message "idewindowintf.pas(26,3) Fatal: Cannot find IDEOptionsIntf used by IDEWindowIntf, incompatible ppu=/Applications/Lazarus/components/buildintf/units/x86_64-darwin/ideoptionsintf.ppu, multiple packages: BuildIntf, IDEIntf".

Is there a workaround available?
Title: Re: Lazarus Release 2.2.0
Post by: PascalDragon on January 06, 2022, 01:17:44 pm
Is there a workaround available?

Did you by any chance not do a clean reinstallation? Meaning you removed the old Lazarus and installed the new one? Cause from 2.0.x to 2.2 some units were moved to a different package, but the compiled units would remain of course if you didn't remove the old installation. As a workaround you can remove all files inside /Applications/Lazarus/components/buildintf/units/x86_64-darwin.

Though it might be a good idea that the installer does a cleanup by itself, to avoid such problems in the future...
Title: Re: Lazarus Release 2.2.0
Post by: jwdietrich on January 06, 2022, 01:24:55 pm
Is there a workaround available?

Did you by any chance not do a clean reinstallation? Meaning you removed the old Lazarus and installed the new one? Cause from 2.0.x to 2.2 some units were moved to a different package, but the compiled units would remain of course if you didn't remove the old installation. As a workaround you can remove all files inside /Applications/Lazarus/components/buildintf/units/x86_64-darwin.

Though it might be a good idea that the installer does a cleanup by itself, to avoid such problems in the future...

Thanks, but this didn't solve the problem.
Title: Re: Lazarus Release 2.2.0
Post by: PascalDragon on January 06, 2022, 01:27:01 pm
Thanks, but this didn't solve the problem.

I meant /Applications/Lazarus/components/ideintf/units/x86_64-darwin, sorry... (cause the units were moved from IDEIntf to BuildIntf)
Title: Re: Lazarus Release 2.2.0
Post by: jwdietrich on January 06, 2022, 01:34:50 pm
Thanks, but this didn't solve the problem.

I meant /Applications/Lazarus/components/ideintf/units/x86_64-darwin, sorry... (cause the units were moved from IDEIntf to BuildIntf)

I now removed the whole /Applications/Lazarus directory and the fpcsrc folder before re-installing, but this didn't help (nor did rescanning the FPC source directory from the IDE).
Title: Re: Lazarus Release 2.2.0
Post by: jwdietrich on January 06, 2022, 01:47:59 pm
I have now submitted an issue (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39535) on this topic in the bug tracker at GitLab.
Title: Re: Lazarus Release 2.2.0
Post by: BlueIcaro on January 06, 2022, 02:09:15 pm
Great job Lazarus team!. Thanks for all

/BlueIcaro
Title: Re: Lazarus Release 2.2.0
Post by: Peacoor on January 06, 2022, 02:23:56 pm
Long awaited version, thanks lazarus team!
Title: Re: Lazarus Release 2.2.0
Post by: JuhaManninen on January 06, 2022, 02:29:11 pm
@jwdietrich, please start a new thread about you compilation problems in a proper section. This is a release announcement thread.
Title: Re: Lazarus Release 2.2.0
Post by: jwdietrich on January 06, 2022, 03:05:15 pm
@jwdietrich, please start a new thread about you compilation problems in a proper section. This is a release announcement thread.

Thanks for your hint in the bug tracker. It helped in conclusion (although the error messages produced by the IDE might be more appropriate). See my comment there (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39535) for details (and for a possible solution, should others have the same problem).

Since, thanks to your help, the issue is solved now I won't start a new thread.

Thanks again.
Title: Re: Lazarus Release 2.2.0
Post by: ChrisR on January 06, 2022, 07:44:16 pm
Thanks!
Title: Re: Lazarus Release 2.2.0
Post by: LBox on January 06, 2022, 08:07:16 pm
I am a beginner in programming and found Lazarus through the search for "IDE for cross-platform development"
I am very glad that such a product exists especially against the background of other very complex and confusing tools))
Lazarus team Thank you very much for creating and developing such a useful tool 👍
Title: Re: Lazarus Release 2.2.0
Post by: chenyuchih on January 07, 2022, 06:40:01 am
Nice! I can't wait for trying this! (downloading...)

Thank you all the Lazarus and Free Pascal Compiler staffs!
Title: Re: Lazarus Release 2.2.0
Post by: nomorelogic on January 07, 2022, 08:42:06 am
Many thanks for this, it is an excellent job what you are doing

thanks again
nomorelogic
Title: Re: Lazarus Release 2.2.0
Post by: mosquito on January 07, 2022, 09:17:15 am
Thank you very much to all those who make this project possible. Fantastic news.
Title: Re: Lazarus Release 2.2.0
Post by: gucao on January 07, 2022, 12:13:35 pm
when change the code templates file, the templates dont refresh.
first the lazarus.dci and lazarus2.dci dont have the templates 1111,
then add a templates 1111 to lazarus2.dci,
then change file to lazarus.dci the templates 1111 still in the list.
Title: Re: Lazarus Release 2.2.0
Post by: frank@schwedler.net on January 07, 2022, 12:16:04 pm
Is there a guide how to update an existing Lazarus 2.0.12/FPC 3.2.0 installation to the new versions? I do have some projects which currently use the old lazarus version. These project should be updated too..
Title: Re: Lazarus Release 2.2.0
Post by: Edgardo M. López on January 07, 2022, 12:51:35 pm
Hello. I have problems with version 2.2.0. When I open my projects made with version 2.0.12 and I try to add a new form it doesn't let me. I get the following error when trying to save the new form.

Could not set flowForm1: TForm1.
Abstract method called


I have tested it on Ubuntu 20.04 and Windows 11.
Does anyone know how to solve that? Or should I redo all my old projects.

Greetings.
Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 07, 2022, 01:15:13 pm
Hello. I have problems with version 2.2.0. When I open my projects made with version 2.0.12 and I try to add a new form it doesn't let me. I get the following error when trying to save the new form.

Could not set flowForm1: TForm1.
Abstract method called


I have tested it on Ubuntu 20.04 and Windows 11.
Does anyone know how to solve that? Or should I redo all my old projects.

Can you start Lazarus (on Linux) from a console, and see if it prints any form of stack dump?
( On windows: lazarus --debug-log=C:\lazlog.txt  )

If you do get a dump, but no line numbers, then please rebuild (Tools menu) the IDE with "configure build lazarus" and specify -gl -gw -O-1
Also chose the "clean build" radio item.
Then check again for the stack dump.
Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 07, 2022, 01:24:47 pm
Is there a guide how to update an existing Lazarus 2.0.12/FPC 3.2.0 installation to the new versions? I do have some projects which currently use the old lazarus version. These project should be updated too..

The new IDE should be able to open all your projects, and they should work.
"Should" => Even with all testing done, there is always a chance remaining, that it does not.... Hence "backups".

1) If you want to test first:
- The windows installer has an option "secondary install". Make sure to chose a new/empty folder for the new conf.
  (For Linux, there should be info on the wiki)
- Make backups of your projects, before testing

2) Installing the new version (and test / roll back / ...)
- Make a backup of your config
   In your current IDE, menu: View > Ide Internals > About IDE
   Find the "primary config path" => backup that folder. This is your IDE config. (In case you want to downgrade...)
- Uninstall existing version (sometimes you can skip this, but then you may need to do a "clean" IDE rebuild)
- Install new version
- make backup of your projects.

Note:
- The format of the LPI/LPS files changed. The new IDE can save backward compatible files. But in case this does not work, and you do want to go back to a previous IDE, it is best to make backups of your entire projects.
- If you use 3rd party packages, you may have to update them too.
Title: Re: Lazarus Release 2.2.0
Post by: Edgardo M. López on January 07, 2022, 01:29:22 pm
Hello. I have problems with version 2.2.0. When I open my projects made with version 2.0.12 and I try to add a new form it doesn't let me. I get the following error when trying to save the new form.

Could not set flowForm1: TForm1.
Abstract method called


I have tested it on Ubuntu 20.04 and Windows 11.
Does anyone know how to solve that? Or should I redo all my old projects.

Can you start Lazarus (on Linux) from a console, and see if it prints any form of stack dump?
( On windows: lazarus --debug-log=C:\lazlog.txt  )

If you do get a dump, but no line numbers, then please rebuild (Tools menu) the IDE with "configure build lazarus" and specify -gl -gw -O-1
Also chose the "clean build" radio item.
Then check again for the stack dump.

Tried to rebuild with the options you passed me. I create a new project and when I want to save the Form it always gives me that error.

This is the log that I was able to get. Thanks for the help.



NOTA: No se ha encontrado el archivo de configuración de las CodeTools - usando valores predeterminados
NOTE: help options config file not found - using defaults
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 Changed: OS/CPU=True LCL=False
----------------
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
[USER] invalid source position for vertical gradient
Hint: (lazarus) RenameUnit unit1.pas NewUnitName=Unit1 OldUnitName=Unit1 LFMCode=False LRSCode=False NewFilename="/home/servidor/tmp/unit1.pas"
  Stack trace:
  $0000000000538CA9
  $0000000000C7709E  SAVEEDITORFILE,  line 2592 of sourcefilemanager.pas
  $0000000000C7C59E  SAVEPROJECT,  line 4005 of sourcefilemanager.pas
  $0000000000C76A6A  SAVEEDITORFILE,  line 2436 of sourcefilemanager.pas
  $00000000004BA381  DOSAVEEDITORFILE,  line 5685 of main.pp
  $00000000004B078E  MNUSAVECLICKED,  line 3291 of main.pp
  $00000000009336A7  DOONCLICK,  line 1640 of idecommands.pas
  $00000000009336D4  DOONCLICK,  line 1645 of idecommands.pas
  $0000000000957090  CLICK,  line 647 of toolbarintf.pas
  $00000000005F5CBD  MOUSEUP,  line 176 of include/toolbutton.inc
  $0000000000590E9E  DOMOUSEUP,  line 2347 of include/control.inc
  $0000000000591B53  WMLBUTTONUP,  line 2829 of include/control.inc
  $000000000043385A
  $000000000058F3B6  PERFORM,  line 1617 of include/control.inc
  $0000000000582300  ISCONTROLMOUSEMSG,  line 4772 of include/wincontrol.inc
  $00000000005838E9  WNDPROC,  line 5394 of include/wincontrol.inc
  $0000000000760792  DELIVERMESSAGE,  line 112 of lclmessageglue.pas
Info: (lazarus) [SaveProject] SaveEditorFile "/home/servidor/tmp/unit1.pas" failed
TDesigner.PrepareFreeDesigner: TheFormEditor=TFormEditor, Designer=TDesigner
LAZARUS END - cleaning up ...
Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 07, 2022, 02:03:50 pm
Unfortunately the stack does not help....

Do you have any packages installed into your IDE?
(If you have not yet, please try a "clean" rebuild of the IDE.)

Is there a way this can be reproduced?
Can the project be send (in private and confidentially, if needed)?
Title: Re: Lazarus Release 2.2.0
Post by: Edgardo M. López on January 07, 2022, 03:23:04 pm
Unfortunately the stack does not help....

Do you have any packages installed into your IDE?
(If you have not yet, please try a "clean" rebuild of the IDE.)

Is there a way this can be reproduced?
Can the project be send (in private and confidentially, if needed)?

I reinstalled everything again and I was testing after installing each package that I use. The error seems to be with the "xmlresource" package. When installing it begins to fail. This time I did not install it in Ubuntu and everything works normal. I uninstalled it in Windows 11 and had no more problems.

Thank you so much for everything.
Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 07, 2022, 04:06:25 pm
The error seems to be with the "xmlresource" package. When installing it begins to fail. This time I did not install it in Ubuntu and everything works normal. I uninstalled it in Windows 11 and had no more problems.

Could you please report this on the bug tracker. Thanks.
Title: Re: Lazarus Release 2.2.0
Post by: Giorgio Tani on January 07, 2022, 09:51:31 pm
Thank you very much to Lazarus / FreePascal developers!
I'm testing it successfully for cross compiling aarch64 and x86_64 on macOS Monterey, and cross compiling x86_64 and i386 on Windows, and I'll test it on GTK and Qt Linux in the next few days.
Title: Re: Lazarus Release 2.2.0
Post by: AlexTP on January 07, 2022, 10:39:10 pm
@Martin_fr,
I have repro with "xmlresource" package, I will post the bug report.

Done
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39538
Title: Re: Lazarus Release 2.2.0
Post by: Edgardo M. López on January 09, 2022, 12:25:31 am
@Martin_fr,
I have repro with "xmlresource" package, I will post the bug report.

Done
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39538

Thanks for reporting. I don't know how errors are reported.
Title: Re: Lazarus Release 2.2.0
Post by: Nicola Gorlandi on January 09, 2022, 03:06:21 pm
Hi all
With this release of Lazarus I have An access violation on a destroy. In the previa versione it did work.

Any idea.
Tnks
Title: Re: Lazarus Release 2.2.0
Post by: Bart on January 09, 2022, 04:55:46 pm
Without code it is impossible to tell.

Bart
Title: Re: Lazarus Release 2.2.0
Post by: Nicola Gorlandi on January 09, 2022, 06:11:02 pm
I know,

I try to replicate with a minimum amount of code but it works.

I have a component inherited from TDOSComand that I found in www.torry.net.

My component just call inherited in the destroy. The destroy in TDOSComand is

Code: Pascal  [Select][+][-]
  1. destructor TDosCommand.Destroy;
  2. begin
  3.   if FThread <> nil then Stop;
  4.   if FTimer <> nil then FTimer.free;
  5.   if FSync <> nil then FSync.Free;
  6.   if FInputLines_SHARED <> nil then FInputLines_SHARED.free;
  7.   if FLines_SHARED<> nil then FLines_SHARED.free;
  8.   inherited;
  9. end;  
  10.  

unfortunately the debug do not allow me to step in the procedure (as I put a breakpoint Lazarus show it as unreachable)
Title: Re: Lazarus Release 2.2.0
Post by: dseligo on January 10, 2022, 12:58:59 am
Write to some file every line executed and see on what line it fails.

Code: Pascal  [Select][+][-]
  1. destructor TDosCommand.Destroy;
  2.   procedure Log(s: String);
  3.   const LogFile = 'mylog.txt';
  4.   var f: TextFile;
  5.   begin
  6.     AssignFile(f, LogFile);
  7.     If FileExists(LogFile) then
  8.       Append(f)
  9.     else
  10.       Rewrite(f);
  11.     WriteLn(f, s);
  12.     CloseFile(f);
  13.   end;
  14.  
  15. begin
  16.   Log('THread');
  17.   if FThread <> nil then Stop;
  18.   Log('FTimer');
  19.   if FTimer <> nil then FTimer.free;
  20.   Log('FSync');
  21.   if FSync <> nil then FSync.Free;
  22.   Log('FInputLines_SHARED');
  23.   if FInputLines_SHARED <> nil then FInputLines_SHARED.free;
  24.   Log('FLines_SHARED');
  25.   if FLines_SHARED<> nil then FLines_SHARED.free;
  26.   Log('inherited');
  27.   inherited;
  28.   Log('end');
  29. end;
Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 10, 2022, 01:16:51 am
unfortunately the debug do not allow me to step in the procedure (as I put a breakpoint Lazarus show it as unreachable)

Did you recompile the package with debug info? (dwarf)
Title: Re: Lazarus Release 2.2.0
Post by: dbannon on January 10, 2022, 03:44:57 am
Yes, I agree, first place I would look is at -

Code: Pascal  [Select][+][-]
  1.   if FInputLines_SHARED <> nil then FInputLines_SHARED.free;
  2. ....
  3.   if FLines_SHARED<> nil then FLines_SHARED.free;

Has FInputLines_SHARED or FLines_SHARED been freed but not set to nil ?  Free-ing something does not set it to nil. Speaking as someone who has done it lots of times !

Davo
Title: Re: Lazarus Release 2.2.0
Post by: Jurassic Pork on January 10, 2022, 04:05:47 am
hello,
i have found a doscommand for Lazarus (changed the original DosCommand (Delphi) to Lazarus) here (http://pc.hertste.de/doscommand-for-lazarus) and in this version the destructor is :
Code: Pascal  [Select][+][-]
  1. destructor TDosCommand.Destroy;
  2. begin
  3.   if FThread <> nil then Stop;
  4.   if FTimer <> nil then FTimer.free;
  5.   FSync.Free;
  6.   FInputLines_SHARED.free;
  7.   FLines_SHARED.free;
  8.   inherited;
  9. end;
as you can see no test if nil on FSync,  FInputLines_SHARED, FLines_SHARED.

Friendy J.P
Title: Re: Lazarus Release 2.2.0
Post by: duzenko on January 10, 2022, 07:41:15 am
Kudos to the unnamed hero, who brought us "Run to Cursor"
Title: Re: Lazarus Release 2.2.0
Post by: DragoRosso on January 10, 2022, 09:48:09 am
Removed (RXDBGRID compilation with Lazarus 2.2.0). New post: https://forum.lazarus.freepascal.org/index.php/topic,57815.0.html (https://forum.lazarus.freepascal.org/index.php/topic,57815.0.html)

Sorry for OT.
Title: Re: Lazarus Release 2.2.0
Post by: JuhaManninen on January 10, 2022, 10:34:23 am
@DragoRosso, please start a new forum thread about your RX package issues.
This thread is about Lazarus Release.
Title: Re: Lazarus Release 2.2.0
Post by: Jurassic Pork on January 10, 2022, 01:41:03 pm
Hello,
I know,

I try to replicate with a minimum amount of code but it works.

I have a component inherited from TDOSComand that I found in www.torry.net.

My component just call inherited in the destroy. The destroy in TDOSComand is

Code: Pascal  [Select][+][-]
  1. destructor TDosCommand.Destroy;
  2. begin
  3.   if FThread <> nil then Stop;
  4.   if FTimer <> nil then FTimer.free;
  5.   if FSync <> nil then FSync.Free;
  6.   if FInputLines_SHARED <> nil then FInputLines_SHARED.free;
  7.   if FLines_SHARED<> nil then FLines_SHARED.free;
  8.   inherited;
  9. end;  
  10.  

unfortunately the debug do not allow me to step in the procedure (as I put a breakpoint Lazarus show it as unreachable)

it seems that it is the debugger on 2.2 version of lazarus that causes the problem  :

no problem with version 2.0.12  when exiting a doscommand test program.
no problem when exiting a doscommand test program without debug in 2.2 version of Lazarus.
Access violation when exiting a doscommand test program with debug in 2.2 version of Lazarus (see attachment).

Friendly, J.P

Title: Re: Lazarus Release 2.2.0
Post by: nouzi on January 10, 2022, 02:30:07 pm
Thanks for all
Title: Re: Lazarus Release 2.2.0
Post by: Jurassic Pork on January 10, 2022, 03:11:06 pm
Hello,
I know,

I try to replicate with a minimum amount of code but it works.

I have a component inherited from TDOSComand that I found in www.torry.net.

My component just call inherited in the destroy. The destroy in TDOSComand is

Code: Pascal  [Select][+][-]
  1. destructor TDosCommand.Destroy;
  2. begin
  3.   if FThread <> nil then Stop;
  4.   if FTimer <> nil then FTimer.free;
  5.   if FSync <> nil then FSync.Free;
  6.   if FInputLines_SHARED <> nil then FInputLines_SHARED.free;
  7.   if FLines_SHARED<> nil then FLines_SHARED.free;
  8.   inherited;
  9. end;  
  10.  

unfortunately the debug do not allow me to step in the procedure (as I put a breakpoint Lazarus show it as unreachable)

it seems that it is the debugger on 2.2 version of lazarus that causes the problem  :

no problem with version 2.0.12  when exiting a doscommand test program.
no problem when exiting a doscommand test program without debug in 2.2 version of Lazarus.
Access violation when exiting a doscommand test program with debug in 2.2 version of Lazarus (see attachment).

Friendly, J.P

the access violation comes with the terminate of the FThread :
Code: Pascal  [Select][+][-]
  1. procedure TDosCommand.Stop;
  2. begin
  3.   if (FThread <> nil) then
  4.   begin
  5.     FThread.FreeOnTerminate := true;
  6.     FThread.Terminate; //terminate the process
  7.     FThread := nil;
  8.   end;
  9. end;    
Title: Re: Lazarus Release 2.2.0
Post by: Jurassic Pork on January 10, 2022, 03:23:56 pm
Hello,
I know,

I try to replicate with a minimum amount of code but it works.

I have a component inherited from TDOSComand that I found in www.torry.net.

My component just call inherited in the destroy. The destroy in TDOSComand is

Code: Pascal  [Select][+][-]
  1. destructor TDosCommand.Destroy;
  2. begin
  3.   if FThread <> nil then Stop;
  4.   if FTimer <> nil then FTimer.free;
  5.   if FSync <> nil then FSync.Free;
  6.   if FInputLines_SHARED <> nil then FInputLines_SHARED.free;
  7.   if FLines_SHARED<> nil then FLines_SHARED.free;
  8.   inherited;
  9. end;  
  10.  

unfortunately the debug do not allow me to step in the procedure (as I put a breakpoint Lazarus show it as unreachable)

it seems that it is the debugger on 2.2 version of lazarus that causes the problem  :

no problem with version 2.0.12  when exiting a doscommand test program.
no problem when exiting a doscommand test program without debug in 2.2 version of Lazarus.
Access violation when exiting a doscommand test program with debug in 2.2 version of Lazarus (see attachment).

Friendly, J.P

the access violation comes with the terminate of the FThread :
Code: Pascal  [Select][+][-]
  1. procedure TDosCommand.Stop;
  2. begin
  3.   if (FThread <> nil) then
  4.   begin
  5.     FThread.FreeOnTerminate := true;
  6.     FThread.Terminate; //terminate the process
  7.     FThread := nil;
  8.   end;
  9. end;    

With this code no more problem :
Code: Pascal  [Select][+][-]
  1. procedure TDosCommand.Stop;
  2. begin
  3.   if (FThread <> nil) then
  4.   begin
  5.     FThread.FreeOnTerminate := true;
  6.     If not FThread.Finished then  FThread.Terminate; //terminate the process
  7.     FThread := nil;
  8.   end;
  9. end;
Title: Re: Lazarus Release 2.2.0
Post by: Igor Kokarev on January 11, 2022, 09:32:52 am
Many thanks for your hard work on Lazarus 2.2!
Title: Re: Lazarus Release 2.2.0
Post by: mischi on January 11, 2022, 09:42:07 am
I am happy to announce that the macports packages are also updated to Lazarus 2.2.0 and fpc 3.2.2, including arm.

MiSchi
Title: Re: Lazarus Release 2.2.0
Post by: Nicola Gorlandi on January 12, 2022, 07:53:02 pm
Many Thanks to all,

I appreciate.

The change below fix the issue

Code: Pascal  [Select][+][-]
  1. If not FThread.Finished then  FThread.Terminate; //terminate the process

In order to do it by my own, how do you debug this issue ? Are you using the log or what else ?

Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 12, 2022, 08:22:03 pm
With this code no more problem :
Code: Pascal  [Select][+][-]
  1. procedure TDosCommand.Stop;
  2. begin
  3.   if (FThread <> nil) then
  4.   begin
  5.     FThread.FreeOnTerminate := true;
  6.     If not FThread.Finished then  FThread.Terminate; //terminate the process
  7.     FThread := nil;
  8.   end;
  9. end;

Actually: "No problem that you have spotted yet.

The code has a race condition. So there is a problem.

Code: Pascal  [Select][+][-]
  1.     FThread.FreeOnTerminate := true;
After that line, when the thread does end, it will free the TThread object. That is the object to which FThread points.

So, from this point on, FThread should be treated as a "dangling pointer". Because it can change into that, at any point.

Of course, if you could guarantee that the thread can not finish.... But since you check in the next line, if it has finished, clearly you can not guarantee this.

Code: Pascal  [Select][+][-]
  1.     If not FThread.Finished then  FThread.Terminate; //terminate the process

So you call "Finished", but the object (pointed to by FThread), may already have been destroyed. The result may be random, or the call may even crash.

And even, if the call is made on a still existing object, that is no good, because the object can be freed between the return from "Finished" and the access to "Terminate". Same dangling pointer issue here.


And mind "FThread <> nil" does not help either. After all a dangling pointer is a non-nil value.
And even if the thread would set FThread to nil, before destroying the object. Still a race condition. Still could happen between your check, and the "then" action that requires the check....
 
Title: Re: Lazarus Release 2.2.0
Post by: Gald on January 13, 2022, 06:53:08 pm
It looks like I'm the only one with this trouble.

Project > New Project > Run > Image related.
It can't run my old projects too. I can't run anything.

I've updated it from Lazarus 2.0.12.
What did I do wrong?
Title: Re: Lazarus Release 2.2.0
Post by: dsiders on January 13, 2022, 07:17:44 pm
It looks like I'm the only one with this trouble.

Project > New Project > Run > Image related.
It can't run my old projects too. I can't run anything.

I've updated it from Lazarus 2.0.12.
What did I do wrong?

The Note messages are telling you that you have duplicate code in components/freetype and components/lazutils. FreeType was moved into its own package in 2.2.0. https://wiki.lazarus.freepascal.org/Lazarus_2.2.0_release_notes#LazFreeType

I don't know how you updated from 2.0.12 to 2.2.0... but it has remnants of the old version.
Title: Re: Lazarus Release 2.2.0
Post by: jonyrh on January 14, 2022, 05:00:07 am
Thank you all for your hard work, I really like Lazarus!  ::)
Title: Re: Lazarus Release 2.2.0
Post by: Sieben on January 15, 2022, 06:14:47 pm
'Change Class' not working in 2.2.0...? Whatever I choose, it just doesn't do anything - no errors, just nothing. Any setting I am missing...?
Title: Re: Lazarus Release 2.2.0
Post by: wp on January 15, 2022, 06:39:32 pm
'Change Class' not working in 2.2.0...? Whatever I choose, it just doesn't do anything - no errors, just nothing. Any setting I am missing...?
Cannot confirm with Windows 11 and out-of-the-box settings.
Title: Re: Lazarus Release 2.2.0
Post by: calebs on January 23, 2022, 10:19:04 pm
Hello,
I know,

I try to replicate with a minimum amount of code but it works.

I have a component inherited from TDOSComand that I found in www.torry.net.

My component just call inherited in the destroy. The destroy in TDOSComand is

Code: Pascal  [Select][+][-]
  1. destructor TDosCommand.Destroy;
  2. begin
  3.   if FThread <> nil then Stop;
  4.   if FTimer <> nil then FTimer.free;
  5.   if FSync <> nil then FSync.Free;
  6.   if FInputLines_SHARED <> nil then FInputLines_SHARED.free;
  7.   if FLines_SHARED<> nil then FLines_SHARED.free;
  8.   inherited;
  9. end;  
  10.  

unfortunately the debug do not allow me to step in the procedure (as I put a breakpoint Lazarus show it as unreachable)

it seems that it is the debugger on 2.2 version of lazarus that causes the problem  :

no problem with version 2.0.12  when exiting a doscommand test program.
no problem when exiting a doscommand test program without debug in 2.2 version of Lazarus.
Access violation when exiting a doscommand test program with debug in 2.2 version of Lazarus (see attachment).

Friendly, J.P

Hello jurassic i've had some problems with fpdebug and executing external programs in the past, it was related to 32 and 64 bit mix in windows i recall. . In that situations i changed to gdb and worked well. You can test to change to gdb debugger to isolate the problem, martin_fr was very helpful last time i have that issue.
Title: Re: Lazarus Release 2.2.0
Post by: Martin_fr on January 24, 2022, 02:06:35 pm
it seems that it is the debugger on 2.2 version of lazarus that causes the problem  :

no problem with version 2.0.12  when exiting a doscommand test program.
no problem when exiting a doscommand test program without debug in 2.2 version of Lazarus.
Access violation when exiting a doscommand test program with debug in 2.2 version of Lazarus (see attachment).

Do you have a sample that reproduces the issue (including copy of the DosCommand package you use (if that is open source / can be shared).

Target 32 bit?
Debugged from within a 64 or 32bit IDE ?

=> If you have, then please create an issue in the bug tracker.
Title: Re: Lazarus Release 2.2.0
Post by: Jurassic Pork on January 24, 2022, 03:11:45 pm
Hello,
it seems that it is the debugger on 2.2 version of lazarus that causes the problem  :

no problem with version 2.0.12  when exiting a doscommand test program.
no problem when exiting a doscommand test program without debug in 2.2 version of Lazarus.
Access violation when exiting a doscommand test program with debug in 2.2 version of Lazarus (see attachment).

Do you have a sample that reproduces the issue (including copy of the DosCommand package you use (if that is open source / can be shared).

Target 32 bit?
Debugged from within a 64 or 32bit IDE ?

=> If you have, then please create an issue in the bug tracker.
Don't waste your time for this ( and also mine  ;) ), it is not sure that it is a bug, may be the doscommand has a wrong way to terminate the thread.

Friendly, J.P
Title: Re: Lazarus Release 2.2.0
Post by: benjamimgois on January 27, 2022, 03:09:17 am
Hey guys ! Congrats on the new Lazarus release.

I'm having a strange problem on 2.2 that doesn't exist on 2.0.12. It seems the qt5 interface doesn't scale on hidpi monitors anymore. Here is a example of exactly the same code. I'm running it on Manjaro Linux.

Lazarus 2.0.12
(https://i.ibb.co/1vdWyqp/old-lazarus.jpg) (https://ibb.co/f1nw6pK)

Lazarus 2.2
(https://i.ibb.co/93F5xpc/lazarus-22.jpg) (https://ibb.co/Pz7H2rF)
imagem cadastro (https://pt-br.imgbb.com/)

Title: Re: Lazarus Release 2.2.0
Post by: niels.hansen on March 22, 2022, 01:42:22 am
Job well done. Thank you for a great product.
TinyPortal © 2005-2018