Missing separate debuginfo for - gdb

I try to use gdb to debug code with coredump, but I met:
Missing separate debuginfo for /lib/libc.so.6
Try: zypper install -C "debuginfo(build-id)=c4b9060b36834391b7b73976d38302a7584ae40e"
Missing separate debuginfo for /lib/ld-linux.so.2
Try: zypper install -C "debuginfo(build-id)=39c1043d2fcf5b72a2199cfb765d020b1faeb863"
Missing separate debuginfo for
Try: zypper install -C "debuginfo(build-id)=753a47afb9757471dc4823893adf607eb014b82f"
Missing separate debuginfo for /lib/libc.so.6
Try: zypper install -C "debuginfo(build-id)=c4b9060b36834391b7b73976d38302a7584ae40e"
Missing separate debuginfo for /lib/ld-linux.so.2
Try: zypper install -C "debuginfo(build-id)=39c1043d2fcf5b72a2199cfb765d020b1faeb863"
Then I installed debuginfo for glibc and update glibc to latest version, I try gdb again, it still has one information:
Missing separate debuginfo for
Try: zypper install -C "debuginfo(build-id)=753a47afb9757471dc4823893adf607eb014b82f"
But it doesn't mention which part is missed.
My GDB version is:
-> gdb --version
GNU gdb (GDB) SUSE (7.3-41.1.2)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
OS is:
Linux OpenSUSE-12.1

Add these repositories to the Zypper repositories list:
sudo zypper ar -f -n "openSUSE-Debug" http://download.opensuse.org/debug/distribution/12.1/repo/oss/ repo-debug
sudo zypper ar -f -n "openSUSE-Update-Debug" http://download.opensuse.org/debug/update/12.1/ repo-debug-update
After this, refresh and upgrade repositories:
sudo zypper ref
sudo zypper dup
Then, if necessary (you may get a message suggesting run zypper ps) restart you computer and install debuginfo for gdb:
sudo zypper in glibc-debuginfo

Add these repos:
http://download.opensuse.org/debug/distribution/XX/repo/oss/
http://download.opensuse.org/debug/update/XX/
Where XX is number of your OpenSUSE version.
Make sure they are active:
zypper lr
Then
sudo zypper in glibc-debuginfo

Related

Why does it complain Missing separate debuginfos about my c++ with gdb?

My OS: CentOS Linux release 7.9.2009 (Core)
I am debugging a c++ program with:
gdb demo_test
But I got an error:
Breakpoint 1, Log (level=2, msg=0x7ffff79df035 "[%s]:default model:%s") at ./api/test/test.cpp:16
16 va_start(ap, msg);
Missing separate debuginfos, use: debuginfo-install glibc-2.17-324.el7_9.x86_64 libgcc-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.x86_64
Then I did:
yum install yum-utils
Loaded plugins: langpacks, product-id, search-disabled-repos
Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version
Nothing to do
Then I did:
# debuginfo-install glibc
Loaded plugins: langpacks, product-id
Could not find debuginfo for main pkg: glibc-2.17-324.el7_9.x86_64
Could not find debuginfo pkg for dependency package nss-softokn-freebl-3.53.1-6.el7_9.x86_64
No debuginfo packages available to install
This doesn't fix the issue. I also tried to remove the -02 flag from the g++:
g++ -g -Wall -O2 ./api/test/test.cpp ./${NAME}.so -o demo_test $(CINCLUDE) $(CLIB)
But it doesn't help either. How can I possibly fix the issue? Really thanks in advance.

Update g++ but still old version

I installed g++ using those commands line:
sudo add-apt-repository ppa:jonathonf/gcc-7.1
sudo apt-get update
Then
sudo apt-get install gcc-7 g++-7
When it was done I tried g++ -v but still shows me the old version
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
Am I not upgrading it correctly?
Edit
:~$ dpkg -L g++-7
/.
/usr
/usr/lib
/usr/lib/gcc
/usr/lib/gcc/x86_64-linux-gnu
/usr/lib/gcc/x86_64-linux-gnu/7
/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus
/usr/share
/usr/share/doc
/usr/share/doc/gcc-7-base
/usr/share/doc/gcc-7-base/C++
/usr/share/doc/gcc-7-base/C++/README.C++
/usr/share/doc/gcc-7-base/C++/changelog.gz
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/x86_64-linux-gnu-g++-7.1.gz
/usr/bin
/usr/bin/x86_64-linux-gnu-g++-7
/usr/share/doc/g++-7
/usr/share/man/man1/g++-7.1.gz
/usr/bin/g++-7
:~$ which g++
/usr/bin/g++
Installing a newer (or older) version of GCC than the Ubuntu default version via the package manager
does not delete the default version. You get both. You can install as many
versions as you like. gcc/g++ will continue
to run the default version. If you have installed GCC 7, then you run
the new compilers with gcc-7 or g++-7. For most build systems, it is sufficient to set the environment variables CC=gcc-7 CXX=g++-7 before starting the build.
I installed the gcc-7 using the directions given in Ubuntu Forum, rebooted the system (to make sure all environment variables are loaded) and to compile with C++ 17, type the following on the shell :
g++-7 -std=c++17 program_name.cpp -o program.out
Hope this helps.

g++: internal compiler error: Segmentation fault (program cc1plus) - where do I start?

