This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Random failures when calling free()/malloc()


On Mon, 2003-07-14 at 10:55, wmglo@dent.med.uni-muenchen.de wrote:

Hi

Sorry, home mail been down for last week due to server move/upgrade.

> Unlikely.  I think you're either seeing stack corruption (really
> bad to track down :-( ) or you're seeing a wrong stack dump from
> gdb which doesn't understand gcc's optimizations.
> 

I tried with and without any optimizations.  In most cases I just
used '-ggdb' to debug it, but same issues with '-march=pentium3 -O2
-pipe' or whatever.

> > I am not the greatest of debuggers, so a hand would be appreciated.
> 
> You should compile a glibc or at least a malloc module without
> optimization and see wether the problem can be reproduced.
> valgrind of course would be much better still.
> 

Like I said - did play with optimizations.  Also, valgrind do not
build currently on glibc from CVS and nptl.

Anyhow, with the latest glibc/gcc, I get a new one that do not die
when calling unlink():

----------------------------------------------------
Program received signal SIGSEGV, Segmentation fault.
0x4065b25b in __libc_free (mem=0x81fda68) at malloc.c:3353
3353      (void)mutex_lock(&ar_ptr->mutex);
(gdb) bt
#0  0x4065b25b in __libc_free (mem=0x81fda68) at malloc.c:3353
#1  0x405a353d in g_free (mem=0x81fda68) at gmem.c:186
#2  0x405c17f0 in g_utf8_collate_key (str=0x81fda48 "ld", len=-1) at
gunicollate.c:211
#3  0x402abfaa in open_new_dir (dir_name=0x81edbc0
"/space/var/tmp/portage/binutils-2.14.90.0.4.1-r1/work/binutils-2.14.90.0.4.1", sbuf=0xbfffc6b0,
    stat_subdirs=1) at gtkfilesel.c:3143
#4  0x402ac3b7 in open_dir (dir_name=0x81edbc0
"/space/var/tmp/portage/binutils-2.14.90.0.4.1-r1/work/binutils-2.14.90.0.4.1",
cmpl_state=0x81edb70)
    at gtkfilesel.c:3276
#5  0x402ab1db in cmpl_init_state () at gtkfilesel.c:2652
#6  0x402a716d in gtk_file_selection_init (filesel=0x81eb808) at
gtkfilesel.c:665
#7  0x4055b5fe in g_type_create_instance (type=134918960) at
gtype.c:1419
#8  0x405440be in g_object_constructor (type=134918960,
n_construct_properties=1, construct_params=0x81e9588) at gobject.c:827
#9  0x40543b01 in g_object_newv (object_type=134918960, n_parameters=0,
parameters=0x0) at gobject.c:725
#10 0x40543c9c in g_object_new_valist (object_type=134918960,
first_property_name=0x0, var_args=0xbfffcab8 "") at gobject.c:764
#11 0x405436e3 in g_object_new (object_type=134918960,
first_property_name=0x0) at gobject.c:618
#12 0x402a839d in gtk_file_selection_new (title=0x807f53f "Open
Archive") at gtkfilesel.c:1090
#13 0x0806c849 in open_archive_cb (widget=0x80ce738, data=0x80b14a0) at
menu-callbacks.c:336
#14 0x4055638e in g_cclosure_marshal_VOID__VOID (closure=0x80eb170,
return_value=0x0, n_param_values=1, param_values=0xbfffcdc0,
    invocation_hint=0xbfffcc68, marshal_data=0x0) at gmarshal.c:77
#15 0x40540572 in g_closure_invoke (closure=0x80eb170, return_value=0x0,
n_param_values=1, param_values=0xbfffcdc0, invocation_hint=0xbfffcc68)
    at gclosure.c:437
#16 0x40555b2b in signal_emit_unlocked_R (node=0x80c9b18, detail=0,
instance=0x80ce738, emission_return=0x0, instance_and_params=0xbfffcdc0)
    at gsignal.c:2822
#17 0x40554e36 in g_signal_emit_valist (instance=0x80ce738,
signal_id=125, detail=0,
    var_args=0xbfffcf4c
"D\001W@|?%@8?A@h???V?%@8?\f\bD\001W@????\216cU@8?\f\b?\210\n\b????\037\025V@`???????\f") at gsignal.c:2554
#18 0x405551b2 in g_signal_emit (instance=0x80ce738, signal_id=125,
detail=0) at gsignal.c:2612
#19 0x4025ebab in gtk_button_clicked (button=0x80ce738) at
gtkbutton.c:555
#20 0x4025fa56 in gtk_real_button_released (button=0x80ce738) at
gtkbutton.c:1044
#21 0x4055638e in g_cclosure_marshal_VOID__VOID (closure=0x80c9a40,
return_value=0x0, n_param_values=1, param_values=0xbfffd260,
    invocation_hint=0xbfffd108, marshal_data=0x4025fa00) at
