Lazarus

Using the Lazarus IDE => Debugger => Topic started by: guest58172 on May 02, 2017, 05:59:32 pm

Title: During debugging, desktop freeze after clicking to open a main menu item
Post by: guest58172 on May 02, 2017, 05:59:32 pm
This is an extremely annoying issue. Recently i updated my OS from openSUSE 13.2 x86-64 to openSUSE 42.2 x86-64. The main difference is the Desktop Environment, which is upgraded to an other major version, i.e Plasma 5 / KDE5. (vs KDE 4 previously).

Since this upgrade i cannot debug anymore my main application. Each time i click to open a main menu, the desktop freezes. Then i have to go to TTY6, pkill gdb, and back to the graphical environment, where everything works fine again (excepted that debugging is finished).

So far i tried to

- disable Exception catching in the application TApplication instance.
- disable events assigned to onUpdate of the actions assigned to the menu items.
- disable all desktop effects.
- reproduce on a simple application

But none of the measure fixed the issue. The simple application was not subject to freezes during debugging.

Any idea of the problem origin ?
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: zeljko on May 02, 2017, 06:26:14 pm
Lazarus is built with Gtk2 or Qt widgetset ?
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: Martin_fr on May 02, 2017, 06:30:43 pm
googling
 gdb breakpoint in event freeze desktop
gives me the impression this is a common issue. (not just lazarus, not just pascal)

This link gives some ideas:
http://stackoverflow.com/questions/24948226/debugging-gtk-event-callbacks

It is possible that the problem is only in one of either gtk or qt, and the other works. Depends how the framework deals with the events before they reach your code.
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: Cyrax on May 02, 2017, 06:31:12 pm
Which Lazarus and FPC versions you are using?

Maybe this is the problem : https://bugs.freepascal.org/view.php?id=31138
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: guest58172 on May 02, 2017, 06:44:32 pm
- Lazarus 1.6.4 widget se:t gtk2
- FPC 3.0.2
- target application widget set: gtk2
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: JuhaManninen on May 02, 2017, 09:09:44 pm
Maybe this is the problem : https://bugs.freepascal.org/view.php?id=31138
Most likely yes. Use trunk or the fixes_1_8 branch.
 http://wiki.freepascal.org/Lazarus_1.8_fixes_branch
It does not freeze.
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: guest58172 on May 02, 2017, 10:53:59 pm
Yes, it's that. The worst is that :

It's not a LCL bug !

After reading the report i noticed the GTK theme name. If i change the GTK theme (i.e to Adwaita then no freeze anymore, and even with Laz 1.6.2 !
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: guest58172 on May 19, 2017, 01:45:06 am
It's back in 1.8RC1 and in worse. Now even with a different GTK2 theme the DE freezes when trying to open a main menu item.
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: guest58172 on May 19, 2017, 02:34:56 am
linux x86_64, KDE, application with GTK2 widget (don't know if the same bug happens with a GTK based DE).

- Create an AV on purpose in an TNotifyEvent target.
- Assign this event to an Action.OnUpdate
- assign the action to a TMenuItem of a main menu
- try to open the menu while debugging in Laz

DE freeze, need pkill gdb.
Title: Re: During debugging, desktop freeze after clicking to open a main menu item
Post by: Martin_fr on May 19, 2017, 02:53:27 am
Also try http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working

(autosolib off)
TinyPortal © 2005-2018