Recent

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

dbannon

  • Hero Member
  • *****
  • Posts: 787
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #60 on: December 01, 2019, 12:28:56 am »
Has anyone solved it ?!
Not as far as I know.   Are you using Ubuntu 19.10 ?   Thats where all reports focus ...

I don't use U19.10 myself, have only seen this problem in a VM running tests.  I did find that a QT5 version of Lazarus (and, obviously, making QT5 apps) did seem to solve the problem. I suspect that its a problem with Ubuntu's GTK2 but, really, no one knows for sure.

The next release of Ubuntu will be the long term support release, if it has the same problem, we will be stuck with it for many years !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
Re: IDE freezing the OS
« Reply #61 on: December 01, 2019, 12:39:41 pm »
And it really is a big problem. But has anyone already communicated the problem to those who develop and maintain the ubuntu project?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Handoko

  • Hero Member
  • *****
  • Posts: 3234
  • My goal: build my own game engine using Lazarus
Re: IDE freezing the OS
« Reply #62 on: December 01, 2019, 12:49:07 pm »
I am using Ubuntu Mate 19.10 + Lazarus 2.0.6 GTK2 64-bit, so far I haven't experienced any freeze issue. But I didn't test it intensively because I am busy with other non-programming tasks after upgraded to Ubuntu 19.10.

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
Re: IDE freezing the OS
« Reply #63 on: December 01, 2019, 02:25:13 pm »
This morning I made updates to ubuntu and it seems to not do it anymore. Is it also up to you?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Handoko

  • Hero Member
  • *****
  • Posts: 3234
  • My goal: build my own game engine using Lazarus
Re: IDE freezing the OS
« Reply #64 on: December 01, 2019, 02:48:21 pm »
I've just tried to update, my Ubuntu Software Updater still worked.

xinyiman

  • Hero Member
  • *****
  • Posts: 1991
    • Lazarus and Free Pascal italian community
Re: IDE freezing the OS
« Reply #65 on: December 01, 2019, 09:25:05 pm »
I meant to say that after making ubuntu updates when I use lazarus it no freeze my Ubuntu
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

dbannon

  • Hero Member
  • *****
  • Posts: 787
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #66 on: December 01, 2019, 10:34:45 pm »
And it really is a big problem. But has anyone already communicated the problem to those who develop and maintain the ubuntu project?

As far as I know, it has not been put in Mantis yet because its simply not repeatable. There have been several 'fixes' defined that ended up being wrong. We need to hear from the people who switched over to QT5 (if they did) as to whether of not that definitely fixed it. Nothing less than a week's testing with zero freezes would be acceptable IMHO.

So, if you think recent updates fixed it, please keep using (the gtk2 version) it for at least a week and post back here !  Be really good if you could note down what was updated ....

Davo

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

ChrisR

  • Full Member
  • ***
  • Posts: 103
Re: IDE freezing the OS
« Reply #67 on: December 02, 2019, 04:34:09 pm »
I believe this is the same issue as
  https://forum.lazarus.freepascal.org/index.php/topic,47125.0.html
I reported this on Mantis
  https://bugs.freepascal.org/view.php?id=36359

I just did an update on Ubuntu 19.10 this morning, including a hard restart. The problem seems to persist with me. As I note, the system does not freeze with the default hello world GTK2 program compiled in C, and it seems like any Lazarus project (including the IDE) compiled for the GTK2 widgets gets stuck in a loop checking TGtk2WidgetSet.AppProcessMessages for about 25 seconds. Any solutions appreciated (so far, QT5 seems my best solution).

ChrisR

  • Full Member
  • ***
  • Posts: 103
Re: IDE freezing the OS
« Reply #68 on: December 02, 2019, 06:12:26 pm »
I have updated the Mantis notes with solutions that worked for me. Maybe others can test and see if this solves their issues:


This page details solutions
    https://askubuntu.com/questions/1184774/some-applications-on-ubuntu-19-10-very-slow-to-start
 1.) launch program as super user ("sudo ./project1")
 2.) launch application with launch "dbus-launch --exit-with-session ./project1"
 3.) Run "sudo apt-get install appmenu-gtk2-module" and restart your computer - after this applications launch quickly, though they report
        [DEBUG] Name com.canonical.AppMenu.Registrar does not exist on the session bus

