[Gambas-devel] Problem while running gbx2/3 with gdb

Laurent Carlier lordheavym at ...176...
Sat Aug 30 13:20:49 CEST 2008


Le Saturday 30 August 2008 12:54:14 Benoit Minisini, vous avez écrit :
> On samedi 30 août 2008, Laurent Carlier wrote:
> > Le Saturday 30 August 2008 07:35:51 Benoit Minisini, vous avez écrit :
> > > On samedi 30 août 2008, Laurent Carlier wrote:
> > > > I was not able to run gambas 2/3 apps in gdb, as it failed on
> > > > dlopen() calls with an error while loading shared library symbols:
> > > >
> > > > ---8<---
> > > > lordh at ...607...:~/gb2projets/TunnelSDL$ gdb gbx3
> > > > GNU gdb 6.8-debian
> > > > Copyright (C) 2008 Free Software Foundation, Inc.
> > > > License GPLv3+: GNU GPL version 3 or later
> > > > <http://gnu.org/licenses/gpl.html> This is free software: you are
> > > > free to change and redistribute it. There is NO WARRANTY, to the
> > > > extent permitted by law.  Type "show copying" and "show warranty" for
> > > > details. This GDB was configured as "x86_64-linux-gnu"...
> > > > (gdb) run
> > > > Starting program: /usr/local/bin/gbx3
> > > > [Thread debugging using libthread_db enabled]
> > > > Error while reading shared library symbols:
> > > > Cannot find new threads: generic error
> > > > Cannot find new threads: generic error
> > > > (gdb) bt
> > > > #0  0x00007fe7ac19c7b7 in dl_open_worker () from
> > > > /lib64/ld-linux-x86-64.so.2 #1  0x00007fe7ac198366 in _dl_catch_error
> > > > () from /lib64/ld-linux-x86-64.so.2 #2  0x00007fe7ac19c0eb in
> > > > _dl_open () from /lib64/ld-linux-x86-64.so.2 #3  0x00007fe7abd04fbb
> > > > in dlopen_doit () from /lib/libdl.so.2
> > > > #4  0x00007fe7ac198366 in _dl_catch_error () from
> > > > /lib64/ld-linux-x86-64.so.2 #5  0x00007fe7abd0536c in _dlerror_run ()
> > > > from /lib/libdl.so.2
> > > > #6  0x00007fe7abd04f21 in dlopen@@GLIBC_2.2.5 () from /lib/libdl.so.2
> > > > #7  0x0000000000420999 in LIBRARY_load (lib=0x1eb8400) at
> > > > gbx_library.c:468 #8  0x0000000000442377 in COMPONENT_load
> > > > (comp=0x1eb83a0) at
> > > > gbx_component.c:250
> > > > #9  0x0000000000441f4e in COMPONENT_load_all () at
> > > > gbx_component.c:110 #10 0x0000000000420073 in PROJECT_load () at
> > > > gbx_project.c:456 #11 0x00000000004330aa in init (file=0x4467b8 ".")
> > > > at gbx.c:85 #12 0x000000000043366b in main (argc=1,
> > > > argv=0x7fffb43a4808) at gbx.c:299 (gdb) quit
> > > > ---8<---
> > > >
> > > > So i was not able to run gbx code inside gdb (and it's not really 
> > > > easy to do debugging without gdb !).
> > > >
> > > > Then i've filled a bug report in debian (i'm running debian sid
> > > > x86_64): http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496494
> > > >
> > > > And ask for some help on the gdb Mailing List.
> > > >
> > > > Tonight i've succeeded to find a workaround in forcing linking of gbx
> > > > with the libpthread library.
> > > >
> > > > As far as i know, ubuntu hardy got the same problem, i would ike to
> > > > ask you if you got the same problem, and so this is a possible
> > > > workaround
> > > >
> > > > :-)
> > > >
> > > > Regards,
> > >
> > > First, you must run gbx3 with the "-p" option to prevent it from
> > > forking at startup. then, I don't see that gdb has crashed, but just
> > > breaked. So maybe you can continue the program?
> >
> > This is with and without preloading (linking with pthread)
> > --8<--
> > lordh at ...607...:~/gb2projets/TunnelSDL$ gdb gbx3
> > GNU gdb 6.8-debian
> > Copyright (C) 2008 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later
> > <http://gnu.org/licenses/gpl.html> This is free software: you are free to
> > change and redistribute it. There is NO WARRANTY, to the extent permitted
> > by law.  Type "show copying" and "show warranty" for details.
> > This GDB was configured as "x86_64-linux-gnu"...
> > (gdb) run
> > Starting program: /usr/local/bin/gbx3
> > [Thread debugging using libthread_db enabled]
> > [New Thread 0x7f83ea8ee6e0 (LWP 10259)]
> > [New Thread 0x421fe950 (LWP 10262)]
> > [Thread 0x421fe950 (LWP 10262) exited]
> >
> > Program exited normally.
> > (gdb) run -p
> > Starting program: /usr/local/bin/gbx3 -p
> > [Thread debugging using libthread_db enabled]
> > [New Thread 0x7f2c3161f6e0 (LWP 10263)]
> > [New Thread 0x41457950 (LWP 10264)]
> > [Thread 0x41457950 (LWP 10264) exited]
> >
> > Program exited normally.
> > (gdb)
> > --8<--
> >
> > I don't see  a lot of differences.
>
> I have committed a patch to always link gbx2 with pthread (not yet for
> gbx3). Does always linking with pthread solve the problem?

Yes, it's fixing the problem, i've applying the same patch on  G3 with the same 
success.

Regards,





More information about the Devel mailing list