[Gluster-devel] how to debug glusterfs with gdb?

Amar S. Tumballi amar at zresearch.com
Mon Sep 22 22:26:57 UTC 2008

Hi Zhouyonghao,
 Sorry for delay in response, we were held up a bit this month. Nice to hear
that you started to write a new xlator. If you want to use glusterfs with
gdb, you need debug symbols to be added while compiling.

you can do

bash# make CFLAGS="-g -O0" && make install

then start gdb.

your command to run the process is fine, but you need to check if your
xlator got initiated or not by using breakpoints. Its as good as using gdb
with any other applications/programs you use.


2008/9/2 <zhouyonghao at ict.ac.cn>

> Hi all ,
>  I began to learn how to write a new xlator, so debugging will be a good
> start point for me. while debugging glusterfs with --no-daemon in gdb
> doesn't work at all, as below is my gdb command and setting,
> --------------------------------
> [root at cluster6 sbin]# gdb glusterfs
> GNU gdb Red Hat Linux (
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-redhat-linux-gnu"...Using host
> libthread_db library "/lib/tls/libthread_db.so.1".
> (gdb) run --no-daemon -f
> /opt/gluster-testbench/test/ibcache/ibcache/ib-server.vol -L DEBUG
> Starting program: /usr/local/glusterfs-1.3.9/sbin/glusterfs --no-daemon -f
> /opt/gluster-testbench/test/ibcache/ibcache/ib-server.vol -L DEBUG
> Failed to read a valid object file image from memory.
> [Thread debugging using libthread_db enabled]
> [New Thread -1208637120 (LWP 7791)]
> [New Thread -1208640592 (LWP 7794)]
> [New Thread -1252299856 (LWP 7795)]
> [New Thread -1260692560 (LWP 7796)]
> [New Thread -1269085264 (LWP 7797)]
> [New Thread -1277477968 (LWP 7798)]
> -----------------------------------
> the gdb outputs are just the same on both the server and client side,
> maybe there's something wrong, please figure it out, thanks in advance :)
> BTW, I saw the line "Failed to read a valid object file image from memory"
> above, maybe something wrong here?
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at nongnu.org
> http://lists.nongnu.org/mailman/listinfo/gluster-devel

Amar Tumballi
Gluster/GlusterFS Hacker
[bulde on #gluster/irc.gnu.org]
http://www.zresearch.com - Commoditizing Super Storage!

More information about the Gluster-devel mailing list