Recent

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

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #75 on: December 06, 2019, 07:03:07 am »
In that case, congratulations ! You have solved it !

I'll run a clean vm and confirm your findings !

(And congrats on becoming a full member too ! )

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

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3827
  • I like bugs.
Re: IDE freezing the OS
« Reply #76 on: December 06, 2019, 07:32:09 am »
The last note in issue
 https://bugs.freepascal.org/view.php?id=36359
now lists solutions. I understand they are alternatives to each other and the last one is recommended. Is that correct? I will resolve it as "no change required".
Mostly Lazarus trunk on Manjaro Linux.

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #77 on: December 06, 2019, 12:19:12 pm »
Hmm, yep, appmenu-gtk2 certainly seems to solve the problem. I have absolutely no idea why however. It also brings in a dependency that is not the active ingredient.  Between them, they add  175K to the install.

Juha, I don't think this is a "no change required", instead the change is we need is to add appmenu-gtk2 to the Lazarus Deb's list of dependencies. Its quite small and will otherwise do no harm. It seems to already be on most older Ubuntus that were more GTK2 friendly.

(Although I note once installed, removing it seems to leave the system unstable until a reboot. Thats something I really don't like but there is no reason anyone would bother to remove it unless doing bulk testing like I've been doing.)

We also need to tell everyone that this [expletive deleted] library might be needed to be added to the dependency list for other Lazarus apps. ldd does not mention it so just how we tell in advance, I don't know.

Why it works is still a mystery however. Its about translating the older menu entries (presumably the desktop files). Starting (eg) lazarus from the command line should not involve these two libraries in any way. But other people appear to have solved other, similar problems this way too. Sigh ....

Davo


« Last Edit: December 06, 2019, 12:26:48 pm by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

ChrisR

  • Full Member
  • ***
  • Posts: 163
Re: IDE freezing the OS
« Reply #78 on: December 06, 2019, 02:22:53 pm »
I would also suggest we keep the bug open as the fix is not intuitive for users who experience the problem. There seem to be two possible long term solutions:

1. Ubuntu gets updated to support all the GTK2 applications that are impacted
  https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/1852016
2. We work out a patch for Lazarus that allows Lazarus and applications built by Lazarus to avoid these penalties.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3827
  • I like bugs.
Re: IDE freezing the OS
« Reply #79 on: December 06, 2019, 10:22:42 pm »
Juha, I don't think this is a "no change required", instead the change is we need is to add appmenu-gtk2 to the Lazarus Deb's list of dependencies. Its quite small and will otherwise do no harm. It seems to already be on most older Ubuntus that were more GTK2 friendly.
Ok. It means the Ubuntu maintainers should update their .deb package. Mattias should add the dependency for the .deb of next release.

I would also suggest we keep the bug open as the fix is not intuitive for users who experience the problem. There seem to be two possible long term solutions:

1. Ubuntu gets updated to support all the GTK2 applications that are impacted
  https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/1852016
2. We work out a patch for Lazarus that allows Lazarus and applications built by Lazarus to avoid these penalties.
A patch for Lazarus would be the ideal solution. How to make it? What pulls in the dependency? I don't even know what appmenu-gtk2 does.
Mostly Lazarus trunk on Manjaro Linux.

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #80 on: December 07, 2019, 12:14:13 am »
A patch for Lazarus would be the ideal solution. How to make it? What pulls in the dependency? I don't even know what appmenu-gtk2 does.

I suspect the solution is to use GTK3, its not a 'patch to GTK2 issue'.  ::)

What this library does is take the GTK2 way of describing menu entries for an app and turn them into a DBus compliant equivalent, sends the relevent data up via DBus to the Desktop. But it seems to be more than 'just' dealing with menu entries because its loaded at run time even when the app has not been started with a menu click. Might allow, for example, the icon to show on a Dock or  right click to add it to 'favourites'.  I have used strace on both Lazarus and my app, tomboy-ng, and both do try to load libappmenu-gtk2 at startup. If its not present, they appear to fail silently and, sometimes, go into this freeze state.

We could take the approach that its a Ubuntu bug, GTK2 should be dependent on appmenu-gtk2. Its there in older systems that are more supportive of GTK2 and its small and does no harm.  But whether we can interest Ubuntu in changing something they wish to see the end of, I don't know.

I think our only solution right now is to

* get it mentioned in the Lazarus Deb's dependencies.
* Mention it on the wiki for people building Lazarus from source
* Mention, repeatedly, that if you distribute a Lazarus app it probably is dependent on appmenu-gtk2.
* Nag Ubuntu to add it to GTK2's list. Almost certainly won't change U19.10 but maybe the LTS U20.04 ?

Chris and I will watch the forum, Juha, can you trigger an addition to the Lazarus Deb's dependencies list ?

EDIT: Note that Fedora does not have anything like appmenu-gtk2, that says its one of those things Ubuntu add to make their OS a bit friendlier. Fedora are happy to say, "you are not keeping up, goodbye!".

Davo
« Last Edit: December 07, 2019, 12:59:24 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Zvoni

  • Sr. Member
  • ****
  • Posts: 392
Re: IDE freezing the OS
« Reply #81 on: December 07, 2019, 12:54:17 pm »
Just something funny i noticed:
Since people mentioned VLC being slow on startup, and after installing appmenu-gtk2-module, it starts faster:
i just did a "vlc" from a terminal..... --> Gtk-Message: 12:52:56.533: Failed to load module "appmenu-gtk-module"
LOL? Gtk? Not Gtk2?
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircrafts

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #82 on: December 07, 2019, 11:52:16 pm »
Sorry, not quite sure what you are saying there Zvoni.

