Recent

Author Topic: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files  (Read 3312 times)

Muso

  • Sr. Member
  • ****
  • Posts: 354
Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« on: April 17, 2021, 03:22:31 am »
I ugraded a program to use new features of Lazarus 2.1.

When I now open the *.lpi file with
Lazarus 2.0.12 r64642 FPC 3.2.0 x86_64-win64-win32/win64
, I get correctly the attached dialog.

I click in this dialog on "Stop all loading".

result: Lazarus hangs and after some time Windows steps in trying to close the unresponsive program.

Can anybody else reproduce this / is this already a known bug?

Bart

  • Hero Member
  • *****
  • Posts: 4831
    • Bart en Mariska's Webstek
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #1 on: April 17, 2021, 10:29:39 am »
In the trunk version of Lazarus IDE:
Project Options->Miscallaneous->Maximize compatibility of project files

Now you can open the project in older version of Lazarus IDE

Bart

wp

  • Hero Member
  • *****
  • Posts: 10304
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #2 on: April 17, 2021, 11:04:10 am »
ParentBackground is a new property introduced in Laz trunk recently for TGroupBox (https://wiki.freepascal.org/Lazarus_2.2.0_release_notes#TGroupBox). If you set its value to false (default is true) the property is written to the lfm file. When you now load the project in Laz 2.0.12 or any other older version the streamer sees an unknown property and does not know how to continue.

The ParentBackground changes its value when you set the background color of the TGroupbox.

This is how you can solve the issue and keep compatibility between trunk and previous versions:
  • Open the project in trunk and reset the ParentBackground of that groupbox (and all other groupboxes) to true. This is the default value, and thus the property is not written to the lfm file.
  • If you need a different background color you should set this at runtime, for example in the OnCreate event of the form. This way the ParentBackground changes only at runtime and is kept out of the lfm file.
« Last Edit: April 17, 2021, 11:13:18 am by wp »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #3 on: April 17, 2021, 11:14:38 am »
I don't think he has any problem with the project being "new-style" or controls properties. If I'm reading correctly he's complaining about the fact that Lazarus hangs after trying to read the project and being told to stop loading it.

Unfortunately I don't have any solution and cannot test in this machine, sorry :(
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

wp

  • Hero Member
  • *****
  • Posts: 10304
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #4 on: April 17, 2021, 11:33:03 am »
If I'm reading correctly he's complaining about the fact that Lazarus hangs after trying to read the project and being told to stop loading it.
This is exactly the behaviour of the IDE when an unknown property is contained in an lfm form. Even if the hang does not occur from time to time it is highly recommended to restart the IDE after such an occasion.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #5 on: April 17, 2021, 12:32:06 pm »
This is exactly the behaviour of the IDE when an unknown property is contained in an lfm form. Even if the hang does not occur from time to time it is highly recommended to restart the IDE after such an occasion.

The point is that it shouldn't be so: Since it gives you options to continue loading, partial or total cancelation, it should either honor the choice, if it can, or error out if it can't; instead it hangs and leaves you out there twidling your thumbs and waiting for something to happen.

If that isn't a bug ... let some god come and see it, as we say aroung here ;)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

wp

  • Hero Member
  • *****
  • Posts: 10304
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #6 on: April 17, 2021, 01:23:30 pm »
Yes it is an annoyance, it has been there all the time,  and IIRC even Delphi cannot recover from such a case without a restart (but this may have changed, I don't do too much Delphi nowadays).

If you provide a patch I think the devs will be glad to apply it.

Muso

  • Sr. Member
  • ****
  • Posts: 354
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #7 on: April 17, 2021, 01:40:01 pm »
I don't think he has any problem with the project being "new-style" or controls properties. If I'm reading correctly he's complaining about the fact that Lazarus hangs after trying to read the project and being told to stop loading it.

Yes, exactly. I am fully aware of the new properties. But when I explicitly press on "stop loading", then the loading should be stopped and not that Lazarus becomes unresponsible.

Muso

  • Sr. Member
  • ****
  • Posts: 354
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #8 on: April 17, 2021, 01:47:43 pm »
  • Open the project in trunk and reset the ParentBackground of that groupbox (and all other groupboxes) to true. This is the default value


This does not work, also not for new GroupBoxes. The default is always FALSE and cannot be changed to TRUE. I opened a new thread for this bug: https://forum.lazarus.freepascal.org/index.php/topic,54190.0.html
« Last Edit: April 17, 2021, 02:48:53 pm by Muso »

dbannon

  • Hero Member
  • *****
  • Posts: 2215
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus 2.0.12 hangs on opening Lazarus 2.1dev files
« Reply #9 on: October 29, 2021, 10:16:36 am »
OK, necroposting (love that term, all credit to its first user but I don't remember who that was).

A project edited (and maybe set ParentBackground to true and back to false ?) but has serious issues with, eg Lazarus 2.0.10

While its a pain when we find we cannot open that project in the IDE, its even worse if you build your app from the command line using, eg, the Laz 2.0.10 used by Debian autobuild. It builds fine, raises no errors but crashes on startup.

The 2.2 release notes perhaps need to mention that potential to silently make a non viable binary ?

Davo

Edit : and setting "Project Options->Miscallaneous->Maximize compatibility of project files" did not help incidently, has been set for some years.
« Last Edit: October 29, 2021, 10:19:30 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

 

TinyPortal © 2005-2018