From: Andrew R. <and...@us...> - 2012-11-23 21:22:42
|
On Fri, Nov 23, 2012 at 09:48:58AM -0800, Alan Irwin wrote: > On 2012-11-23 12:13-0000 Andrew Ross wrote: > > > Alan, > > > > This is odd, because there definitely seems to be a bug in the plplot > > code path for plotting text. I've just fixed it now. This gave > > problems for both pngcairo and pscairo for me. > > That is odd indeed that the valgrind run for me for pngcairo was fine, > but not for you. However, I have just run the same two tests again > with your change (at revision 12279) > > valgrind examples/c/x02c -dev pngcairo -o test.png -fam > valgrind examples/c/x02c -dev pngcairo -o test.png > > and all continues to be well for me. However, I still get > valgrind problems with pscairo, e.g., > > software@raven> valgrind --num-callers=40 \ > examples/c/x02c -dev pscairo -o test.ps > ==4666== Memcheck, a memory error detector > ==4666== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. > ==4666== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright > info > ==4666== Command: examples/c/x02c -dev pscairo -o test.ps > ==4666== > ==4666== Invalid read of size 4 > ==4666== at 0x74E2145: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74E3742: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74E3C20: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x75109C9: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74E09DD: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x7511067: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C668B: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C6ACC: cairo_surface_finish (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74A1AD3: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C668B: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C679C: cairo_surface_destroy (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x6E019A9: plD_tidy_cairo (in > /home/software/plplot_svn/HEAD/build_dir/drivers/cairo.so) > ==4666== by 0x4E4F0FE: c_plend1 (in > /home/software/plplot_svn/HEAD/build_dir/src/libplplotd.so.11.0.0) > ==4666== by 0x4E4F162: c_plend (in > /home/software/plplot_svn/HEAD/build_dir/src/libplplotd.so.11.0.0) > ==4666== by 0x400D8A: main (in > /home/software/plplot_svn/HEAD/build_dir/examples/c/x02c) > ==4666== Address 0xb8280b8 is 8 bytes inside a block of size 11 alloc'd > ==4666== at 0x4C28BED: malloc (vg_replace_malloc.c:263) > ==4666== by 0x74E21F1: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74E3742: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74E3C20: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x75109C9: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74E09DD: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x7511067: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C668B: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C6ACC: cairo_surface_finish (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74A1AD3: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C668B: ??? (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x74C679C: cairo_surface_destroy (in > /usr/lib/x86_64-linux-gnu/libcairo.so.2.11200.2) > ==4666== by 0x6E019A9: plD_tidy_cairo (in > /home/software/plplot_svn/HEAD/build_dir/drivers/cairo.so) > ==4666== by 0x4E4F0FE: c_plend1 (in > /home/software/plplot_svn/HEAD/build_dir/src/libplplotd.so.11.0.0) > ==4666== by 0x4E4F162: c_plend (in > /home/software/plplot_svn/HEAD/build_dir/src/libplplotd.so.11.0.0) > ==4666== by 0x400D8A: main (in > /home/software/plplot_svn/HEAD/build_dir/examples/c/x02c) > ==4666== > ==4666== > ==4666== HEAP SUMMARY: > ==4666== in use at exit: 387,975 bytes in 2,703 blocks > ==4666== total heap usage: 19,606 allocs, 16,903 frees, 4,869,363 > bytes allocated > ==4666== > ==4666== LEAK SUMMARY: > ==4666== definitely lost: 4,440 bytes in 8 blocks > ==4666== indirectly lost: 16,160 bytes in 503 blocks > ==4666== possibly lost: 56,513 bytes in 157 blocks > ==4666== still reachable: 310,862 bytes in 2,035 blocks > ==4666== suppressed: 0 bytes in 0 blocks > ==4666== Rerun with --leak-check=full to see details of leaked memory > ==4666== > ==4666== For counts of detected and suppressed errors, rerun with: -v > ==4666== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 7 from 7) > > If you cannot replicate that, then presumably the update between my > version (pango-1.30.0-1, cairo-1.12.2-2) and yours (or else an > improved valgrind suppressions file in your case) solved this problem, > and the issue is nothing for us to worry about. Alan, I don't see this warning at all. Instead, for both pscairo and pngcairo I see invalid reads inside pango_layout_get_pixel_size called from text_end_cairo. The block is allocated from within the same function. This, along with the fact you don't see the messages makes me suspect that this is a cairo / pango leak. I suspect yours is also a cairo related problem for similar reasons. It's just our different respective versions have different problems! There are still a number of smaller leaks in both our cases that may be worth some further checks by someone with a better grasp of cairo. Andrew |