|
From: Christian P. <tr...@ge...> - 2005-07-22 19:49:15
|
On Friday 22 July 2005 10:50, Julian Seward wrote: > > Does someone know what exactly valgrind here is complaining about? > > Yes :-) > > You've probably hit one of the ultra-optimised strlen functions that > glibc provides. This is picking up chunks of string 8 bytes at a time > and doing some clever tricks with carry chain propagation so it doesn't > depend on the uninitialised bytes. Hence it's done an 8-byte read at > offset 16 of a malloc'd string of length 22. > > The memcheck in 2.4.0 doesn't complain about reading at partially > valid and partially invalid addresses, precisely to avoid reporting > this kind of error, but I thought that was sloppy and removed that > behaviour when rewriting it for Valgrind 3. > > It would help a lot if your /lib/ld-2.3.5.so had symbols, so that > V could possibly see it was calling strlen and reroute to a less > optimised version. Symbols would also make it possible to write > a decent suppression if Plan A failed. > > If you are a Gentoo insider .. please consider distributing non-stripped > /lib/ld-2.3.5.so as removing the symbols from it makes Valgrind's > life much more difficult. The same goes for glibc. That's not really funny, is it? It now have a version of glibc containing a= ll=20 symbols and now it doesn't show me all those warnings: $ valgrind -v --tool=3Dmemcheck --num-callers=3D32 .libs/lt-test=20 loading sandbox ### TLibrary(fileName=3Dlibsandbox.so) [...] sandbox loaded: libsandbox.so [...] =3D=3D12804=3D=3D =3D=3D12804=3D=3D ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 12 f= rom 4) =2D-12804-- =2D-12804-- supp: 3 index-not-intercepted-early-enough-HACK-1 =2D-12804-- supp: 1 strlen-not-intercepted-early-enough-HACK-4 =2D-12804-- supp: 1 strlen-not-intercepted-early-enough-HACK-3 =2D-12804-- supp: 7 dl_relocate_object =3D=3D12804=3D=3D malloc/free: in use at exit: 64 bytes in 2 blocks. =3D=3D12804=3D=3D malloc/free: 455 allocs, 453 frees, 105328 bytes allocate= d. [...] however, I get now some new messages I posted above. Are those "HACK"s somewhere documented? (they should be in the man-page e.g= =2E) Regards, Christian Parpart. =2D-=20 21:45:11 up 121 days, 10:52, 3 users, load average: 1.78, 2.48, 2.97 |