Problem with gnome-vfs when using gdb and using gnome-vfs in a GThread



This should illustrate the problem

I also submitted this as a bug: 

	http://bugzilla.gnome.org/show_bug.cgi?id=159288


[freax lort test]$ cat test.c
#include <glib.h>
#include <libgnomevfs/gnome-vfs.h>

static gpointer thread_main_func (gpointer data)
{       GnomeVFSURI *uri = NULL;
        const gchar *source = "ftp://ftp.gnome.org/welcome.msg";;

        if (!gnome_vfs_init ())
        {
                g_print ("WARNING: GNOME VFS problems\n");
        }
        uri = gnome_vfs_uri_new (source);

        gnome_vfs_uri_unref (uri);

        g_thread_exit (0);
        return 0;
}

int main (int argc, char **argv)
{
        GThread *thread = NULL;

        g_thread_init (NULL);
        thread = g_thread_create (thread_main_func, NULL, TRUE, NULL);
        g_thread_set_priority (thread, G_THREAD_PRIORITY_NORMAL);

        g_thread_join (thread);
}

[freax lort test]$ gcc test.c `pkg-config gnome-vfs-2.0 --libs --cflags`
-ggdb
[freax lort test]$ ./a.out
[freax lort test]$

(No problems)

However.. in gdb:


[freax lort test]$ gdb ./a.out
GNU gdb Red Hat Linux (6.1post-1.20040607.43rh)
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
Starting program: /home/freax/test/a.out
[Thread debugging using libthread_db enabled]
[New Thread -151132480 (LWP 15158)]
[New Thread -151135312 (LWP 15161)]

Program received signal SIG33, Real-time event 33.
[Switching to Thread -151132480 (LWP 15158)]
0x005277a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) thread apply all bt

Thread 2 (Thread -151135312 (LWP 15161)):
#0  0x005277a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00783df0 in __nptl_setxid () from /lib/tls/libpthread.so.0
#2  0x005fd9fe in seteuid () from /lib/tls/libc.so.6
#3  0x05ff7943 in gnome_vfs_method_init ()
from /usr/lib/libgnomevfs-2.so.0
#4  0x05ff7b31 in gnome_vfs_transform_get ()
from /usr/lib/libgnomevfs-2.so.0
#5  0x06007941 in gnome_vfs_uri_new_private ()
from /usr/lib/libgnomevfs-2.so.0
#6  0x06007a9f in gnome_vfs_uri_new () from /usr/lib/libgnomevfs-2.so.0
#7  0x08048810 in thread_main_func (data=0x0) at test.c:12
#8  0x008db1bd in g_static_private_free ()
from /usr/lib/libglib-2.0.so.0
#9  0x007841d5 in start_thread () from /lib/tls/libpthread.so.0
#10 0x006052da in clone () from /lib/tls/libc.so.6

Thread 1 (Thread -151132480 (LWP 15158)):
#0  0x005277a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00785168 in pthread_join () from /lib/tls/libpthread.so.0
#2  0x00de7d18 in ?? () from /usr/lib/libgthread-2.0.so.0
#3  0xf6fddbb0 in ?? ()
#4  0xfee74e30 in ?? ()
#5  0xfee74e38 in ?? ()
#6  0x00de7f7a in ?? () from /usr/lib/libgthread-2.0.so.0
#7  0xf6fddbb0 in ?? ()
#8  0x00000000 in ?? ()
(gdb) quit
The program is running.  Exit anyway? (y or n) y
[freax lort test]$

-- 
Philip Van Hoof, Software Developer @ Cronos
home: me at freax dot org
gnome: pvanhoof at gnome dot org
work: philip dot vanhoof at cronos dot be
junk: philip dot vanhoof at gmail dot com
http://www.freax.be, http://www.freax.eu.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]