Skip to content
Advertisement

gdb core dump can not see any symbols after “sudo apt-get install libc6-dbg”

I am trying to debug a program in Ubuntu 12.04(x86_64) LTS with core dump file. At the beginning, the “bt” command is ok, just like below

JavaScript

I want to see the symbol in libc.so.6 , so I install libc6-dbg using

JavaScript

but after install

JavaScript

I get all the thing wrong , showing in the below:

JavaScript

I try to remvoe lib6c-dbg with

JavaScript

but it cant make any effect.

Advertisement

Answer

I get all the thing wrong , showing in the below:

What probably happened is that apt-get install libc6-dbg also updated already installed libc6, and the currently installed libc.so.6 no longer matches the one that was used when the core file was generated.

For GDB analysis, you need an exact matching copy as what was used at runtime.

So you’ll need to re-install the old version of libc6 (look in /var/log/apt/history.log to find out what it was), and a matching version of libc6-dbg.

Update:

It seems that the command apt-get install libc6-dbg get the libraries with version 2.15-0ubuntu10.12

Just as I guessed could be the case.

How can I recover it to the version in 2.15-0ubuntu10.4

This is really a sysadmin question, but here is an answer I found on Google 😉

JavaScript

should do the trick.

Advertisement