xfsamba4 crashes on start

Rabin K Patra rkpatra at eecs.berkeley.edu
Mon Jun 28 09:52:55 CEST 2004


Hi all,
I looked around a little bit to see why my xfsamba4 crashes on start and 
this is what I found.

Inside the package xffm-4.0.5:
File src/add_node_contents.c:180 calls qsort with the compare function 
'gdir_compare'.
The list to be sorted is 'gdir', and it is a list('gdir->gl') of tree 
entries.
However, the name of the first entry in this list (gdir->gl[0].pathv) 
seems to be NULL. This causes a crash later when gdir_compare is calls 
strcmp or strchr on gdir->gl[0].pathv.
What I cannot figure out is where the first tree entry gets this NULL 
pointer.

Thanks,
-Rabin



Here is my gdb session: with the values of the 'gdir' list (showing the 
NULL name)

Starting program: /opt/local/bin/xfsamba4
[Thread debugging using libthread_db enabled]
[New Thread -1084499936 (LWP 16895)]
Detaching after fork from child process 16898.
Detaching after fork from child process 16899.
Detaching after fork from child process 16900.
Detaching after fork from child process 16901.
Detaching after fork from child process 16902.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1084499936 (LWP 16895)]
0x003a0b83 in strrchr () from /lib/tls/libc.so.6
(gdb) bt
#0  0x003a0b83 in strrchr () from /lib/tls/libc.so.6
#1  0x0076d26d in gdir_sort_type () from /usr/lib/libxffm.so.0
#2  0x0076d3c0 in gdir_compare () from /usr/lib/libxffm.so.0
#3  0x00362fd0 in msort_with_tmp () from /lib/tls/libc.so.6
#4  0x00362f30 in msort_with_tmp () from /lib/tls/libc.so.6
#5  0x003631f8 in qsort () from /lib/tls/libc.so.6
#6  0x08052516 in add_node_contents (treeview=0x9735d50, iter=0xbfe7e040,
    gdir=0x758450) at add_node_contents.c:188
#7  0x00754321 in NMBmastersLookup () from /usr/lib/libxffmsmb.so.0
#8  0x00757648 in open_smb () from /usr/lib/libxffmsmb.so.0
#9  0x08062247 in open_dir (treeview=0x9735d50, iter=0x99fae10,
    treepath=0x99fada0, user_data=0x9735d50) at callbacks.c:279
#10 0x00a3ef85 in gtk_marshal_VOID__UINT_STRING ()
   from /usr/lib/libgtk-x11-2.0.so.0
#11 0x007fd160 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#12 0x00811195 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#13 0x00810157 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#14 0x00810454 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#15 0x00b203ab in gtk_tree_view_expand_to_path () from 
/usr/lib/libgtk-x11-2.0.so.0
#16 0x00b2058e in gtk_tree_view_expand_row () from 
/usr/lib/libgtk-x11-2.0.so.0
#17 0x08067651 in init_xffm (argc=1, argv=0xbfe7e630) at treeview.c:1561
#18 0x08067c1a in main (argc=1, argv=0xbfe7e914) at main.c:239
(gdb) f 6
#6  0x08052516 in add_node_contents (treeview=0x9735d50, iter=0xbfe7e040,
    gdir=0x758450) at add_node_contents.c:188
188             qsort((void *)gdir->gl, gdir->pathc, sizeof(dir_t), 
gdir_compare);






(gdb) print *(gdir->gl + 0)
$1 = {pathv = 0x0, en = 0x9a17d40}
(gdb) print *(gdir->gl + 0)->en
$2 = {type = 1124106256, subtype = 1, count = -1, st = 0x9a19860, tag = 0x0,
  path = 0x9a19518 "//TIER", filter = 0x9746098 "*", checksum = 
6756141612728,
  load_time = 0}
(gdb) print *(gdir->gl + 1)
$3 = {pathv = 0x9a19508 "WORKGROUP", en = 0x9a19810}
(gdb) print *(gdir->gl + 1)->en
$4 = {type = 1124106256, subtype = 1, count = -1, st = 0x9a19528, tag = 0x0,
  path = 0x9a199c8 "//GNU", filter = 0x99f6ea0 "*", checksum = 
6004522325680,
  load_time = 0}
(gdb) print *(gdir->gl + 2)
$5 = {pathv = 0x9a17d80 "MDKGROUP", en = 0x9a17c50}
(gdb) print *(gdir->gl + 2)->en
$6 = {type = 1124106256, subtype = 1, count = -1, st = 0x9a19758, tag = 0x0,
  path = 0x9a17d70 "//DARKSEID", filter = 0x9a09230 "*", checksum = 
6004522319432,
  load_time = 0}


> Hi all,
> xfsamba4 always crashes on me when I start it in my office network.
> This happens after about 10 seconds of what seems like a lot of 
> scanning(which must be normal).
> I can try to dig a little more to find out more information .. but I 
> dont know what to look for.
>
> Thanks,
> -Rabin
>
> My system configuration:
> Fedora Core 2(standard), glibc-2.3.3, gtk2-2.4.0
> btw, I had this problem with Fedora Core 1 as well.
> xfce4-4.0.4-1
> xffm-4.0.5-1
>
>
> Here is the gdb trace from running "gdb xfsamba4" ,run, bt:
> Starting program: /usr/bin/xfsamba4
> (no debugging symbols found).. ....[Thread debugging using 
> libthread_db enabled]
> [New Thread -1084394368 (LWP 1791)]
> (no debugging symbols found).......Detaching after fork from child 
> process 1794.
> Detaching after fork from child process 1797.
> Detaching after fork from child process 1806.
> Detaching after fork from child process 1818.
> Detaching after fork from child process 1822.
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1084394368 (LWP 1791)]
> 0x003a0b83 in strrchr () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0x003a0b83 in strrchr () from /lib/tls/libc.so.6
> #1  0x0076d26d in gdir_sort_type () from /usr/lib/libxffm.so.0
> #2  0x0076d3c0 in gdir_compare () from /usr/lib/libxffm.so.0
> #3  0x00362fd0 in msort_with_tmp () from /lib/tls/libc.so.6
> #4  0x00362f30 in msort_with_tmp () from /lib/tls/libc.so.6
> #5  0x003631f8 in qsort () from /lib/tls/libc.so.6
> #6  0x080529ad in add_node_contents ()
> #7  0x00754321 in NMBmastersLookup () from /usr/lib/libxffmsmb.so.0
> #8  0x00757648 in open_smb () from /usr/lib/libxffmsmb.so.0
> #9  0x08067e5c in open_dir ()
> #10 0x00a3ef85 in gtk_marshal_VOID__UINT_STRING ()
>  from /usr/lib/libgtk-x11-2.0.so.0
> #11 0x007fd160 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
> #12 0x00811195 in g_signal_emit_by_name () from 
> /usr/lib/libgobject-2.0.so.0
> #13 0x00810157 in g_signal_emit_valist () from 
> /usr/lib/libgobject-2.0.so.0
> #14 0x00810454 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
> #15 0x00b203ab in gtk_tree_view_expand_to_path () from 
> /usr/lib/libgtk-x11-2.0.so.0
> #16 0x00b2058e in gtk_tree_view_expand_row () from 
> /usr/lib/libgtk-x11-2.0.so.0
> #17 0x0806e389 in init_xffm ()
> #18 0x09bf7260 in ?? ()
> #19 0x00000000 in ?? ()





More information about the Xfce4-dev mailing list