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

Re: gerbv crashes (was Re: gEDA-user: gerbv 1.0 on RH8)



Here is the output from ELECTRIC FENCE.

I hope that this output will put more light to this problem

Igor

=========================================================

[igor@netnarin morgan]$ setenv LD_PRELOAD /usr/lib/libefence.so

[igor@netnarin morgan]$ gdb /usr/local/bin/gerbv
 
  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens <bruce@xxxxxxxxxx>
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 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"...
(gdb) r
Starting program: /home/local/bin/gerbv
 
  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens <bruce@xxxxxxxxxx>

<etc etc etc>

Program received signal SIGSEGV, Segmentation fault.
0x403bd3de in strcat () from /lib/libc.so.6
(gdb) where
#0  0x403bd3de in strcat () from /lib/libc.so.6
#1  0x080543ec in cb_ok_project (widget=0x4218be10, data=0x429e1ff4)
at gerbv.c:847
#2  0x400d74d6 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0
#3  0x40113fa5 in gtk_handlers_run () from /usr/lib/libgtk-1.2.so.0
#4  0x40112fbb in gtk_signal_real_emit () from /usr/lib/libgtk-1.2.so.0
#5  0x401104ae in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#6  0x4005cd2e in gtk_button_clicked () from /usr/lib/libgtk-1.2.so.0
#7  0x4005ea0b in gtk_real_button_released () from /usr/lib/libgtk-1.2.so.0
#8  0x400d74d6 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0
#9  0x40112ece in gtk_signal_real_emit () from /usr/lib/libgtk-1.2.so.0
#10 0x401104ae in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#11 0x4005cc1e in gtk_button_released () from /usr/lib/libgtk-1.2.so.0
#12 0x4005e0a1 in gtk_button_button_release () from /usr/lib/libgtk-1.2.so.0
#13 0x400d7106 in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
#14 0x40113000 in gtk_signal_real_emit () from /usr/lib/libgtk-1.2.so.0
#15 0x401104ae in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#16 0x40156346 in gtk_widget_event () from /usr/lib/libgtk-1.2.so.0
#17 0x400d6f0f in gtk_propagate_event () from /usr/lib/libgtk-1.2.so.0
#18 0x400d5c54 in gtk_main_do_event () from /usr/lib/libgtk-1.2.so.0
#19 0x401a02d5 in gdk_event_dispatch () from /usr/lib/libgdk-1.2.so.0
#20 0x401d597e in g_main_dispatch () from /usr/lib/libglib-1.2.so.0
#21 0x401d5e59 in g_main_iterate () from /usr/lib/libglib-1.2.so.0
#22 0x401d60f4 in g_main_run () from /usr/lib/libglib-1.2.so.0
#23 0x400d56df in gtk_main () from /usr/lib/libgtk-1.2.so.0
#24 0x08057f20 in main (argc=1, argv=0xbffff9e4) at gerbv.c:2792
#25 0x4035f54d in __libc_start_main () from /lib/libc.so.6
(gdb)


On Sat, 5 Feb 2005 06:38:59 +0100, Mario Klebsch <mario@xxxxxxxxxx> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Am 04.02.2005 um 22:12 schrieb Stefan Petersen:
> 
> > Hello again!
> >
> > According to your gdb dump it segfaults in a function called
> > 'update_statusbar' when calling 'gtk_label_set_text' in gtk.
> >
> > This can not happen, it is impossible. At least not where gdb dump
> > shows. Broken gtk/glib/libc?
> 
> This can easily happen. The program segaults in calloc(), which is a
> malloc() like function. Due to thw way malloc() works, segfaults can
> occur (without the lib being broken) if the user program does things
> like writing past the end of malloc()ed buffers, writing to free()ed
> buffers or even free()in stuff, that isn'tn malloc()ed anymore (double
> calls to free()).
> 
> The Bugs often are miles away from the location, that segfaults. To
> find bugs like this one, you have to use a specual
> malloc()/free()-debugger like efence (Electric Fence). This is not a
> program (like gdb) but a library itself, which supplies malloc(),
> free() &co. efence is build in a special way, that common errors in
> using malloc()ed memory do not crash malloc()/fre()/... but let your
> program crash where the bug is located.
> 
> You have to link efence to your program, there even is a shared lib,
> which can be loaded using
> 
>         LD_PRELOAD=/path/to/libefence.so /some/program
> 
> efence checks for double free()s, delevers memory in a way, that
> accesses past the buffer end do segfault, and after free()in some
> memory, the address never gets used again, so accesses to free()ed
> memory segfault, too. OTOH, memory allocation with efence is much
> slower and long running programs can easily run out of memory. So only
> use it for debugging, not for production software.
> 
> 73, Mario
> - --
> Mario Klebsch                                           mario@xxxxxxxxxx
> PGP-Key available at http://www.klebsch.de/public.key
> Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
>   Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (Darwin)
> 
> iD8DBQFCBFv/MM6fsqBHnOARAu8rAJwPIOwfU5raBAQcwTF5OqwXWVMNfQCgoEjU
> XX8nBn9rmtD30ej5LDaw0hw=
> =ZdpB
> -----END PGP SIGNATURE-----
> 
>