There certainly a number of other applications that are are affected by this bug, its not just Lazarus or Lazarus Applications. And, apparently, installing appmenu-gtk2 solves it for all of them.

Now, totally guessing about whats happening.  As there are many ways to get things done in GTK2, my guess is that all GTK2 apps use a particular GTK2 thing (perhaps present their menu icon credentials to the OS in a particular way) are affected.  So, the problem is not in Lazarus Code but does relate to how the original Lazarus developers choose to do that thing. Obviously, LCL developers choose the same way. Back then, it was a safe and correct choice.

But now, distros all want to leave out as much GTK2 as they can, some leave it all out. And the leaving out of appmenu-gtk2 even when GTK2 is manually installed is causing us (and heaps of other apps) a problem.

Add appmenu-gtk2 to your list of dependencies and your app will work OK.  I am yet to find out what alien does when converting a Deb to an RPM package, the RPM world does not know about appmenu-gtk2 ....

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

winni

  • Hero Member
  • *****
  • Posts: 1795
Re: IDE freezing the OS
« Reply #83 on: December 08, 2019, 12:01:56 am »
Hi!

The RPM-World calls it

appmenu-gtk2-module

Suse Tumbleweed, zypper info:

Code: Text  [Select][+][-]
  1. Information for package appmenu-gtk2-module:
  2. --------------------------------------------
  3. Repository     : openSUSE:Factory                    
  4. Name           : appmenu-gtk2-module                
  5. Version        : 0.7.3-1.1                          
  6. Arch           : x86_64                              
  7. Vendor         : openSUSE                            
  8. Installed Size : 34.8 KiB                            
  9. Installed      : Yes                                
  10. Status         : up-to-date                          
  11. Source package : vala-panel-appmenu-0.7.3-1.1.src    
  12. Summary        : GtkMenuShell D-Bus exporter (GTK+ 2)
  13. Description    :                                    
  14.     This GTK 2 module exports GtkMenuShells over D-Bus.
  15.  

Winni

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #84 on: December 08, 2019, 12:45:03 am »
OK, thats interesting.

I looked for a fedora version only.  Perhaps I had a boy look.....

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

Zvoni

  • Sr. Member
  • ****
  • Posts: 392
Re: IDE freezing the OS
« Reply #85 on: December 12, 2019, 09:44:46 am »
Davo,
i still think it's nothing to do with appmenu
look here at accepted answer.
https://askubuntu.com/questions/1185491/ubuntu-19-10-freezes-and-lags-reguarly

Could you test a clean install Ubuntu19.10 with Gnome3.34 with Kernel 5.4?
Would do it myself, but i'm preparing for my holiday-trip to USofA

EDIT: Just yesterday evening i fired up my VM with Manjaro/Gnome, and what do you know? 332 (!) updates available, and that install is a minimal Manjaro/Gnome-Install
Haven't tested anything in the VM (see reason above)
« Last Edit: December 12, 2019, 09:52:54 am by Zvoni »
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircrafts

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #86 on: December 12, 2019, 10:23:07 am »
Zvoni, I really don't know !

When we first started poking around this issue, 'we' identified several things that at first seemed to be related.  Swap space, swap policy, DBus come to mind.  Reading the post you linked to, it may not actually be what we are talking about here. It talks about freezes, some of which are apparently quite short. This problem here, as I understand it, is usually about 25 seconds. And, interestingly, 25seconds is the default DBus time out.

My tests, on a VirtualBox VM did seem to indicate that Chris's solution solved it. I fired up the VM, started a GTK2 version of lazarus and found the problem in 13 out of 15 starts.  Most fails were just the 25 second delay, a couple required a reboot.

I installed Chris's package (which incidentally does use DBus) and started Lazarus 15 time in a row without problems.  I removed it and restarted, with problems, two or three times.

I have not gone back into that VM since them, I would like to hear from people who are  are using U19.10 on a day to day basis, they must have more valuable experience than mine !

I don't feel like forcing a new Kernel on my VM, its a testing platform and I need it much like my end users systems are likely to be like.

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

Zvoni

  • Sr. Member
  • ****
  • Posts: 392
Re: IDE freezing the OS
« Reply #87 on: December 12, 2019, 11:23:10 am »
Davo, no Problem.
Since i decided to switch from U19.10/Gnome to Deb10/Gnome
(which is going to happen in a few days, since right now i'm backup-ing the hell out of my machine),
i'll probably be able to report if it has to do with the kernel or with Gnome and/or appmenu, since Deb10 still runs on Kernel4.19
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircrafts

Zvoni

  • Sr. Member
  • ****
  • Posts: 392
Re: IDE freezing the OS
« Reply #88 on: December 18, 2019, 09:55:39 pm »
Reporting back.
Switched from U19.10/GDM/Gnome to Debian10/Lightdm/Gnome
No more issues anymore.
Pretty clean install of Debian/Gnome, installed FPC304/Laz206 from deb's, and setting up Lazarus with what i like, Lazarus booted some 15-20 times in a row (recompile), and no freezes or lags or whatever.

So, Canonical borked 19.10
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircrafts

dbannon

  • Hero Member
  • *****
  • Posts: 1149
    • tomboy-ng, a rewrite of the classic Tomboy
Re: IDE freezing the OS
« Reply #89 on: December 19, 2019, 12:18:42 am »
Switched from U19.10/GDM/Gnome to Debian10/Lightdm/Gnome
No more issues anymore.
So, Canonical borked 19.10
Ah, but the issue is "do you have appmenu-gtk2 installed in your Debian install now" ?

dpkg -l | grep appmenu-gtk2 {enter}

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

 

TinyPortal © 2005-2018