From patchwork Wed Aug 10 00:31:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12940080 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85229C25B06 for ; Wed, 10 Aug 2022 00:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiHJAcf (ORCPT ); Tue, 9 Aug 2022 20:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiHJAce (ORCPT ); Tue, 9 Aug 2022 20:32:34 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBB2574DC4 for ; Tue, 9 Aug 2022 17:32:32 -0700 (PDT) Received: from integral2.. (unknown [180.246.144.41]) by gnuweeb.org (Postfix) with ESMTPSA id 8E6FD80912; Wed, 10 Aug 2022 00:32:30 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1660091552; bh=C+Gye3EZvIlcGxNj4W91LXbelCn3L8bXgOsHnXKjJU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UAqdgiGfHa5YB4d6CoDHw57wmBfqwhGXBEUM+Fj5u+PqlMvTqqLjr27CAwdV0N9eN 7cFBMzSWSYATLotjQ63jcktuKO/M5jNRlV8OTIDJ8WHLbQqGmjl7FJfZow9U3ArLVz iZdTM/v3JZX7ACXHseCodOlASFdPK5CHXEbPJp+/Bpas0L9fPdL+eLoHa5aLGobusu +1L4MToi548jwl1tsoJ+h8UpSGyxy7/cy/PIc/qLfvuqMYBj16JPQ4g+fKjPJUTCJp vJIHHWgY9z2iVA+8nsJQXD2m13dcEd9yhbzjqx7O+bjGxn47T+1brc0vaLSJYnzBaz 9EjAm4dLj+yPw== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Vitaly Chikunov , Fernanda Ma'rouf , Kanna Scarlet , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 02/10] test/eeed8b54e0df: Initialize the `malloc()`ed buffer before `write()` Date: Wed, 10 Aug 2022 07:31:51 +0700 Message-Id: <20220810002735.2260172-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220810002735.2260172-1-ammar.faizi@intel.com> References: <20220810002735.2260172-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi ... to avoid valgrind's complaint: ==3054187== Syscall param write(buf) points to uninitialised byte(s) ==3054187== at 0x4958E63: write (write.c:26) ==3054187== by 0x109283: get_file_fd (eeed8b54e0df.c:36) ==3054187== by 0x109283: main (eeed8b54e0df.c:85) ==3054187== Address 0x4a63080 is 0 bytes inside a block of size 4,096 alloc'd ==3054187== at 0x484479B: malloc (vg_replace_malloc.c:380) ==3054187== by 0x109698: t_malloc (helpers.c:22) ==3054187== by 0x109270: get_file_fd (eeed8b54e0df.c:35) ==3054187== by 0x109270: main (eeed8b54e0df.c:85) Link: https://github.com/axboe/liburing/issues/640 Reported-by: Vitaly Chikunov Signed-off-by: Ammar Faizi --- test/eeed8b54e0df.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/eeed8b54e0df.c b/test/eeed8b54e0df.c index b388b12..b8149f2 100644 --- a/test/eeed8b54e0df.c +++ b/test/eeed8b54e0df.c @@ -33,6 +33,7 @@ static int get_file_fd(void) } buf = t_malloc(BLOCK); + memset(buf, 0, BLOCK); ret = write(fd, buf, BLOCK); if (ret != BLOCK) { if (ret < 0)