59

CentOS 6.2 + GNU gdb (GDB) Red Hat Enterprise Linux (7.2-50.el6)

When I debug a simple c++ code with GDB, I saw the following warning:

Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.9.i686 libgcc-4.4.6-3.el6.i686 libstdc++-4.4.6-3.el6.i686

I have tried the following methods and none of them fix the problems:

  1. Search SO

  2. yum install glibc

  3. debuginfo-install glibc-2.12-1.47.el6_2.9.i686 libgcc-4.4.6-3.el6.i686 libstdc++-4.4.6-3.el6.i686

In fact, when I install those RPM one by one, I just realized that they are installed already.

[root@localhost Excluded]# rpm -ivh glibc-2.12-1.47.el6_2.9.i686.rpm 
Preparing...                ########################################### [100%]
    package glibc-2.12-1.47.el6_2.9.i686 is already installed
[root@localhost Excluded]# ls *.rpm
glibc-2.12-1.47.el6_2.9.i686.rpm  libgcc-4.4.6-3.el6.i686.rpm
[root@localhost Excluded]# rpm -ivh libgcc-4.4.6-3.el6.i686.rpm 
Preparing...                ########################################### [100%]
    package libgcc-4.4.6-3.el6.i686 is already installed
[root@localhost Excluded]# rpm -ivh libstdc++-4.4.6-3.el6.i686.rpm 
warning: libstdc++-4.4.6-3.el6.i686.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
Preparing...                ########################################### [100%]
    package libstdc++-4.4.6-3.el6.i686 is already installed
    file /usr/lib/libstdc++.so.6.0.13 from install of libstdc++-4.4.6-3.el6.i686 conflicts with file from package libstdc++-4.4.6-3.el6.i686

Why GDB cannot find it?

Question: Do I have to worry about this issue? If not, how to turn it off? If yes, how to fix it?

Thank you

Richard
  • 50,293
  • 28
  • 163
  • 235
q0987
  • 33,230
  • 67
  • 231
  • 369

3 Answers3

107

debuginfo-install is a command of yum-utils, so

  1. yum install yum-utils
  2. debuginfo-install glibc
  3. if the warning's still there, edit /etc/yum.repos.d/CentOS-Debuginfo.repo, set enabled=1
dotslashlu
  • 3,289
  • 3
  • 27
  • 56
  • 8
    I definitely had to enable the CentOS-Debuginfo.repo. Thanks. – rfay Mar 18 '14 at 19:07
  • 1
    You'll also need to set `gpgcheck=0` in `CentOS-Debuginfo.repo` ([source](http://wiki.centos.org/AdditionalResources/Repositories)). – duozmo Apr 26 '14 at 15:50
  • I had to Enable the Repo i.e Step 3 to do Step 2 ! Thanks thought . – Nishant Jun 28 '14 at 21:04
  • 5
    For dnf, `sudo dnf install dnf-plugins-core` as per https://bugzilla.redhat.com/show_bug.cgi?id=1121318, then `sudo dnf debuginfo-install ...` – jozxyqk Jul 28 '15 at 05:40
  • 2
    if someone know how to do Step 3 in RHEL7? i have only epel.repo, epel-testing.repo, redhat.repo files – Oleg Vazhnev Aug 25 '15 at 05:24
  • How to do it on ubuntu? – Necktwi Apr 24 '16 at 17:34
  • Thanks, this set me on the right track. FYI, if your gdb error message includings something like `Missing separate debuginfos, use: debuginfo-install httpd-2.2.15-55.el6.centos.2.x86_64` don't ignore it. Quit DGB and install the debuginfos it recommends. I had to install the ones for apache, php and mysql for my LAMP box. – squarecandy Feb 11 '17 at 03:42
  • 1
    If you don't have the `debuginfo` repo defined in `/etc/yum.repos.d`, https://wiki.centos.org/AdditionalResources/Repositories/DebugInfo helped me out. – lkraav Jul 09 '18 at 11:12
  • Worked for me on Fedora 31 (did not need to do step 3). – Michael Noguera Apr 05 '20 at 19:16
1

In case, someone else encounters the same issue,

I had updated the glibc and somehow the old ldconfig had been flushed was facing this error while running the application

error while loading shared libraries: libjson-c.so.2: cannot open shared object file: No such file or directory

Even after setting the LD_LIBRARY_PATH it didn't work:

LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

Finally the commands below came to the rescue.

// Add you library path here.
echo /usr/local/lib >> /etc/ld.so.conf

// And then Run ldconfig to reflect the path
ldconfig
Richard
  • 50,293
  • 28
  • 163
  • 235
Ankit Marothi
  • 877
  • 10
  • 14
  • This looks like it's what I need to solve my problem, but can you make it clearer what you're suggesting I do? – michaelmoo Aug 29 '14 at 19:53
0

The order of the accepted answer doesn't work for me.

I followed some tips in the comments and here's what I tried and succceded in my fresh install CentOS 7.2

  1. From @lkraav's comment, I followed this wiki https://wiki.centos.org/AdditionalResources/Repositories/DebugInfo and create a new file.

The following could be appended to /etc/yum.repos.d/CentOS-Base.repo or a new file created such as /etc/yum.repos.d/CentOS-Debug.repo.

  1. I pasted those contents from the wiki into the new /etc/yum.repos.d/CentOS-Debug.repo file but edit enabled=0 line to enabled=1

  2. I debuginfo-install everything showed in the gdb warning and succeeded installing.

Rick
  • 6,046
  • 2
  • 37
  • 65