From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jean-Christophe Dubois <jcd@tribudubois.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] initialize struct sigevent before timer_create
Date: Wed, 20 May 2009 16:10:05 -0300 [thread overview]
Message-ID: <20090520191005.GB28898@amt.cnet> (raw)
In-Reply-To: <200905171841.16655.jcd@tribudubois.net>
Looks good.
On Sun, May 17, 2009 at 06:41:16PM +0200, Jean-Christophe Dubois wrote:
> When qemu is run under valgrind, valgrind shows the following output
> on exit:
>
> ==3648== 1 errors in context 2 of 2:
> ==3648== Syscall param timer_create(evp) points to uninitialised byte(s)
> ==3648== at 0x54E936A: timer_create (in /lib/librt-2.9.so)
> ==3648== by 0x405DCF: dynticks_start_timer (vl.c:1549)
> ==3648== by 0x40A966: main (vl.c:1726)
> ==3648== Address 0x7fefffb34 is on thread 1's stack
> ==3648== Uninitialised value was created by a stack allocation
> ==3648== at 0x405D60: dynticks_start_timer (vl.c:1534)
>
> This patch is a simple fix to remove this potential problem.
>
> Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
>
> --- qemu.org/vl.c 2009-05-16 17:57:27.000000000 +0200
> +++ qemu/vl.c 2009-05-16 23:06:52.000000000 +0200
> @@ -1542,6 +1542,11 @@
>
> sigaction(SIGALRM, &act, NULL);
>
> + /*
> + * Initialize ev struct to 0 to avoid valgrind complaining
> + * about uninitialized data in timer_create call
> + */
> + memset(&ev, 0, sizeof(ev));
> ev.sigev_value.sival_int = 0;
> ev.sigev_notify = SIGEV_SIGNAL;
> ev.sigev_signo = SIGALRM;
>
prev parent reply other threads:[~2009-05-20 19:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-17 16:41 [Qemu-devel] [PATCH] initialize struct sigevent before timer_create Jean-Christophe Dubois
2009-05-20 19:10 ` Marcelo Tosatti [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090520191005.GB28898@amt.cnet \
--to=mtosatti@redhat.com \
--cc=jcd@tribudubois.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).