Forum > Linux

Lazarus shuts down upon Run

(1/2) > >>

Diverod:
lazarus: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

This is on a “new to me” computer.
Laz 3.4, Laz 4.2.0-0 and FPCDeluxe Laz 3.6 all exhibit the same symptom.
All of these have installed with no errors.
When I try to Run a project the app itself terminates.
When I install an on-line package everything goes as normal until it rebuilds the IDE at which point it terminates and the package is not seen upon restart.
Apps such as Qt6 Creator and FreeCad work fine.
Laz 3.4 worked fine on my old Lenovo laptop.

My research: “If the error is triggered by a specific action within the IDE, such as running a project, it may be linked to how the IDE manages its own processes or threads for compilation and execution, potentially requiring a review of the project's configuration or the use of external tools that interact with the X server.

This error can occur due to several underlying causes, often involving improper handling of the X server connection, particularly in multithreaded or multiprocessing scenarios.”

Also, if I change from Wayland to X11 the error causes the computer to instantly lock up upon Run and has to be manually powered down to recover.

I have no idea how or if I can proceed from here. I’m running Qt in the meantime but I would much, much rather be using Lazarus. Guessing it has something  to do with my graphics card and hoping there might be a way around the errror.

Below I’ve listed my system specs and terminal output when Laz is started from the command line:
-------------------------------------------------
Model: HP HP EliteDesk 705 G4 SFF
Memory: 8.0 GiB
Processor: AMD Ryzen™ 7 PRO 2700 × 16

Graphics: OLAND
        AMD Radeon R7 430 2GB LP 2DP PCIe x16 GF
        Supports OpenGL 4.4 and DirectX 12 applications

Firmware Version: Q19 Ver. 02.24.01
OS Name: Ubuntu 24.04.3 LTS
OS Type: 64-bit
GNOME Version: 46
Windowing System: Wayland
Kernel Version: Linux 6.14.0-33-generic
-------------------------------------------------

Terminal Output on Start:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---rodg@rodg-HP-EliteDesk-705-G4-SFF:~$ startlazarusGtk-Message: 11:21:17.382: Failed to load module "canberra-gtk-module"Info: (startlazarus) [TLazarusManager.Run] starting /usr/share/lazarus/4.2.0/lazarus ...Info: (startlazarus) [TLazarusManager.Run] exe=/usr/share/lazarus/4.2.0/lazarus Params=[--started-by-startlazarus--no-splash-screen--force-new-instance]Gtk-Message: 11:21:17.445: Failed to load module "canberra-gtk-module"Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/rodg/.lazarus"Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"Looking for code tools config file:  "/home/rodg/.lazarus/codetoolsoptions.xml"NOTE: codetools config file not found - using defaultsNOTE: help options config file not found - using defaultsHint: (lazarus) [TMainIDE.DoOpenProjectFile] "/home/rodg/Lazarus Projects/Test/project1.lpi"Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux--gtk2 New=x86_64-linux--gtk2 Changed: OS/CPU=True LCL=FalseLoadLFM Creating designer for hidden component of /home/rodg/Lazarus Projects/Test/unit1.pasInitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner******** Highlighter.NeedScan ************Lazarus opens and displays all windows as normal, Form and Source Editor function as normal
Terminal Output on Run project:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Hint: (lazarus) [TMainIDE.DoRunProjectWithDebug] INITHint: (lazarus) Project needs building: Compile was incomplete for ProjectInfo: (lazarus) Execute Title="Compile Project, Target: /home/rodg/Lazarus Projects/Test/project1"Info: (lazarus) Working Directory="/home/rodg/Lazarus Projects/Test/"Info: (lazarus) Executable="/usr/bin/fpc"Info: (lazarus) Param[0]="-MObjFPC"Info: (lazarus) Param[1]="-Scghi"Info: (lazarus) Param[2]="-Cg"Info: (lazarus) Param[3]="-O1"Info: (lazarus) Param[4]="-gw3"Info: (lazarus) Param[5]="-gl"Info: (lazarus) Param[6]="-l"Info: (lazarus) Param[7]="-vewnhibq"Info: (lazarus) Param[8]="-Fi/home/rodg/Lazarus Projects/Test/lib/x86_64-linux"Info: (lazarus) Param[9]="-Fu/home/rodg/Lazarus Projects/Test/"Info: (lazarus) Param[10]="-Fu/usr/share/lazarus/4.2.0/lcl/units/x86_64-linux/gtk2"Info: (lazarus) Param[11]="-Fu/usr/share/lazarus/4.2.0/lcl/units/x86_64-linux"Info: (lazarus) Param[12]="-Fu/usr/share/lazarus/4.2.0/components/freetype/lib/x86_64-linux"Info: (lazarus) Param[13]="-Fu/usr/share/lazarus/4.2.0/components/lazutils/lib/x86_64-linux"Info: (lazarus) Param[14]="-Fu/usr/share/lazarus/4.2.0/packager/units/x86_64-linux"Info: (lazarus) Param[15]="-FU/home/rodg/Lazarus Projects/Test/lib/x86_64-linux/"Info: (lazarus) Param[16]="-FE/home/rodg/Lazarus Projects/Test/"Info: (lazarus) Param[17]="-o/home/rodg/Lazarus Projects/Test/project1"Info: (lazarus) Param[18]="-dLCL"Info: (lazarus) Param[19]="-dLCLgtk2"Info: (lazarus) Param[20]="project1.lpr"lazarus: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.rodg@rodg-HP-EliteDesk-705-G4-SFF:~$ I understand that this may not be resolvable but I thought I'd at least post about it as my knowledge is very limited.
Thanks for your time.

