On Mon, Apr 30, 2007 at 09:42:19AM -0400, Stephen Isard wrote:
> 
> Wow, that was fast.  Yes.  No segfault now when I index with the binary 
> compiled with the newer gcc 4.1.1.

Well, my reply was fast.  The actual patch was constructed a few days
ago, arising from a similar bug report via the Debian package
maintainer.

> From a quick look at your patch, it appears that you now release some
> memory in a situation where before you didn't.  Can you explain what
> has changed to make the new compiler require that, where the older
> versions didn't? Or point me at a relevant piece of documentation?

No, the releasing of memory is a secondary issue.  The problem before
was that if the name-value parser was confused by one of the headers it
was parsing, it resulted in current_state becoming -1, and this variable
is used to index into arrays.  It was something around here that was
causing the segfault.  The calls to free() are to clean up the partially
built information when a parse is being abandoned.

I presume that the old compiler was laying out the data in memory
differently, so that the bogus array reference somehow "got away with
it".  Also, this parser was new in 0.20, so previous mairix versions
would not have had this bug.  Perhaps your compiler upgrade coincided
with building a new mairix version.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mairix-users mailing list
Mairix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mairix-users

Reply via email to