Recent

Author Topic: IDE freezing the OS  (Read 22329 times)

segfault

  • Full Member
  • ***
  • Posts: 107
Re: IDE freezing the OS
« Reply #90 on: July 27, 2020, 10:13:12 am »
I know this is an old thread, but I'm getting exactly the same issues with slow start up of applications built with Lazarus, and also within lazarus itself. There is no delay starting the IDE, but if I'm opening some other window (eg search and replace) it often takes a long time to appear.

The funny thing is, it's not consistent. ie sometimes the app/window starts up more or less straight away, but at other times it takes 15 seconds or more.

Not only that, but while waiting for the appliction/window to open, the desktop is unresponsive. I'm using MX Linux, which is a derivative of Debian 10 (stable).

Furthermore, when googling the problem I found the suggested solution of installing appmenu-gtk-module, which I did, but it has made no difference at all.

Any other suggestions? This is a serious problem and I can't see myself continuing to use Lazarus if I can't fix it. :(

segfault

  • Full Member
  • ***
  • Posts: 107
Re: IDE freezing the OS
« Reply #91 on: July 27, 2020, 10:54:24 am »
I don't know if this is significant, but I get this message when starting an application from the terminal :

Quote
(project1:32719): Gdk-WARNING **: 09:47:28.316: gdk_window_set_icon_list: icons too large

Also worth mentioning maybe; I noticed the same delays when using an application built with Lazarus (or FP, at least), even before I had Lazarus installed. You may have heard of it :

https://en.wikipedia.org/wiki/MyNotex

Funny thing is, the problem didn't become apparent immediately. It was only after using the application a number of times that the delays/freezes started, then I removed it from my system because I thought it was a bug.

I've never had these issues with any other software, only those built with Lazarus. And evidently the problem seems to be confined to Linux.
« Last Edit: July 27, 2020, 10:58:53 am by segfault »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: IDE freezing the OS
« Reply #92 on: July 27, 2020, 12:05:02 pm »
@segfault: not seeing that here, and I'm on Debian 10 x86_64.

At an absolute minimum, please say what versions of FPC etc. you're on.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

segfault

  • Full Member
  • ***
  • Posts: 107
Re: IDE freezing the OS
« Reply #93 on: July 27, 2020, 02:13:15 pm »
FPC 3.2 + Laz 2.0.10, using MX 19 (x64)

I've tried looking at top when starting a Laz application, but see nothing because the OS freezes. I'm not a Linux guru so don't how to investigate further, or which logs I need to look at, if any. 
« Last Edit: July 27, 2020, 02:17:36 pm by segfault »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: IDE freezing the OS
« Reply #94 on: July 27, 2020, 02:38:18 pm »
Use <Ctrl><Alt><F1> to get to a text console. If you can't, /then/ your OS has locked up.

I've had lockups over the last couple of days which I attribute to a dud Qemu update, but that doesn't sound relevant.

I see slow performance in the IDE on occasion, but again that doesn't sound like your problem.

I've seen desktop lockups caused by poorly-chosen breakpoints in the IDE, which could be fixed by killing the relevant programs from a text console. Again, that doesn't sound like your problem.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: IDE freezing the OS
« Reply #95 on: July 27, 2020, 03:39:38 pm »
I would try
  sudo apt-get install appmenu-gtk2-module
and restarting your computer. You could also try compiling to QT5. My guess is you are experiencing impacts described here
  https://bugs.freepascal.org/view.php?id=36359
Please tell me if this resolves your issue.

segfault

  • Full Member
  • ***
  • Posts: 107
Re: IDE freezing the OS
« Reply #96 on: July 27, 2020, 05:13:18 pm »
Chris, I did install it some days ago after reading about the issue on another forum. So it seems to be not confined to Laz apps, however I haven't had any issues with any other software, only Laz and apps built with it.

I thought I rebooted after installing appmenu-gtk-module, but perhaps I didn't. Anyway it seemed to make no difference. However,  I've just rebooted and the problem 'appears' to be fixed, so I'll wait to see what happens and report back here if the problem reoccurs.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #97 on: July 29, 2020, 03:48:24 am »
I believe (just believe) that the original issue this thread was about related to just the GTK2 package in Ubuntu 19.10, they left out a dependency, appmenu-gtk-module. Installing that reliably fixed it.

Ubuntu 20.04 included GTK2 'out of the box' and showed no sign of this issue. So we have all assumed that the problem was purely a U19.10 problem and a thing of the past. MX is based on Debian, not unbuntu so should not have inherited Ubuntu's mistake.  So, still just 'belief' I am afraid, I don't believe this is your problem.

Further, this thread's  problem showed up with either a crash or a 25 second delay when starting the initial gtk2 app (ie the IDE) that sounds quite different to what you are seeing.

Please look at dmesg after a crash, might mention d-bus.

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

segfault

  • Full Member
  • ***
  • Posts: 107
Re: IDE freezing the OS
« Reply #98 on: September 02, 2020, 10:42:28 am »
Installing appmenu-gtk-module only works temporarily. After a reboot there are no delays, but then after some time the problem returns. No idea why. It's definitely related to gtk apps though because when I compile using Qt there are no delays in startup of apps. I've been trying to compile Laz using Qt but haven't succeeded, so far.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: IDE freezing the OS
« Reply #99 on: September 02, 2020, 04:10:31 pm »
I believe this all started when some one insisted on getting the TTrayIcon to work they way they wanted to.
The only true wisdom is knowing you know nothing

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #100 on: September 03, 2020, 02:34:41 am »
jamie, as possibly the only person to do any work on TTrayIcon for some time, I can assure you there is no connection.

The older TTrayIcon behavior, in particular being able to detect separately left and right clicks was dependent on appindicator1 library. However, that has not worked on newer distributions at all for some time. The newer behavior uses appindicator3 which was derived from Ubuntu's not so lamented Unity desktop.  You can force an application to try and do the old behavior but it will not work at all in any recent distribution. See https://wiki.lazarus.freepascal.org/How_to_use_a_TrayIcon

So, that work was not about "getting the TTrayIcon to work they way [I, they] wanted to", it was about getting it to work.

The delay (and possibly crash) problem problem with U19.10 was apparent in Lazarus itself and other apps that did not use the TTrayIcon at all.

@segfault, I routinely test  my app on a range of Linux distributions in including MX and have not seen this 25second delay on any one except U19.10.  However, my tests are all with new installs not systems that have been updated.  The significent of an update is that the OS you started with may have had and used successfully the old libappindicator1. An update to you OS probably added libappindicator3 but would not remove the original, they are not interchangeable. 

I don't think its at all likely but it would be interesting to know if you do have a legacy libappindicator lying around. So, try this command -

find / -name "libappindicator*" 2>/dev/null

If its there you could try running an app with the env setting mentioned on the wiki page I refered Jamie to, using it to force appindicator3 first, and just to prove or disprove Jamie's rather strange theory, try forcing appindicator1.

Sorry if I appear to be clouding the issue with facts !

Davo

 
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

segfault

  • Full Member
  • ***
  • Posts: 107
Re: IDE freezing the OS
« Reply #101 on: September 04, 2020, 02:28:36 pm »
Hi Davo,

I ran the command you suggested and this was the result :

$ find / -name "libappindicator*" 2>/dev/null
/usr/share/doc/libappindicator3-1
/usr/lib/x86_64-linux-gnu/libappindicator3.so.1
/usr/lib/x86_64-linux-gnu/libappindicator3.so.1.0.0
/var/lib/dpkg/info/libappindicator3-1:amd64.list
/var/lib/dpkg/info/libappindicator3-1:amd64.triggers
/var/lib/dpkg/info/libappindicator3-1:amd64.shlibs
/var/lib/dpkg/info/libappindicator3-1:amd64.md5sums
/var/lib/dpkg/info/libappindicator3-1:amd64.symbols

I only recently installed MX and am using the latest version 19.2.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #102 on: September 05, 2020, 01:11:54 pm »
....
I only recently installed MX and am using the latest version 19.2.

Well, that eliminates that theory, I am not surprised.

I have tested my app, its a gtk2 Lazarus app, on MX running in a VM.  I have tested against one installed straight from the install media and then, again, after a full update. I cannot replicate your problem.  Are you using the default desktop ?  Or some other desktop ?  I have tested against both the XSession and XFCe and its all working fine.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

segfault

  • Full Member
  • ***
  • Posts: 107
Re: IDE freezing the OS
« Reply #103 on: September 05, 2020, 03:54:08 pm »
I'm using the default Xfce desktop. The odd thing is it doesn't affect the startup time of the Lazarus IDE itself. The delays only occur when opening windows within it. For example, just now it took over a minute for the new project window to appear. But the other thing is that it's intermittent, so when opening the 'Find' window sometimes it appears almost instantly, other times it takes 20 seconds or more. I could make a video to demonstrate it, but I don't suppose that will be of much help in trying to locate the source of the problem. So, in a nutshell :

* Windows within Lazarus are sometimes delayed in opening, but never the IDE itself.
* Gtk applications created by Lazarus are (again, only sometimes) delayed in starting up.
* Applications created using the qt5 widgets never experience any delays in starting up.
* The problem disappears after a reboot, only to reappear later.
* The OS freezes (no responses to anything) until the window appears.
* Doesn't seem to affect any other Gtk2 apps (only Lazarus and apps built with it).

Anyway, thanks for trying to help.
« Last Edit: September 05, 2020, 04:05:15 pm by segfault »

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #104 on: September 06, 2020, 02:12:04 am »

* Windows within Lazarus are sometimes delayed in opening, but never the IDE itself.
So, that says its actually not the same issue as this thread started. It applied to the IDE as well and it was a quite repeatable 20 or so seconds and sometimes triggered a crash.  Not very interesting (that its not the same issue) but its one fact we can keep.

* The problem disappears after a reboot, only to reappear later.
Again, thats not typical of original problem. More like some resource being consumed. Hmm, and it says my tests are not useful then, I fired up the VM, ran the test.  Is it enough to just have the OS just running, doing nothing or does it need to be actively used ?   And what sort of time frame are we looking at ?  Minutes, hours, days ?

Most Linux distros have some sort of resource usage monitor app available, something that plots your cpu; disk i/o; network traffic on a little graph over, say, 10 minutes.  If you could find something like that and install it, it may tell us what the contention is during that delay.

The original problem was a problem with a GTK2 app talking, via dbus, to the desktop, as that dbus channel was limited, it choked the desktop but memory and cpu usage was minimal. Be interesting to see if thats still the case.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018