I am porting code that compiled on Ubuntu 14.04 to 16.04. I have cloned my git repo, installed dependencies and tried the usual make command, soon I hit a g++: internal compiler error: Segmentation fault (program cc1plus) ... yet I am not sure where to start to diagnose and resolve this issue.
I will share as much as I can, see if someone can guide me through a resolution.
Ubuntu
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
g++
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
python
$ python --version
Python 2.7.12
Some environment variables
PYTHON /usr/bin/python2.7
ARCH x86_64
OS Linux
VERSION 4.4.071generic
PLATFORM linux2
HOSTNAME deploy
USER myUser
WUSS_BUILD NO
CCVER gcc
PYLIBDIR build.x86_64-linux2
LIBDIR build.x86_64-linux2
BINDIR build.x86_64-linux2
ODIR build.x86_64-linux2-gcc
STATICLIBDIR build-static.x86_64-linux2
Error
The make command leads to
+++ Compile mycore/boost_json.cc to build.x86_64-linux2-gcc
g++: internal compiler error: Segmentation fault (program cc1plus) <===
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
mk/makelib2.inc:48: recipe for target 'build.x86_64-linux2-gcc/mycore/boost_json.o' failed
make[1]: *** [build.x86_64-linux2-gcc/mycore/boost_json.o] Error 4
Makefile:152: recipe for target 'make.stage1c' failed
make: *** [make.stage1c] Error 2
The error message seems to be pointing at a g++ compiler error (?)
makelib2.inc:48
$(ODIR)/%.o : %.c
#mkdir -p $(dir $#)
#echo "+++ Compile $< to $(ODIR)"
#$(CC) -MMD -MP -MF $(#:.o=.d) -c -I$(ODIR) $(CFLAGS) $(CFLAGS_$*) -o $# $<
I realize that this is going to be very difficult to craft a proper question that would lead to getting proper help. So please bear with me and feel free to suggest adding anything that may help. Unfortunately, I can't share the code.
Update
Going to try upgrade g++ to a more recent version. Following this thread
HERE how to install g++ 7 on Ubuntu
HERE how to install gcc 6 on Ubuntu
How I resolved my g++ segmentation fault issue
Inspired by this thread
I executed the following on my Ubuntu 16.04
sudo apt-get install build-essential software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-snapshot -y
After what g++ was incremented from 5.4.0 to 5.4.1 which resolve the segmentation fault issue
$ g++ --version
g++ (Ubuntu 5.4.1-2ubuntu1~16.04) 5.4.1 20160904
Simply do as you were instructed:
Please submit a full bug report, with preprocessed source if appropriate.
If you can't solve your problem using above methods, you can have a try to check if you are running out of disk space using below command. This is the workaround of my problem.
df -h
sudo du -h --max-depth=1

g++ being shown as installed even after apt-get installation

So when I first type g++ to check at the console, this is what happens:
arunirc#fisher:~$ g++
The program 'g++' is currently not installed. You can install it by typing:
sudo apt-get install g++
As suggested, I install g++ (did sudo apt-get update and -f before that).
arunirc#fisher:~$ sudo apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 121 not upgraded.
But even after it shows that g++ is installed, this is what I get at the command line again:
arunirc#fisher:~$ g++
The program 'g++' is currently not installed. You can install it by typing:
sudo apt-get install g++
Please help! (I am on Ubuntu 14.04).
EDIT 1
(in response to comments)
sudo update-alternatives --config g++ gives this output:
update-alternatives: error: no alternatives for g++
Try using
locate /usr/bin/g++
{when this is out of date, use
sudo updatedb
}
My Ubuntu system currently shows
:~$ locate /usr/bin/g++
/usr/bin/g++
/usr/bin/g++-4.9
/usr/bin/g++-5
Next use
ls -lsa /usr/bin/g++
Mine shows
0 lrwxrwxrwx 1 root root 5 Aug 1 14:32 /usr/bin/g++ -> g++-5
So, my g++ is simply a link to the latest installed g++.
Perhaps this link is either missing or installed incorrectly.
Try manually setting the link.
But before doing that, invoke it directly.
i.e.
/usr/bin/g++-5 --version
my system reports
g++-5 (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Look through Synaptic and see if you have anything related to g++ and purge it.

How to change arm version in arm-linux-gnueabi-gcc for cross compile

I want to cross-compile in eclipse for board armv7l.
I got the armv7l via, uname -i.
I installed ARM cross compiler toolchain, using below commands.
$ sudo apt-get install emdebian-archive-keyring
$ sudo apt-get install libc6-armel-cross libc6-dev-armel-cross
$ sudo apt-get install binutils-arm-linux-gnueabi
$ sudo apt-get install gcc-arm-linux-gnueabi
$ sudo apt-get install g++-arm-linux-gnueabi
$ sudo apt-get install u-boot-tools
$ sudo apt-get install libncurses5-dev
I think I have to give an option for my target board version.
First time I tried to put arm-linux-gnueabi-g++ in C/C++ Build->settings->GCC C++ Compiler and GCC C++ Linker.(eclipse project properties)
Next I put -march=armv7 in Miscellaneous
But it was not working. I checked the executable file with readelf -A
and it shows this
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_CPU_unaligned_access: v6
Tag_DIV_use: Not allowed
What option I have to put for my target board ?