Created attachment 59891 [details] zigtest.s Here is a cut&paste from a Debian bug (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576236), which still applies to 3.6.1: I've attached a .s file from a test program of unclear bugginess, which we tried to use valgrind to check. (It had fun and exciting strict aliasing issues.) In the course of debugging it, we found an error in valgrind --db-attach=yes. Steps to reproduce: 1) gcc zigtest.s -o zigtest 2) valgrind --db-attach=yes ./zigtest 3) When valgrind stops at an uninitialized value warning, say y to attach gdb. 4) "p/x $r8", which gave the value 0x30ecb1. 5) End gdb and let valgrind finish. 6) gdb ./zigtest 7) "break *0x0000000000400663" (the address of the instruction valgrind stopped at) 8) "run" 9) "p/x $r8", which gave the value 0xb1. 10) Use "disas" on main to confirm that the instruction right before the point valgrind stopped at runs "movzbl %r8b, %r8d", which should zero all but the low 8 bits of %r8. Thus, valgrind's value seems wrong. - Josh Triplett
(In reply to comment #0) > 9) "p/x $r8", which gave the value 0xb1. At least with the last svn version, and the gdbserver, when launching using: valgrind --vgdb=full --vex-iropt-precise-memory-exns=yes --vgdb-error=1 ./zigtest and attaching with gdb using: gdb ./zigtest tar rem | vgdb p /x $r8 $5 = 0xb1 (gdb) it gives the good value. (I suspect --vex-iropt-precise-memory-exns=yes should be sufficient for --db-attach=yes, but I recommend the use of the new Valgrind gdbserver :).
well svn isn't released yet, but yes I'm planning to package a snapshot at some point ;)
I understand that the comment 1 is ok as a solution, and that the debian bug has been closed. So, closing this one (re-open if not ok). Thanks