Recent

Author Topic: GDB crash on Linux Mint 21.  (Read 1633 times)

iru

  • Sr. Member
  • ****
  • Posts: 321
GDB crash on Linux Mint 21.
« on: October 05, 2022, 10:18:57 am »
Environment: Linux Mint 21, FPC 3.2.0, Laz 2.0.12, Firebird 3.

Some update I applied to LM 20 caused crashes in my Laz program on a Firebird database disconnect.

Built a new environment with LM21.

Program compiles clean. Stops on breakpoints but when I hover the cursor over a variable I get exceptions and access violation messages.

The most common exception is '### Not supported on GDB < 5.3 ###'.
On LM 21 GDB is 12.0.90-0ubuntu1.

Any suggestions, ideas??? (I could go back to LM 20.....)

Ian.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: GDB crash on Linux Mint 21.
« Reply #1 on: October 05, 2022, 07:44:16 pm »
Since nobody else has commented: I'm a Debian rather than a Mint user, but do you have the option of installing an older version of GDB?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: GDB crash on Linux Mint 21.
« Reply #2 on: October 07, 2022, 12:48:46 pm »
A little more on this....

I have a laptop with Linux Mint 19.3 so using fpcupdelux I installed Laz 2.0.12, FPC 3.2.0 and Firebird 3.

Recreated the small Firebird project which is the reason for this forum entry.

Compiled ok but when executed failed with a nasty message about
  "The GDB command: "-exec-run" did not return any result."

A simple "Hello World" compiles and executes correctly. Breakpoints work OK.

So what causes GDB to fail in my program??

By a process of elimination it is the the inclusion of  "Firebird" via the -Fu /opt/firebird/include/firebird/.

No code in the program, just 'Firebird' in the unit1 "uses" statement and the -Fu in Project Options>Compiler Options>Paths>Other unit files: (/opt/firebird/include/firebird/)(Path is correct).

Ian.

ccrause

  • Hero Member
  • *****
  • Posts: 843
Re: GDB crash on Linux Mint 21.
« Reply #3 on: October 07, 2022, 01:28:20 pm »
Compiled ok but when executed failed with a nasty message about
  "The GDB command: "-exec-run" did not return any result."

So what causes GDB to fail in my program??
Show the debug output (View > IDE Internals > Debug Output), it should contain more information.

Does your project run without errors if not being debugged?  I.e. when running from a terminal, or inside Lazarus from the menu (Run > Run without Debugging).

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: GDB crash on Linux Mint 21.
« Reply #4 on: October 07, 2022, 02:31:11 pm »
By a process of elimination it is the the inclusion of  "Firebird" via the -Fu /opt/firebird/include/firebird/.

Are you absolutely certain that that path is verbatim what you put in?

Note that putting something in the uses clause will probably execute its initialisation code, even if nothing is called explicitly.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: GDB crash on Linux Mint 21.
« Reply #5 on: October 07, 2022, 11:58:12 pm »
Thank you for the responses.

Early this morning I read your responses and proceeded to test further.

The GDB problem has disapeared!!!

The computer was suspended for last night but before I gave it away for the night I had tidied up the workspace by closing down a lot of apps and command line windows, perhaps there was a conflict with the Laz environment......

I battle on, more confused than usual.....

Ian.

BTW, the first portable computer I worked on was a Morrow CPM with Turbo Pascal. The second (which I still have (upgraded to a 10MB hard disk)) was a Kaypro II.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: GDB crash on Linux Mint 21.
« Reply #6 on: October 08, 2022, 08:39:29 am »
Thank you for the responses.

Early this morning I read your responses and proceeded to test further.

The GDB problem has disapeared!!!

A Heisenbug :-(

Quote
BTW, the first portable computer I worked on was a Morrow CPM with Turbo Pascal. The second (which I still have (upgraded to a 10MB hard disk)) was a Kaypro II.

Presume you've seen the comments on Turbo Pascal in  http://www.chrisfenton.com/dd9-kaypro-edition/ and related comments in his Zedripper project.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: GDB crash on Linux Mint 21.
« Reply #7 on: October 09, 2022, 04:21:10 pm »
The most common exception is '### Not supported on GDB < 5.3 ###'.

The 5.3 part in that message is probably wrong. From a quick glance the error is triggered depending on certain tests, what internal expression GDB evaluates. (And it wrongly assumes that they will work for all versions).
The error should only be displayed if you hit an exception, and the "message" of the exception failed to be read. (not sure why that would happen for you).

As a general rule, if using gdb do use NOT use dwarf-3.
Use "dwarf with sets".

Ensure this is also the case for packages (and the rtl, if you did build it yourself, and added debug info).
Any dwarf3 anywhere, and gdb will not like it. (Though my last tests where with gdb 10 or 11).


If you do not have to use gdb => use FpDebug. (Requires Lazarus 2.2)

---------------
If you get the error again:

Open from the menu:    View > Ide Internals > Debug Output
(On older Lazarus < 2.2, this is: View > Debug Windows > Debug Output)
and copy the content (or the last about 50 lines thereof)

 

TinyPortal © 2005-2018