Recent

Author Topic: IDE odd behaviour  (Read 437 times)

alpine

  • Hero Member
  • *****
  • Posts: 1263
IDE odd behaviour
« on: September 09, 2024, 06:07:42 pm »
Recently I'm noticing very odd behavior in the Lazarus IDE - when pressing Ctrl+Space to invoke identifier completion, the IDE freezes sometimes for about 10-15 seconds before showing the completion popup. In addition, I've noticed that the VLC window, which plays/streams a video on my second monitor, also freezes it's picture together with the IDE. When the popup appears, the IDE and VLC both unfreeze.
I was curious whether the other applications were frozen during the same time and started clicking around to see. What I've seen was also strange - it seems that in most cases (not always) when I click around, the popup shows immediately and IDE unfreezes.
Then I've tried with playing YouTube video in Mozilla - it behaves just like VLC - freezes with the IDE and then unfreezes with completion popped up.
That freezing is observed not only when pressing Ctrl+Space, but with every modal dialog that IDE tries to open - Tools/Options, Package/Install_Uninstall Package, Open Loaded Package, etc. Exception are the Open/Save dialogs, they come up immediately.

Has anyone had a similar problem before?

Lazarus 2.2.4 (rev lazarus_2_2_4) FPC 3.2.2 x86_64-linux-gtk2
Xubuntu 20.04, Xfce 4.14
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10296
  • Debugger - SynEdit - and more
    • wiki
Re: IDE odd behaviour
« Reply #1 on: September 09, 2024, 06:25:13 pm »
I haven't had that, but I do only a small part of my work on Linux, so it is unlikely...

Since you report "only recently" (i.e. earlier it was fine), and since you said "Lazarus 2.2.4 " => I guess it wasn't a recent upgrade to the IDE?

Then it could be any of (but not limited to):
- recently installed a package into the IDE (such as anchordocking)
- recent upgrades of your OS/gtk/xserver/.... Where either those upgrades are the issue, or they "react" to an older IDE issue that previously wasn't noticeable.
- ...

You can run the IDE from a terminal and look at for any gtk/xserver errors on the console... Though its of little use with Lazarus 2.2.4... (And, it is already know, that there will be some warnings).

You could also check with a clean config, to see if that has an impact. But again Lazarus 2.2.4 ...

So you really should upgrade. If necessary even test with 3.99 daily development version (e.g., using fpcupdeluxe)



I assume you checked for high cpu or mem usage? And since you did not mention...
« Last Edit: September 09, 2024, 06:26:44 pm by Martin_fr »

alpine

  • Hero Member
  • *****
  • Posts: 1263
Re: IDE odd behaviour
« Reply #2 on: September 09, 2024, 08:30:55 pm »
I haven't had that, but I do only a small part of my work on Linux, so it is unlikely...

Since you report "only recently" (i.e. earlier it was fine), and since you said "Lazarus 2.2.4 " => I guess it wasn't a recent upgrade to the IDE?
True. It's fairly old.

Then it could be any of (but not limited to):
- recently installed a package into the IDE (such as anchordocking)
Nothing installed recently. AnchorDockingDsgn+DockedFormEditor are installed but at the same time with the Lazarus.

- recent upgrades of your OS/gtk/xserver/.... Where either those upgrades are the issue, or they "react" to an older IDE issue that previously wasn't noticeable.
- ...
That can be something since I've upgraded from 18.04 to 20.04 not very long ago (couple of months). Unfortunately I have NVIDIA GeForce GTX550 and every time I do an update I must reinstall the NVIDIA Driver almost blindly.
 
You can run the IDE from a terminal and look at for any gtk/xserver errors on the console... Though its of little use with Lazarus 2.2.4... (And, it is already know, that there will be some warnings).
Nothing here. I've started it from a terminal - except usual warns nothing additional at freeze.

You could also check with a clean config, to see if that has an impact. But again Lazarus 2.2.4 ...

So you really should upgrade. If necessary even test with 3.99 daily development version (e.g., using fpcupdeluxe)
I have a separate instance of 3.99. Started from a terminal it has the same behavior. Even without AnchorDockingDsgn and DockedFormEditor.



I assume you checked for high cpu or mem usage? And since you did not mention...
Correct. Also monitored various /var/logs for warnings/errors since a time ago I had a HW issues with HD controllers, i.e. similar kind of freezing. No problems at present.

The last thing I've tried was to logout/login and after that the problem disappeared (for now). I'll be watching very carefully from now on to see what causes the effect (because I'm sure it will happen again) and will update.

Thank you for the pointers!
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10296
  • Debugger - SynEdit - and more
    • wiki
Re: IDE odd behaviour
« Reply #3 on: September 09, 2024, 09:08:17 pm »
I am not much acquainted with the LCL gtk2 stuff.

I do know, that gtk2 can hang all windows, if any single app fails to respond to certain messages. So if the IDE is stuck for some time, then it may not respond. In fact it may be stuck inside such a message (doing something inside a paint message, or focus, or click / not sure, not all of them cause the symptoms).

But then the IDE would have to do something. Maybe disk activity? Scanning the disc for something (still shouldn't be inside an event, but well one never knows).

You could run the IDE (with dwarf-2 debug info) from a terminal inside gdb
   gdb lazarus
   r

Then (if the terminal still reacts) when it hangs ctrl-c => that way gdb would stop it. Then go through the threads and get backtraces (bt).
Maybe that reveals something.
If the terminal is frozen too, ssh into your box, attach gdb to the running IDE, and then you can ctrl-c over ssh.

If the bt is inside gtk and does not reach lcl/ide, then "c" continue, ctrl-c again and hope for a better trace. If all are in gtk, then the time is actually spent there....





I also thought about "bad windows": https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41041
Potentially gtk/gdk may take time to validate this???
But that is just an extremely wild guess.

alpine

  • Hero Member
  • *****
  • Posts: 1263
Re: IDE odd behaviour
« Reply #4 on: September 10, 2024, 07:38:13 am »
I do know, that gtk2 can hang all windows, if any single app fails to respond to certain messages.
I also thought about "bad windows": https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41041
Potentially gtk/gdk may take time to validate this???
But that is just an extremely wild guess.
Not so wild actually.

It smells exactly like some kind of message loop intertwining/stalemate issue. Even more that a mouse click (or pressing Alt+Tab) occasionally helps unfreezing.
Now I recall I had a few very obnoxious cases with everything frozen when I was forced to press Ctrl-Alt-F1 for a text console and to kill processes until thawed. Then I did not connect this with Lazarus, and it may not be now, though.

Anyway, I'll follow your debug advises and will try investigate further. I'm having a busy few days now but as soon as a gap opens I'll do it. In the meantime, I'll use logout/login as a remedy.

Thanks again!

Edit: "coincidence is" that  such a moronic things happen just when some urgent work has to be done.  :D
« Last Edit: September 10, 2024, 07:47:37 am by alpine »
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

 

TinyPortal © 2005-2018