Recent

Author Topic: TOpenDialog execute freezes...  (Read 323 times)

Espectr0

  • Full Member
  • ***
  • Posts: 218
TOpenDialog execute freezes...
« on: April 28, 2023, 01:54:27 pm »
Hola,

It doesn't always happen but there are times when I run some code like "if OpenDialog.Execute then" my app freezes.
I don't get any exception or anything, it just freezes and I have to force-close it.

Windows 11, FPC 3.2.2 and Lazarus 2.2.6.

Any ideas?

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2097
  • Fifty shades of code.
    • Delphi & FreePascal
Re: TOpenDialog execute freezes...
« Reply #1 on: April 28, 2023, 02:04:28 pm »
Turn debugging off and it always should work.
« Last Edit: April 28, 2023, 02:06:09 pm by KodeZwerg »
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Espectr0

  • Full Member
  • ***
  • Posts: 218
Re: TOpenDialog execute freezes...
« Reply #2 on: April 28, 2023, 02:22:43 pm »
do you mean attached option?
it freezes too.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9912
  • Debugger - SynEdit - and more
    • wiki
Re: TOpenDialog execute freezes...
« Reply #3 on: April 28, 2023, 02:24:16 pm »
We had previous reports on this. And according to them it works well with Lazarus 2.3. (which means ok for the next release 2.4).

If you need to debug such an app, you can switch to the GDB debugger. And also (with gdb) maybe set "DisableLoadSymbolsForLibraries" (global options for gdb debugger).


I have never been able to reproduce it. So I can't tell why this may happen or what may have fixed it.

(On Windows) The issues with any open/save/... dialog is that they load lots of 3rd party libraries (shell extensions). Those libraries may react to being debugged. Or they may contain code that triggered a (meanwhile fixed) bug in the debugger.

Of course it can also be interaction with Microsoft defender, or any other anti virus. And here again, it can be a combination of settings/software specific to a few systems.



Last not least (though likely not the issue here). Fpc 3.2.2 has a bug in the optimizer. If you compile your IDE (Lazaurs itself / not your project) with -O2 (or higher) then the IDE will crash. Actually it is the debugger in the IDE that may crash. And such a crash may not identify as crash, but could lead to the debugger hanging.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9912
  • Debugger - SynEdit - and more
    • wiki
Re: TOpenDialog execute freezes...
« Reply #4 on: April 28, 2023, 02:25:35 pm »
do you mean attached option?
it freezes too.
This will still run in the debugger.

Use (from the menu) "Run without debugging". (you can assign a key to that, if there is not already).

But, then if you need debugging, see my other post.

Espectr0

  • Full Member
  • ***
  • Posts: 218
Re: TOpenDialog execute freezes...
« Reply #5 on: April 28, 2023, 02:29:36 pm »
I get frozen in both cases, if I want to debug or disable debugging.
But if you tell me that it is fixed in the next version, should I download the trunk version to test? or wait for it to be released?

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2097
  • Fifty shades of code.
    • Delphi & FreePascal
Re: TOpenDialog execute freezes...
« Reply #6 on: April 28, 2023, 02:49:54 pm »
do you mean attached option?
it freezes too.
No, I mean the option I showed you.
I get frozen in both cases, if I want to debug or disable debugging.
But if you tell me that it is fixed in the next version, should I download the trunk version to test? or wait for it to be released?
Lazarus 2.3.0 (rev main-2_3-3269-g9d0fc980e1) FPC 3.2.2 x86_64-win64-win32/win64
I do use trunk and it works without errors.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9912
  • Debugger - SynEdit - and more
    • wiki
Re: TOpenDialog execute freezes...
« Reply #7 on: April 28, 2023, 03:16:07 pm »
The option "Run uses the debugger" only exists in Lazarus 2.3 (and only since very recently).
So, he couldn't use that in 2.2.6.

But 2.2.6 has "run without debugger" in the "run" menu.

------------------
You can try to use the 2.3 IDE (you can make a 2ndary setup / so you can use both versions).
FpcUpDeluxe may help you here.


 

TinyPortal © 2005-2018