From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles \"Buck\" Krasic" Subject: valgrind and alsa Date: Thu, 24 Feb 2005 00:46:58 -0800 Message-ID: <421D9482.3090807@cs.ubc.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050000050302090908060605" Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org This is a multi-part message in MIME format. --------------050000050302090908060605 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I'm new to alsa development. I have just implemented native alsa support in an application I've developed (a streaming video system). When checking my application with valgrind, valgrin generates numerous alsa related warnings. They all seem to originate from a single problem in my initial call to snd_pcm_writei. Basically valgrind doesn't like that alsa is making an ioctl with unitialized data. The following patch fixed the problem for me, it's just a one liner add the missing initializtion. Cheers, -- Buck --------------050000050302090908060605 Content-Type: text/x-patch; name="alsalib.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="alsalib.patch" --- pcm_hw.c-old 2005-02-24 00:36:02.906722553 -0800 +++ pcm_hw.c 2005-02-24 00:35:37.390399025 -0800 @@ -664,6 +664,7 @@ struct sndrv_xferi xferi; xferi.buf = (char*) buffer; xferi.frames = size; + xferi.result = 0; err = ioctl(fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &xferi); err = err >= 0 ? sync_ptr(hw, SNDRV_PCM_SYNC_PTR_APPL) : -errno; #ifdef DEBUG_RW --------------050000050302090908060605-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click