On Mon, Jul 23, 2012 at 9:31 AM, Shlomi Fish <[email protected]> wrote:
> > I first suspected svn was the culprit, so I rebuilt it, but it still > happened. > Then I tried build SQLite and running its tests and I got this (below). I > should note that svn works fine after I type "unset MALLOC_CHECK_" in the > console (don't know about the sqlite tests). > > What is the underlying problem and how can it be fixed? > Thanks for the report. As best I can tell, this appears to be a bug in MALLOC_CHECK_ in that it does not play well with malloc_usable_size(). There does not appear to be anything wrong with SQLite in this respect, at least as not as far as I can see. We test SQLite using a variety of memory allocator that do things similar to MALLOC_CHECK_. (See http://www.sqlite.org/testing.html#valgrind for example.) In particular, SQLite tests run clean under valgrind. If you edit the "config.h" file generated by the ./configure script and remove the HAVE_MALLOC_USABLE_SIZE define, then the resulting SQLite will not attempt to use malloc_usable_size() and it then appears to work fine with MALLOC_CHECK_. However, if you do this, then SQLite will increase the size of every memory allocation by 8 bytes and store the allocation size in those 8 bytes so that it can figure out the allocation size for itself when it needs it, meaning that the code will run a little slower and use a little more memory. -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

