On 01/26/2012 12:25 PM, Julian Seward wrote: > On Thursday, January 26, 2012, David Henningsson wrote: >> Hi, >> >> I'm trying to run PulseAudio under valgrind, and I think valgrind is >> reporting a false positive; i e, it reports "Conditional jump or move >> depend on uninitialised value(s)" where in fact the value seems to be >> perfectly initialised and correct. >> >> I've tracked it down to function snd_ctl_hw_elem_tlv in alsa-lib [1]. As >> you can see, if the ioctl command is SNDRV_CTL_IOCTL_TLV_READ, the >> kernel writes X bytes into output, where X = 4 * sizeof(unsigned int) + >> the number in output[3] (if output is an array of unsigned ints). >> >> I'm a little unsure of how to proceed with this? > > You need to mess with PRE(sys_ioctl) and POST(sys_ioctl) in > syswrap-linux.c. The PRE wrapper needs to check that the > written (by the kernel) area is addressible, using PRE_MEM_WRITE. > The POST wrapper needs to mark the data written after the > call using POST_MEM_WRITE. > > See top level README_MISSING_SYSCALL_OR_IOCTL for more details. > Unfortunately both PRE(sys_ioctl) and POST(sys_ioctl) are not > entirely straightforward, due to the vast number and variety of > ioctls available.
I gave this a shot, and I was finally able to write a POST(sys_ioctl), but I had to work around something strange that I could use some advice on: In the call to POST(sys_ioctl), ARG2 is a 64 bit value, which for every call except mine had the upper 32 bits set to zero. For my particular call, ARG2 was set to 0xFFFFFFFFC008551A, so it would not match my ioctl of C008551A in the following giant switch/case. Before I submit a patch for SNDRV_CTL_IOCTL_TLV_READ, I assume this needs to be generically resolved somehow? This was with the 3.7.0 release of Valgrind, btw. -- David Henningsson, Canonical Ltd. http://launchpad.net/~diwic ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users