devel questions

Derek Atkins warlord at MIT.EDU
Sat Sep 18 18:41:25 EDT 2004


Chris Shoemaker <c.shoemaker at cox.net> writes:

>> Where in the library does it die?
>> Did you try running with valgrind?
>
> I did now.  Looks kinda like use-after-free:
>
> Creating dummy category.  Budget 0x1e316bd8
> Adding inflow category...
> Adding outflow category...
> NumCols: 8
> Editing Category... Druid: 0x1e2e1468 Budget: 0x1e316bd8
> Category Selected: Inflow
>  
> (gnucash:12885): Gtk-CRITICAL **: file gtkentry.c: line 3643 (gtk_entry_set_text): assertion `text != NULL' failed
> Related Accouts: 0
>  
> (gnucash:12885): GLib-GObject-WARNING **: invalid cast from `GncTreeModelAccount' to `GtkTreeModelSort'
>  
> (gnucash:12885): Gtk-CRITICAL **: file gtktreemodelsort.c: line 2016 (gtk_tree_model_sort_get_model): assertion `GTK_IS_TREE_MODEL_SORT (tree_model)' failed

[snip]

> Later, I'll rerun with larger --num-callers.
>
> Oddly, it doesn't SEGV under valgrind.  Is that normal?

Yes.  Valgrind is going to keep the memory alive so it wont segv...
But yes, this is definitely a double-free.  Most likely there's two
hooks that destroy the object, one the gtk_container and the other is
some other free-hook.  Increasing the --num-callers would definitely
help.

> Oh, and is all this kind of noise also normal:?
> ==12885== Use of uninitialised value of size 4
> ==12885==    at 0x1BCDF3EB: g_hash_table_lookup (in /usr/lib/libglib-2.0.so.0.40 0.6)
> ==12885==    by 0x1BE61084: qof_collection_lookup_entity (qofid.c:210)
> ==12885==    by 0x1BE60C33: qof_entity_init (qofid.c:71)
> ==12885==    by 0x1BE612B9: qof_instance_init (qofinstance.c:58)
> ==12885==
> ==12885== Use of uninitialised value of size 4
> ==12885==    at 0x1BCDF8ED: g_hash_table_remove (in /usr/lib/libglib-2.0.so.0.40 0.6)
> ==12885==    by 0x1BE60F15: qof_collection_remove_entity (qofid.c:189)
> ==12885==    by 0x1BE60FCB: qof_collection_insert_entity (qofid.c:199)
> ==12885==    by 0x1BE60CA1: qof_entity_init (qofid.c:78)

I do not believe it is normal, but I do not know for sure.  I'd have
to look at the code.  There's probably something simple we can do to
quiet it up, but I'd have to look.

> -chris

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list