gmarshal.c:77
#22 0x4054089c in g_type_class_meta_marshal (closure=0x80c9a40,
return_value=0x0, n_param_values=1, param_values=0xbfffd260,
invocation_hint=0xbfffd108,
    marshal_data=0x1a4) at gclosure.c:514
#23 0x40540572 in g_closure_invoke (closure=0x80c9a40, return_value=0x0,
n_param_values=1, param_values=0xbfffd260, invocation_hint=0xbfffd108)
    at gclosure.c:437
#24 0x40555762 in signal_emit_unlocked_R (node=0x80c9a88, detail=0,
instance=0x80ce738, emission_return=0x0, instance_and_params=0xbfffd260)
    at gsignal.c:2752
#25 0x40554e36 in g_signal_emit_valist (instance=0x80ce738,
signal_id=124, detail=0,
    var_args=0xbfffd3ec
"D\001W@G?%@8?A@\030?????%@8?\f\bD\001W@\030???8?\f\b8?\f\b8?A@H???r?-@8?\f\b\030c\035\bP\200\n\b?\216\b\bP\200\n\b8?\f\b0B\v\b\200?%@") at
gsignal.c:2554
#26 0x405551b2 in g_signal_emit (instance=0x80ce738, signal_id=124,
detail=0) at gsignal.c:2612
#27 0x4025eb76 in gtk_button_released (button=0x80ce738) at
gtkbutton.c:547
#28 0x4025f8ac in gtk_button_button_release (widget=0x80ce738,
event=0x81d6318) at gtkbutton.c:960
#29 0x402dc372 in _gtk_marshal_BOOLEAN__BOXED (closure=0x80b4230,
return_value=0xbfffd570, n_param_values=2, param_values=0xbfffd700,
    invocation_hint=0xbfffd5a8, marshal_data=0x4025f880) at
gtkmarshalers.c:82
#30 0x4054089c in g_type_class_meta_marshal (closure=0x80b4230,
return_value=0xbfffd570, n_param_values=2, param_values=0xbfffd700,
    invocation_hint=0xbfffd5a8, marshal_data=0xb4) at gclosure.c:514
#31 0x40540572 in g_closure_invoke (closure=0x80b4230,
return_value=0xbfffd570, n_param_values=2, param_values=0xbfffd700,
invocation_hint=0xbfffd5a8)
    at gclosure.c:437
#32 0x40555d1b in signal_emit_unlocked_R (node=0x80b43c8, detail=0,
instance=0x80ce738, emission_return=0xbfffd680,
instance_and_params=0xbfffd700)
    at gsignal.c:2860
#33 0x40554ebf in g_signal_emit_valist (instance=0x80ce738,
signal_id=44, detail=0, var_args=0xbfffd890 "?????\210\n\b????\b") at
gsignal.c:2564
#34 0x405551b2 in g_signal_emit (instance=0x80ce738, signal_id=44,
detail=0) at gsignal.c:2612
#35 0x403a3f31 in gtk_widget_event_internal (widget=0x80ce738,
event=0x81d6318) at gtkwidget.c:3198
#36 0x403a3bb5 in gtk_widget_event (widget=0x80ce738, event=0x81d6318)
at gtkwidget.c:3004
#37 0x402dc242 in gtk_propagate_event (widget=0x80ce738,
event=0x81d6318) at gtkmain.c:2254
#38 0x402db01b in gtk_main_do_event (event=0x81d6318) at gtkmain.c:1503
#39 0x4045d35b in gdk_event_dispatch (source=0x809c1a8, callback=0,
user_data=0x0) at gdkevents-x11.c:2008
#40 0x4059cede in g_main_dispatch (context=0x809c680) at gmain.c:1720
---Type <return> to continue, or q <return> to quit---
#41 0x4059dfa5 in g_main_context_dispatch (context=0x809c680) at
gmain.c:2268
#42 0x4059e3e5 in g_main_context_iterate (context=0x809c680, block=1,
dispatch=1, self=0x808d1f8) at gmain.c:2349
#43 0x4059ec9e in g_main_loop_run (loop=0x808f910) at gmain.c:2569
#44 0x402da689 in gtk_main () at gtkmain.c:1093
#45 0x0806b366 in main (argc=1, argv=0xbfffdbf4) at main.c:126
#46 0x406016c5 in __libc_start_main (main=0x806b1c8 <main>, argc=1,
ubp_av=0xbfffdbf4, init=0x807bcc8 <__libc_csu_init>,
    fini=0x807bd10 <__libc_csu_fini>, rtld_fini=0x40015000
<_rtld_local>, stack_end=0x4) at ../sysdeps/generic/libc-start.c:205
(gdb)


Regards,

-- 

Martin Schlemmer



Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]