[SOLVED with workaroud]Lazarus under Ubuntu 20.04 works correctly only with sudo lazarus / 32-Linux ---------------------------------------------------------------------- Tommi · 2021-12-26 16:24 If I launch Lazarus 2.0.12 under Ubuntu 20.04 it hangs for at least 20 seconds and after that when I compile an executable it runs but it doesn't close. If I run Lazarus as root no problem, everything works very well. Here the messages when I launch Lazarus as normal user: Code: [Select]lazarus-ide Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/tommaso/.lazarus" Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus" (lazarus-ide:4263): IBUS-WARNING **: 17:15:02.764: Unable to connect to ibus: Could not connect: Connection refused Looking for code tools config file:  "/home/tommaso/.lazarus/codetoolsoptions.xml" NOTE: codetools config file not found - using defaults Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 Changed: OS/CPU=True LCL=False NOTE: help options config file not found - using defaults (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.290: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.290: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.291: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.291: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.292: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.292: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.293: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.293: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.294: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.294: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.295: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.295: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.296: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.296: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed (lazarus-ide:4263): Gtk-CRITICAL **: 17:15:03.297: IA__gtk_widget_realize: assertion 'GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed LAZARUS END - cleaning up ... Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE Hint: (lazarus) [TMainIDE.Destroy] END The point seems to be here: Code: [Select](lazarus-ide:4263): IBUS-WARNING **: 17:15:02.764: Unable to connect to ibus: Could not connect: Connection refused because when I use sudo this line disappear, but the other remain. Could you help me ? Thank you ---------------------------------------------------------------------- AlexTP · 2021-12-26 17:09 I don't have this problem on Ubuntu 20.0 and next 20.x. ---------------------------------------------------------------------- Tommi · 2021-12-26 17:57 I tried to start Lazarus with verbose option but nothing special says. Is there a way to check what is doing during the hanging at boot? If I would see what is trying to do I would may unlock the correct right. ---------------------------------------------------------------------- MarkMLl · 2021-12-26 18:17 How did you install it? What's in /etc/lazarus? Are any files in ~/.lazarus inaccessible to the normal user? MarkMLl ---------------------------------------------------------------------- dbannon · 2021-12-27 08:38 Tommi, easy test to see if the problem is root owned config data. start lazarus, telling it to use a different config directory, eg Code: [Select]startlazarus --pcp="$HOME/.laz-other [enter] If it works normally, then your problem is in your default config, probably ~/.lazarus  . As Mark said, check to see if there are some root owned files there. Davo ---------------------------------------------------------------------- Tommi · 2021-12-28 13:02 Quote from: dbannon on December 27, 2021, 09:38:52 amTommi, easy test to see if the problem is root owned config data. start lazarus, telling it to use a different config directory, eg Code: [Select]startlazarus --pcp="$HOME/.laz-other [enter] If it works normally, then your problem is in your default config, probably ~/.lazarus  . As Mark said, check to see if there are some root owned files there. Davo Tried, but nothing changes. Tried also to create a new user and lauch from it, but no effect. I discovered that the issue is related to the GTK version. Infact if I compile an empty window with gtk2, the resulting program hangs 20 seconds when I close it, same effect of Lazarus itself at boot. If I compile with gtk3, the resulting application works well. So I tried to launch another GTK2 application, opgui (from here: http://openprog.altervista.org/OP_eng.html), and I had the same effect at boot. So I tried to change source code of opgui putting a "return 0" line by line to see where it hangs, and I discovered that it hangs when executing gtk_container_add function. What could be? Is it lazarus a GTK2 application? Which permission may interfere with gtk2? ---------------------------------------------------------------------- winni · 2021-12-28 13:42 Hi! It is a known problem with gtk. We have discussed it some time aago. https://askubuntu.com/questions/1184774/some-applications-on- ubuntu-19-10-very-slow-to-start Winni ---------------------------------------------------------------------- Tommi · 2021-12-28 14:21 Quote from: winni on December 28, 2021, 02:42:44 pmHi! It is a known problem with gtk. We have discussed it some time aago. https://askubuntu.com/questions/1184774/some-applications-on- ubuntu-19-10-very-slow-to-start Winni Tried right now. The problem remains ---------------------------------------------------------------------- trev · 2021-12-28 21:19 Which of the many solutions listed did you try? ---------------------------------------------------------------------- dbannon · 2021-12-29 03:46 This was our take on the issue that winni linked - https://forum.lazarus.freepascal.org/index.php/topic,47240.0.html Our conclusion then was that the issue related to firstly leaving GTK2 out of Ubuntu and then leaving appmenu-gtk-module out of its dependencies list for those who choose to install GTK2.  Manually installing appmenu-gtk-module seemed to fix the problem. It "seemed" that the issue was purely U19.10, non-long term Ubuntus always seem a bit chancy and the next release, U20.04 did not have any problems.  Quite a lot of us are using U20.04 without issues, so we need to workout just what Tommi's difference is. It does sound like that dbus problem.... Tommi, was your Ubuntu install a fresh one or did you upgrade from Ubuntu 19.10 ? And you have definitely installed appmenu-gtk-module haven't you ? Code: [Select]dpkg -l | grep appmenu-gtk2 [enter] Davo ---------------------------------------------------------------------- Tommi · 2021-12-29 07:39 I tried to install appmenu-gtk2 with this command: Code: [Select]sudo apt-get install appmenu-gtk2-module It hadn't any effect. I am running Ubuntu 20.04.3 with Cinnamon enviroment installed. I don't know if Cinnamon may have caused the issue. I also tried to launch Ubuntu from pendrive as live dist and it works without any problem. So, the only difference that I see is the Cinnamon enviroment. ---------------------------------------------------------------------- Tommi · 2021-12-29 07:43 Quote from: trev on December 28, 2021, 10:19:57 pmWhich of the many solutions listed did you try? I tried sudo apt-get install appmenu-gtk2-module. For some reason I didn't see other solutions proposed. Now I am far from PC, when I arrive to my house I check the others. ---------------------------------------------------------------------- dbannon · 2021-12-29 08:12 Tommi, you missed the question your system's history.  Is it a fresh install or an upgrade ?  And if an upgrade, was it upgraded from U19.10 ? Davo ---------------------------------------------------------------------- Tommi · 2021-12-29 09:19 Quote from: dbannon on December 29, 2021, 09:12:15 amTommi, you missed the question your system's history.  Is it a fresh install or an upgrade ?  And if an upgrade, was it upgraded from U19.10 ? Davo It's a fresh installation done erasing all the disk. After I installed ubuntu (with its installer with default options)  I installed Cinnamon enviroment, some program from snapstore (KeepassXC, kolourpaint and similar), changed theme/icon, and Lazarus from deb files (three files) downloaded from the main site. No driver installed or low level modification at the moment of the problem. Actually I have only added Epson printer driver. What I can do is that on Logs application I see and amdgpu error related to brightness of the monitor, but I think it's not relevant. ---------------------------------------------------------------------- Tommi · 2021-12-29 21:07 Quote from: trev on December 28, 2021, 10:19:57 pmWhich of the many solutions listed did you try? Trying to do: Quotedbus-launch --exit-with-session lazarus-ide works. Lazarus boots up immediately. So the problem is detected, is related to dbus. Anyway sudo apt-get install appmenu-gtk2-module doesn't solve the issue. ---------------------------------------------------------------------- Tommi · 2021-12-29 21:24 SOLVED!! The problem was reported here : https://forum.lazarus.freepascal.org/index.php?topic=51016.0 As suggested in that thread, the solution is adding: Code: [Select]export GTK_MODULES=gail:atk-bridge:appmenu-gtk-module to  ~/.profile Just for reference, I had already done: Code: [Select]sudo apt-get install appmenu-gtk2-module Pay attention to the fact that this bug afflicts Ubuntu 20.04 also. ---------------------------------------------------------------------- dbannon · 2021-12-29 22:26 OK, while great your problem is solved Tommi, its really, really not a good solution. End users are not going to cope with install instructions that start with "vim ~/.profile......" Tracing back it appears it is a Cinnamon (and OpenBox) issue, or, perhaps any GTK using desktop that is not Gnome, XFCe, Mate ?  And maybe needs to be reported to Cinnamon ? Back when we discussed this last time, I tested a lot of desktop/distro combinations but not Cinnamon on Ubuntu. Ubuntu disregard bug reports that are not confirmed so its probably a very good idea that a number of us test this (ie a U2004 Cinnamon in a VM) and back up Tommi's report if we also observe this problem. Otherwise, Lazarus app end users on Cinnamon are not going to be happy ... Alternatively, we find a way to make that dbus service config a dependency.  Davo ---------------------------------------------------------------------- dbannon · 2021-12-30 06:46 Tommi, I would like to try and replicate your problem but unsure what exact distro you are using. From what I can find, Cinnamon is not an official flavour of Ubuntu, so I am guessing your did one of  * Downloaded something from https://ubuntucinnamon.org ? * Installed an official flavour and then added Cinnamon to it ? (In either case its possible you did not get a system quite as well tested as official ones) Anyway, which model did you use of did you find another way ?  If it was the official flavour and add Cinnamon, which one did you start from please ? Davo ---------------------------------------------------------------------- Tommi · 2021-12-30 08:41 Hi, This is the link where I downloaded Ubuntu: https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-desktop-amd64.iso After installation, (all defaults with "erase entire disk" option), I installed Cinnamon doing this: Code: [Select]sudo apt install cinnamon-desktop-environment ---------------------------------------------------------------------- dbannon · 2021-12-30 11:00 Hmm, OK, I replicated that but not your problem Tommi. A GTK2 Lazarus app starts up more or less instantaneously. So, more questions, did you remove the Gnome Shell Desktop that came with the original install ?  I have not but might give it a try. I'd consider it a risky thing to do. Obviously, you did reboot (not just logout to select the different desktop) after installing Cinnamon ? Be interesting to see if you experience this problem in a VM, interested in using Virtual Box ?  Reason I ask is I can only do software rendering in the VM and Cinnamon complains, maybe (but v unlikely) significant. Unless someone else can reproduce this issue, I think there is little point in reporting it to Ubuntu, they don't really care about Cinnamon because its not one of their official flavours and its not reproducible, does not sound like the sort of thing they will get excited about. Davo ---------------------------------------------------------------------- Tommi · 2021-12-30 11:11 Quote from: dbannon on December 30, 2021, 12:00:13 pmHmm, OK, I replicated that but not your problem Tommi. A GTK2 Lazarus app starts up more or less instantaneously. So, more questions, did you remove the Gnome Shell Desktop that came with the original install ?  I have not but might give it a try. I'd consider it a risky thing to do. Obviously, you did reboot (not just logout to select the different desktop) after installing Cinnamon ? Be interesting to see if you experience this problem in a VM, interested in using Virtual Box ?  Reason I ask is I can only do software rendering in the VM and Cinnamon complains, maybe (but v unlikely) significant. Unless someone else can reproduce this issue, I think there is little point in reporting it to Ubuntu, they don't really care about Cinnamon because its not one of their official flavours and its not reproducible, does not sound like the sort of thing they will get excited about. Davo Hi, I didn't remove the Gnome Shell Desktop, and the hardware is real. A thing that I did was installing VMware (VMware-Player- Full-16.2.0-18760230.x86_64.bundle). May be that install script of vmware changed some configuration file. I don't know. ---------------------------------------------------------------------- dbannon · 2021-12-30 11:33 Quote from: Tommi on December 30, 2021, 12:11:28 pm... May be that install script of vmware changed some configuration file. I don't know. No, does not seem likely does it ?  Lets see if anyone else can replicate .... Davo