Forum > General

Lazarus crashing at startup

<< < (2/4) > >>

Martin_fr:
Not much to be found in the logfile.

When you say "crash", you mean
- the IDE closes without any notification / no error dialog
- there is an error dialog of some kind

Could you start the IDE in gdb please?

NOTE, if your IDE is build without debug info, you need to rebuild it with -gw.
- check the size of your lazarus executable. If it is greater 100mb, then it likely has debug info
- to rebuild go menu: Tools > "Configure build lazarus", and in the memo "custom options" enter/add: -gw
  then press build


--- 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 -ex r -ex bt lazarus > somefile.txt
I guess in your case "gdb -ex r -ex bt /usr/bin/lazarus-ide" => so long as lazarus-ide is linked to "lazarus", but not to "startlazarus" (the startlazarus that comes with the installation)

If the IDE crashes "somefile.txt" should (towards the very end) contain a stacktrace.

It should contain
- address (in hex)
- file/unit names and linenumbers.

If it has a stacktrace, but address only (no files/lines) then debug info was missing.

Wenn done, gdb will still be running. (and with it the dead lazarus process)
Since you have no command line to it, you need to "kill -9" the gdb process.

To avoid gdb hanging around you can try

--- 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 -ex "set confirm off" -ex r -ex bt -ex kill -ex q  lazarus > somefile.txt

Чебурашка:
Hi, thanks for repying,


--- Quote from: Martin_fr on December 05, 2022, 11:22:39 pm ---- the IDE closes without any notification / no error dialog

--- End quote ---

It seems to open up his windows for a moment, along with the startup lpi, but then all them close. The splash screen remains visible, and eventually it also closes itself after a while (probably it has a self closing retarder).
No error dialog. Nothing.
And it might occur both when I launch from the kde buttons or from the konsole's command line.
In an unpredictable way.

I don't know, sometimes I have the feeling that is something related to my project, because another thing that sometimes happens, and recently is happening more frequently, is that while I am doing development things, if I push the File open button in the ide menu, once I select the file I wish to open (I do this because my lpi has only main program, the rest is found at compile time by unit search path), ide suddenly crashes (same, closes with no error dialog). Also the latter problem is not systematic, I haven't found a consistent way to get it.


--- Quote from: Martin_fr on December 05, 2022, 11:22:39 pm ---Could you start the IDE in gdb please?

NOTE, if your IDE is build without debug info, you need to rebuild it with -gw.
- check the size of your lazarus executable. If it is greater 100mb, then it likely has debug info
- to rebuild go menu: Tools > "Configure build lazarus", and in the memo "custom options" enter/add: -gw
  then press build


--- 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 -ex r -ex bt lazarus > somefile.txt
I guess in your case "gdb -ex r -ex bt /usr/bin/lazarus-ide" => so long as lazarus-ide is linked to "lazarus", but not to "startlazarus" (the startlazarus that comes with the installation)

If the IDE crashes "somefile.txt" should (towards the very end) contain a stacktrace.

It should contain
- address (in hex)
- file/unit names and linenumbers.

If it has a stacktrace, but address only (no files/lines) then debug info was missing.

Wenn done, gdb will still be running. (and with it the dead lazarus process)
Since you have no command line to it, you need to "kill -9" the gdb process.

To avoid gdb hanging around you can try

--- 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 -ex "set confirm off" -ex r -ex bt -ex kill -ex q  lazarus > somefile.txt
--- End quote ---

In this days I am little busy at work, but I will try to find some time to try this. It will help a lot I am sure.

Martin_fr I can only say thank you for the help.

Martin_fr:

--- Quote from: tt on December 06, 2022, 08:39:38 am ---It seems to open up his windows for a moment, along with the startup lpi, but then all them close. The splash screen remains visible, and eventually it also closes itself after a while

--- End quote ---

That may mean, that you run via "startlazarus" => and then the gdb will not get the trace.

A bit of explanation:
When you install lazarus, then you will do that as root. It will create a directory somewhere in /usr/....../lazarus
In that directory there are 2 executable: startlazarus and lazarus. (Both can display the splash screen)

You normally use startlazarus.
It will find (see below) the correct "lazarus" and run it (telling it, not to show the splash again, since it is already there).

Why all that? Well, because when you install a package, then the "lazarus" executable will be rebuild. But as user you can not update it in /usr/.
So instead a new lazarus executable is placed in (a subdirectory of) the "primary config path" (usually ~/.lazarus/ ). And startlazarus makes sure that is used.

So then, the splash screen is by "startlazarus", and hence it closes later (yes probably on a timer).

gdb will only observe the process it is originally given. It will not deal with processes launched as children.

If gdb debugs startlazarus, then it wont get the crash in "lazarus".

So you need to find the exact location of ~/.lazarus/?????/lazarus
And then feed that to gdb.


About the: crash may be caused by the project
It may, but usually that means the IDE would prompt you the next time it starts.

If you rebuild the IDE (for debug info) you may also want to try and add
-Criot -gt

This adds internally checks, and may help finding the error.

Чебурашка:

--- Quote from: Martin_fr on December 05, 2022, 11:22:39 pm ---- check the size of your lazarus executable. If it is greater 100mb, then it likely has debug info

--- End quote ---

Seems deb 11.5 distributes without debug symbols (understandably)


--- 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";}};} ---user_tt@user_tt-development:~$ ls -lh /usr/lib/lazarus/2.0.10/la*lrwxrwxrwx 1 root root   32 Sep  8 12:30 /usr/lib/lazarus/2.0.10/lazarus -> /etc/alternatives/lazarus-2.0.10-rwxr-xr-x 1 root root  45M Feb 25  2021 /usr/lib/lazarus/2.0.10/lazarus-gtk2-rwxr-xr-x 1 root root  16M Feb 25  2021 /usr/lib/lazarus/2.0.10/lazbuild 

Martin_fr:
I hadn't paid attention to 2.0.12
You should really upgrade.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version