dbannon

  • Hero Member
  • *****
  • Posts: 787
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #69 on: December 02, 2019, 10:47:37 pm »
I have updated the Mantis notes with solutions that worked for me. Maybe others can test and see if this solves their issues:


This page details solutions
    https://askubuntu.com/questions/1184774/some-applications-on-ubuntu-19-10-very-slow-to-start
 1.) launch program as super user ("sudo ./project1")
 2.) launch application with launch "dbus-launch --exit-with-session ./project1"
 3.) Run "sudo apt-get install appmenu-gtk2-module" and restart your computer - after this applications launch quickly, though they report
        [DEBUG] Name com.canonical.AppMenu.Registrar does not exist on the session bus

Yeah, I suspected DBus early on. The default timeout is about 25 seconds.  But near as I could tell, Lazarus does not do dbus. And "qdbus -l" does not list it (I believe qdbus lists all dbus actors, not just QT ones).

And I have certainly seen the problem in (Lazarus) apps that don't use DBus.

The message about the name not existing has been there in all GTK2 apps since, at least U18.04 and is benign, its a debug statement left in a library, I am a bit disappointed its still there in U19.10



Lets wait and see .....

Davo
« Last Edit: December 02, 2019, 10:51:40 pm by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

ChrisR

  • Full Member
  • ***
  • Posts: 103
Re: IDE freezing the OS
« Reply #70 on: December 03, 2019, 02:10:58 pm »
Davo
 I think for GTK apps you use gdbus, not qdbus:
   command 'gdbus' from deb libglib2.0-bin (2.62.1-1)
 I am unfamiliar with how to use these tools. Is there a way to use this to monitor a simple Lazarus application, e.g. if I have a GTK2 project "~/project1" how can I see when it is calling the dbus?

dbannon

  • Hero Member
  • *****
  • Posts: 787
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #71 on: December 03, 2019, 10:52:33 pm »
ChrisR, I am currently working on a Lazarus app that uses DBus, I compile and run a GTK2 version of it and qdbus does find it.

And running "find ide  |  xargs  grep  -ni  dbus   2>  /dev/null" from the Lazarus source tree finds nothing.  That says to me that Lazarus does not mention dbus anywhere is in its source.

But more importantly, are you running freeze free now ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

ChrisR

  • Full Member
  • ***
  • Posts: 103
Re: IDE freezing the OS
« Reply #72 on: December 05, 2019, 05:20:55 pm »
Davo-
  I have two machines running 19.10. On one I installed appmenu-gtk2-module and GTK2 apps now load on that machine instantly. For testing, I have not upgraded the other machine, and it still has the delays (unless I launch with sudo or  ""dbus-launch --exit-with-session"). While Lazarus may not explicitly call dbus, it seems like some part of the GTK2 widgetset implicitly invokes dbus. As others have noted, some non-Lazarus GTK2 tools have the same behavior (hexchat), but not all. Is there any way to see what calls are queued during the delay? Happy to help bebug this, but I have very little insight into the GTK2 widgetset.

dbannon

  • Hero Member
  • *****
  • Posts: 787
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #73 on: December 06, 2019, 12:32:23 am »
Davo-
  I have two machines running 19.10. On one I installed appmenu-gtk2-module and GTK2 apps now load on that machine instantly.
OK, Chris, are you saying that just installing appmenu-gtk2-module makes the problem go away or are you then using it to put the dbus-launcher env var in front of your launch commands ?

The askubuntu links seem to suggest the latter approach ....

Big difference, if it is just a case of adding appmenu~ to the dependencies list, wow, I agree, you have a solution !    But if thats just a tool to help make the command to launch any Lazarus app in its own DBus env, thats not really viable. We cannot suggest to end user that they run a separate DBus instance with every app they run.

(and by the way, I do like your determination to get this solved ! )

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

ChrisR

  • Full Member
  • ***
  • Posts: 103
Re: IDE freezing the OS
« Reply #74 on: December 06, 2019, 01:16:36 am »
Yes, installing app menu completely resolved the issue on my computer, no need for other hacks.