Martin_fr:
I am not very familiar with QT, Gtk, Xserver/wayland issues...

But two answers.

1) Not to your core problem:

--- Quote ---Also, if I change from Wayland to X11 the error causes the computer to instantly lock up upon Run and has to be manually powered down to recover.
--- End quote ---
This may or may not be related to the rest of your issues.
If that happens to be a separate issue, then try to run lazarus with

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---./lazarus --syncAnd also in "run > run params" add "--sync" as argument to the debugged app.

Mind: if you did rebuild your IDE (added packages) then your lazarus executable is somewhere in ~/.lazarus/
Usually, if you run "startlazarus" that will find it for you.

Hangs like this, have been seen, but usually only if there are breakpoints in mouse/key/paint/... events. However, who knows if something causes the debugger to pause the app at startup.

Basically (AFAIK), if the debugger keeps the app paused in an event received from gtk/x-server, then the entire xserver will wait for this to continue. But it never will, if the debugger waits for GUI input....

2) " Fatal IO error 11 (Resource temporarily unavailable) on X server :0."

With a bit of luck that should be possible to trace.
Well, it needs an IDE build with debug info, so you may have to rebuild....

Start your IDE with

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---gdb lazarusr "r" is "run" and you enter it (followed by return) when gdb has loaded. If gdb asks about downloading dbg info, or syncing stuff, answer NO.

Then when the IO error happens, most likely (hopefully) gdb will pause the app. If it does enter

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---bt
If that has unit names and line numbers => good.

If not, you need to first rebuild your IDE with -gw (in Tools > Configure build Lazarus :: in the memo "Custom options")

If gdb does not stop at the IO error, then its a bit more complex.


Also: Do you get the error if you choose "run without debugger" ?

cdbc:
Hi
· Is it at all possible to run GTK2 on this new an Ubuntu?!? I think they do 3/4
· Can GTK2 handle Wayland?!?  -- I have my serious doubts
Try to get answers to these questions and then report back...  :)
Personally I'm running PCLinuxOS, which is a rolling release distro, so FPC & Lazarus can indeed run with the latest. Mind you, I have Lazarus compiled for QT6...
Regards Benny

dbannon:
I have GTK2 Lazarus 4.2 running on a U24.04 VM, used it to build my app in Qt5 as a test, no problems.

That was built from source, not from Ubuntu repo. And using the FPC 3.2.4 release candidate, not the old FPC322 available from Ubuntu.

I'd be very surprised if it was not happy with the GTK2 but possible, the big distros want to abandon GTK2.

Or are you running a Qt5 or Qt6 Lazarus ? I note you mention Qt6 creator ?

Davo

Thaddy:

--- Quote from: cdbc on October 17, 2025, 08:31:49 pm ---Hi
· Is it at all possible to run GTK2 on this new an Ubuntu?!? I think they do 3/4

--- End quote ---
If you use fpcupdeluxe the dependencies will be installed and Ubuntu still has GTK2 in its repositories (like Debian).
I think that the packaging of the apt installs for fpc and lazarus will also install it automatically.

The orginal question:

--- Quote ---lazarus: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
--- End quote ---
has nothing to do with GTK2 but is again a Wayland issue. Wayland's X-server concept is non-existing (by design) or very poor (as a bolt-on).
But you can change to Xwayland.

Navigation

[0] Message Index

[#] Next page

Go to full version