I'm trying to use gdb (Ubuntu 12.1) on my Ubuntu VM (22.04.1 LTS), but whenever I try the run
command it always gives a segmentation fault, regardless of the program being debugged.
(gdb) run
Starting program: /home/dir/a.out
Program received signal SIGSEGV, Segmentation fault.
0x0000aaaa9aa5ac89 in ?? ()
This happens even with -g
GCC option.
What's interesting is that on my laptop, with the same Ubuntu VM installed and same gcc/gdb versions, gdb works just fine. So I really don't understand what causes the problem.
I uninstalled and reinstalled both gcc and gdb, and even successfully ran a sudo apt update
and consequent sudo apt upgrade
, but that segmentation fault's still there.
EDIT: haven't found similar problems on the Internet, but I think that the cause of my problem could be VirtualBox (7.0.4), on which runs Ubuntu, that apparently is not completely supported by MacOS Ventura yet.