Jorge wrote:
On Tue, Jan 06, 2009 at 01:37:10PM +0100, Johannes Hofmann wrote:
On Mon, Jan 05, 2009 at 02:51:03PM -0300, Jorge Arellano Cid wrote:
Hi there,
With Johannes, we're trying to find out why valgrind complains on the newest CSS branch with a certain URL:
$ valgrind --tool=memcheck --leak-check=yes \ ./dillo http://selenic.com/pipermail/mercurial/ &>out
$ less out
There're several "Invalid read of size 1".
It doesn't complain with a local file, nor after repush. It seems the timing is important, and maybe the decoder...
The problem seems to be that at cache.c:1149 data is assigned entry->UTF8Data, then during Html_callback() a_Cache_set_content_type() get's called which since revision 48029b8a5478 frees entry->UTF8Data. That also explains why the earlier read of start went ok.
Good catch!
I made those changes (48029b8a5478) not knowing exactly how the whole process goes. What I don't understand now is:
* The Hg CSS repo from freehg (tip: f9099e82be08) has the problem, but it doesn't have the "Free UTF8Data" patch (48029b8a5478).
Anyway, it seems the bug is related to setting the new decoder.
Now that I see 48029b8a5478, I'm curious about it: Is there an unref missing somewhere that caused UTF8Data to need to be freed in those cases?