Segmentation Fault in xaccFreeSplit

Matthew Vanecek mevanecek at yahoo.com
Fri Jan 21 22:09:18 EST 2005


On Fri, 2005-01-21 at 11:37 -0800, Thomas Bushnell BSG wrote:
> Derek Atkins <warlord at MIT.EDU> writes:
> 
> > I see nothing wrong with this code.  It should be perfectly legal to
> > set an invalid pointer like this.  Unless you are specifically doing
> > bounds-checking on pointer-sets I can't see how setting a pointer
> > would cause a SEGV.  You're not ACCESSING the memory then, you're only
> > setting the pointer.  It should be no more special than setting the
> > pointer to NULL or to some other arbitrary value.
> 
> There are processors which have special address registers, and which
> do fault as soon as you store certain kinds of illegal addresses in
> them rather than waiting for an access.  How important these
> processors are, and whether you want to worry about them, is a
> different question.
> 
> Thomas

It's faulting on my P3 nowadays for some reason.  I wasn't sure if it
was a glibc thing or what.  Quite annoying.  I was wondering if someone
could reproduce this on his/her machine, to see if it's my machine/setup
or something else.

I'm kinda skeptical about using the contents of a freed Split to see if
the Split has been freed, though.  What if something else has
overwritten the freed memory?  Why is that particular pointer guaranteed
to still be == (char *)1 if the split is run through the function again?

Thanks,
-- 
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050121/1e46e241/attachment.bin


More information about the gnucash-devel mailing list