G2 and valgrind

Derek Atkins warlord at MIT.EDU
Sun Feb 19 17:57:00 EST 2006


Quoting Phil Longstaff <plongstaff at newearth.org>:

> I've been playing around with G2 and valgrind 3.1.0 and have seen the
> following issues on SuSE 9.3:
>
> 1) There are lots of messages about decisions based on uninitialized 
> variables
> and accessing past the end of malloc'ed mem in the code dealing with guids.
> It seems as though readdir() does not completely initialize the dirent struct
> that it returns.  There were also messages that md5_process_bytes() was
> accessing bytes from the dirent that were off the end of memory malloc'ed by
> opendir().

These are all perfectly fine.  It's just trying to get random data, so
the fact that the data is uninitialized is okay.  If it bothers you,
you should add a valgrind supression.

>   Finally, there were messages that guid_equal() was returning a
> result based on uninitialized values because the comparison was done
> including the __align_me field, not just the guid data.

This should get fixed.

> The attached patch replaces the const 16 with GUID_DATA_SIZE, only compares
> the guid data, not the other field in the struct, and removes the use of the
> dirent structure in md5 calculation.

The first part of the patch is okay in theory (I haven't looked at the code).
The second part of the patch is not okay.

> 2) After g2 is up, I open an account, switch to ledger view, put my cursor
> into a split and start pressing delete-tab-delete-tab...  I then get the
> listing shown in attachment gnucash.valgrind.  I added printf statements to
> show as splits were allocated and freed.  Most serious is that a split
> continues to be accessed after it is freed.

This is certainly something that needs to get fixed!  Thank you.  Hopefully
someone could track down the reference?

> Phil

-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