the segmentation fault, it's likely that it was
passed incorrect arguments from some other piece
of code, perhaps
strtol or something that called them.
That being said, here is how to set things up so
gdb can show the line of source
that caused the segmentation fault.
To do source-level debugging, you need an
executable or shared object's debug info, and its
source code. Linux and Unix distributions in
general do not include these by default, to
conserve storage space, but they make them
available as packages.
On CentOS, you just need to install the
debuginfo package for each
executable or library you're interested in. To do
sudo yum install yum-utils
which will install the
debuginfo-install program, then
sudo debuginfo-install glibc
to download and install the
glibc-debuginfo-2.5-123 package (your
version number may vary). This will install, among
many other files,
which are what you need.
debuginfo-install is a short
python program that enables the debuginfo
repositories and downloads and installs the
debuginfo package corresponding to the package you
give as an argument, plus all its dependencies. As
an alternative, you can download the debuginfo
packages directly from http://debuginfo.centos.org (or
any mirrors) and install them using
You mentioned that you got the error No
debuginfo packages available to install.
Perhaps you don't have the debuginfo repo
configured. On my CentOS 5 system, the
configuration is in the file
# All debug packages from all the
various CentOS-5 releases
# are merged into a single repo, split by BaseArch
# Note: packages in the debuginfo repo are
currently not signed
name=CentOS-5 - Debuginfo
For other releases, general instructions for
adding the debuginfo repo are in this CentOS wiki article.