Recent

Author Topic: FileOpenDialog crashes/freezes  (Read 2373 times)

Blue_Painted

  • New Member
  • *
  • Posts: 17
FileOpenDialog crashes/freezes
« on: January 20, 2023, 08:48:30 pm »
I've just updated to Lazarus 2.2.4 with FPC 3.2.2 and now when any of my projects/applications opens a FileOpenDialog, usually via the standard FileOpenAct, the app freezes and cannot be stopped with Ctrl+F2, in fact the only way to get out of the situation is to kill the Lazarus process.

I've posted this in the Debugger section because if I run without debugging, or directly from the generated .exe, it works fine. I've tried all three debugging settings and the same thing occurs.

All I've been able to find so far was an old suggestion, from 2015, that the setting "DisableLoadSymbolsForLibraries" set true would be a solution - but we no longer have that setting.

I'm on Windows 10 - 21H2 64bit

UPDATE:
I've changed to using GDB instead of FpDebug and now I don't suffer the freeze

I also found that "Reset debugger" from the Run menu was able to kill the frozen debugger.

« Last Edit: January 20, 2023, 10:11:27 pm by Blue_Painted »

calebs

  • Full Member
  • ***
  • Posts: 190
Re: FileOpenDialog crashes/freezes
« Reply #1 on: March 21, 2023, 02:35:30 pm »
I can confirm that this error persists in lazarus 2.2.6 with topendialog and with topenpicture dialog too.

start new project
drop a button
opendialog
label
on button the code
Code: Pascal  [Select][+][-]
  1.  if OpenDialog1.Execute then
  2.     label1.Caption:=OpenDialog1.FileName;          

and F9... it compiles file, run ok but when click on buton application hangs. No need for breakpoint.
Tested (so far) on lazarus 2.2.6 win64 2023-03-04 fpc 3.2.2 rev 2_2_6

It hangs with fpdebug, had to select reset debugger on menu and most of the time ends well, but sometimes lazarus ide hangs and had to kill it on task manager.
I can confirm too that if i run without debugger or using gdb it works well (very very slow when opening dialog on gdb).

calebs

  • Full Member
  • ***
  • Posts: 190
Re: FileOpenDialog crashes/freezes
« Reply #2 on: June 05, 2023, 06:47:37 am »
Yes, as i noticed and posted several times, it's a fpdebug problem with dialogs (open at least)... It doesn't work on win10/11 64 or 32 bits... i haven't tested on linux or previous version of windows but it freezes when you call open dialog.
If you switch to gdb it works as expected but very slooooow.
Sorry bout that

<<Replyed to my own post... sorry about that>>
« Last Edit: June 05, 2023, 06:51:12 am by calebs »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: FileOpenDialog crashes/freezes
« Reply #3 on: June 05, 2023, 11:55:36 am »
If you can also test with Lazarus 2.3.
According to reports the issue is fixed.

The problem is that I can not reproduce it on my PC.
(Possible because it depends on the available handlers/dll that hook the explorer (installed by other non-Lazarus 3rd party apps), which are loaded into your app when the dialog opens.)



If you can, please report the eventlog.
1) In the event log options, enable "Module" (Tools > Options > Debugger > event log)
2) run with gdb
  You will see all DLL loaded
- first batch when your app starts
- 2nd batch when it opens the dialog.
3) run with fbdebug
  My guess is, that it will stop halfway through the list.

The important one are:
- The ones that were last printed right before it hangs
- The next one gdb printed, but fpdebug failed (or FpDebug 2.3 prints)


 

TinyPortal © 2005-2018