After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 159288 - Problem with gnome-vfs when using gdb and using gnome-vfs in a GThread
Problem with gnome-vfs when using gdb and using gnome-vfs in a GThread
Status: RESOLVED NOTGNOME
Product: gnome-vfs
Classification: Deprecated
Component: Other
1.0.5
Other Linux
: Normal major
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2004-11-24 10:35 UTC by Philip Van Hoof
Modified: 2005-07-17 21:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8



Description Philip Van Hoof 2004-11-24 10:35:41 UTC
[freax@lort test]$ rpm -q gnome-vfs
gnome-vfs-1.0.5-21
[freax@lort test]$

[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 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 __nptl_setxid
    from /lib/tls/libpthread.so.0
  • #2 seteuid
    from /lib/tls/libc.so.6
  • #3 gnome_vfs_method_init
    from /usr/lib/libgnomevfs-2.so.0
  • #4 gnome_vfs_transform_get
    from /usr/lib/libgnomevfs-2.so.0
  • #5 gnome_vfs_uri_new_private
    from /usr/lib/libgnomevfs-2.so.0
  • #6 gnome_vfs_uri_new
    from /usr/lib/libgnomevfs-2.so.0
  • #7 thread_main_func
    at test.c line 12
  • #8 g_static_private_free
    from /usr/lib/libglib-2.0.so.0
  • #9 start_thread
    from /lib/tls/libpthread.so.0
  • #10 clone
    from /lib/tls/libc.so.6

Thread 1 (Thread -151132480 (LWP 15158))

  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 pthread_join
    from /lib/tls/libpthread.so.0
  • #2 ??
    from /usr/lib/libgthread-2.0.so.0
  • #3 ??
  • #4 ??
  • #5 ??
  • #6 ??
    from /usr/lib/libgthread-2.0.so.0
  • #7 ??
  • #8 ??
The program is running.  Exit anyway? (y or n) y
[freax@lort test]$
Comment 1 Philip Van Hoof 2004-11-25 09:16:11 UTC
It doesn't matter wheter or not the gnome_vfs_init () is called in the second
thread or in the main-thread. I've tested this, it's showing the same behaviour.
Comment 2 Philip Van Hoof 2004-11-25 13:54:58 UTC
Putting 

handle SIG33 nostop noprint

in your ~/.gdbinit is a hackaround this issue 
Comment 3 Christophe Fergeau 2004-11-25 14:06:15 UTC
Closing this bug then, reopen it if you disagree with it being closed
Comment 4 Philip Van Hoof 2004-11-25 14:53:29 UTC
I don't think that, because there is a workaround the problem, it's nolonger a
bug. Either it's a bug in gdb or it's a bug in GnomeVfs. Yet, IMHO, it should be
resolved in a proper way. 

It's not even a solution unless, of course, the GnomeVfs
developers-documentation clearly states that you need to apply this workaround
on your debugging-environment. 

Comment 5 Christophe Fergeau 2004-11-25 15:21:04 UTC
I found http://www.gnome.org/~veillard/gamin/debug.html
« It is perfectly possible to also run the client under a debugger, for the
server it works too except the dnotify kernel interface uses a signal SIG33
which is trapped by gdb. To avoid this use the handle gdb instruction: 
handle SIG33 nostop » while googling around, but even if gnome-vfs usually links
to libfam, I fail to see why it would get something from dnotify. Dunno if this
has something to do with the current issue or not, but this is the only vaguely
relevant page I found on goole.
Comment 6 Philip Van Hoof 2004-11-25 15:28:56 UTC
Note that I had to add add the noprint option mentioned above too, to get a
successful debugging-session.
 
With handle SIG33 nostop noprint :
(gdb) run
Starting program: /home/freax/test/a.out
[Thread debugging using libthread_db enabled]
[New Thread -151132480 (LWP 1689)]
[New Thread -151135312 (LWP 1692)]
[Thread -151135312 (zombie) exited]

Program exited normally.
(gdb)

With handle SIG33 nostop:

(gdb) run
Starting program: /home/freax/test/a.out
[Thread debugging using libthread_db enabled]
[New Thread -151132480 (LWP 1655)]
[New Thread -151135312 (LWP 1658)]

Program received signal SIG33, Real-time event 33.

Program received signal SIG33, Real-time event 33.

Program received signal SIG33, Real-time event 33.

Program received signal SIG33, Real-time event 33.
[Thread -151135312 (zombie) exited]

Program exited normally.
(gdb)
Comment 7 Alexander Larsson 2004-11-26 08:07:07 UTC
I'm not sure why gdb is stopping on SIG33, or why a SIG33 is created when you
use threads. However, this is not a gnome-vfs bug, but a gdb bug or perhaps a
libc bug. 

Gnome-vfs doesn't really use signals in any way appart from how libc might use
them to implement things, so its likely you'll have this problem with any other
app using threads too.
Comment 8 Sebastien Bacher 2005-07-17 21:42:56 UTC
this is not a GNOME issue, I'm closing it as NOTGNOME. Feel free to reopen if
you still get the issue