View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036359||Lazarus||LCL||public||2019-11-25 16:43||2020-05-07 07:33|
|Reporter||Chris Rorden||Assigned To|
|Platform||Intel i7 4790||OS||Ubuntu|
|Product Version||2.1 (SVN)|
|Summary||0036359: Simple project with gtk2 widget set hangs on startup|
|Description||This issue is seen with a clean install of Ubuntu 19.10. Same issue on two different machines (Ryzen with NVidia GPU, Intel with integrated GPU). Every single Lazarus application built to GTK2 is impacted, including the default Lazarus (until one rebuilds to QT5). Every Lazarus built GTK2 application pauses for 25 seconds at application launch. This behavior is unlike Ubuntu 18.04 and 16.04.|
Making a most basic simple application using the gtk2 widget set hangs 25 seconds and eventually becomes responsive.
Walking through the debugger the program gets stuck in main event loop in TGtk2WidgetSet.AppProcessMessages as the while loop with g_main_context_pending/g_main_context_iteration appears to polling for messages but never returns for some reason.
Building the GTK2 "Hello world" application with C shows no delay in launching.
With Lazarus, the GTK2 applications show delay, but GTK3 and QT5 work fine. I realize there are no active GTK2 maintiners, but Lazarus is still distributed initially as GTK2, and the Ubuntu 18.04 LTS does not support Lazarus QT5 applications.
At first blush, this sounds like issue 35395, but switching the options toggled by that fix did not help.
|Tags||No tags attached.|
|Fixed in Revision|
||Does it happen also with earlier versions of Lazarus or was it introduced by some recent change in trunk?|
||Same behavior for Lazarus 1.8.4 GTK2 as well as a hello world project built with Lazarus 1.8.4. Lazarus 1.6.4 shipped with FreePascal 3.0.2 rather than 3.0.4, so I am hesitant to try that version.|
||Ok, then it is all about Ubuntu 19.10 instead of some recent Lazarus change.|
I believe these
are all variations of the same bug. I did have general freezing of the whole GUI when launching 19.10 until I did a sudo apt update followed by sudo apt upgrade, now I just have a 25 second pause every time a Lazarus-build GTK2 application is launched (the window appears, but labels and components not drawn). From the forums, it may be that people who upgrade from a prior version of Ubuntu do not see this, but it occurred in both my from scratch installs.
This page details solutions
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
I have reported this issue here
While it does not impact all GTK2 applications, it influences many, many of which were not developed with Lazarus. The short term solution seems to be to run run "sudo apt-get install appmenu-gtk2-module" and restart your computer. That permanently patches that computer. Unfortunately, this is not obvious to new users who encounter this problem.
For the moment, I would suggest we keep this issue open. There seem to be two alternatives that are not mutually exclusive:
1. Ubuntu is updated to fix this issue at the source.
2. Someone discovers the GTK2 call that causes this polling delay and we can mitigate this in Lazarus.
|2019-11-25 16:43||Chris Rorden||New Issue|
|2019-11-25 17:44||Juha Manninen||Relationship added||related to 0035395|
|2019-11-25 17:47||Juha Manninen||Note Added: 0119491|
|2019-11-26 19:56||Chris Rorden||Note Added: 0119515|
|2019-11-28 17:56||Juha Manninen||Note Added: 0119537|
|2019-12-02 17:39||Chris Rorden||Note Added: 0119590|
|2019-12-02 18:10||Chris Rorden||Note Added: 0119591|
|2019-12-02 18:22||Chris Rorden||Note Edited: 0119591||View Revisions|
|2019-12-06 13:54||Chris Rorden||Note Added: 0119662|
|2019-12-13 23:08||Juha Manninen||Relationship added||related to 0036434|
|2019-12-13 23:19||Juha Manninen||Relationship deleted||related to 0035395|
|2020-05-07 07:33||Juha Manninen||Relationship added||related to 0037029|