From patchwork Mon Jun 25 14:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patsy Franklin X-Patchwork-Id: 934358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-93574-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="b4etajCu"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DrsG3Svtz9ry1 for ; Tue, 26 Jun 2018 00:19:30 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=IKNf5kvB7brobfLbrJ3VWtos87j9b coe2nGRtdKMcXLHHPfEUI1DgpglfCtMInZltS0jFMmZGVbQFrW2ZMLZwCSrkm8EM zJA37EPwj3U8SACu0qlHOjlSVs8P5UACayGdQKsiDljwuxcqrjawRwKYGLsKfYQ4 UvnKu05Jvofij0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=lCgw4CsfswRRsj9FvIhio4Z1fwU=; b=b4e tajCuPyEcYEJhXcbFpZ6dA+27clWh/VDocG3e7dUOBlOebSMN1Kq7zD1o3DtxrV/ hh0xRokQ8fggtnbUo84vbkr5fbXUUha2WTSxyjMJqIzLwL+w/trgmUGznuLPwzr+ Kh2fT6FJl00GH+uGALVMTBOUNocQKMZL7LlgBgGo= Received: (qmail 129756 invoked by alias); 25 Jun 2018 14:19:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 129283 invoked by uid 89); 25 Jun 2018 14:19:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mail-io0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3VU50fBk09lx62pSOzcC5iwS9504vvLMqqGAh9s51fg=; b=ohKKevoayogcgez1SVaYOpJ8g/Bg5fk2NCG4PD1UMAtHaZ7xiluga8UKBBINWpm1H6 vflOx7xz1/fHNCJueocHd32TgcwdgksS0P+pvFwwZ4YlOmZSWdo9LhVUWW8Tw7CaxVSG y2pCuwjpUga67gfJVyONaytv9p7jM49ym0z3j9jfdST0o9ts8AJPDSwOHH/0szET3tdP BSPCdo+aoncGD28HDmTJ3W68kkMfxQZVsHkgXVMCyMMO8VzeEo/fZq23QxL/hCCh8zSu T1d7vbsrqjPTV9ERHnXxX2Gisr37ECNyzjjwsVm0F0UO3bis2mEA0/2gCbvB8iu5YfEU 8Ayg== X-Gm-Message-State: APt69E0OTuIIwXOU5tvMxfquUQLOZQqc2+uszr6owCRRWqhWCo7o632C km6PRloMkdO29rGr9BnB8Igkyx/16SkXM1XGO6bhb3BI8LY= X-Google-Smtp-Source: ADUXVKIP+YFJcx1K/yyCfgV9Y4HQqIZSzjkUjwyGOn8Q63bbGbrtZRvqNTPvNSKHLto42VAIQrh3Lxe/1sPFI2C2QrA= X-Received: by 2002:a6b:b5c1:: with SMTP id e184-v6mr10689159iof.267.1529936360572; Mon, 25 Jun 2018 07:19:20 -0700 (PDT) MIME-Version: 1.0 From: Patsy Franklin Date: Mon, 25 Jun 2018 10:18:39 -0400 Message-ID: Subject: [PATCH] Initialize pad outside the conditional to prevent uninitialized data warnings. To: GNU C Library Notes: In sem_open.c, pad was only initialized when __HAVE_64B_ATOMICS was not true causing valgrind to warn about uninitialized data on some arches. This patch moves the initialization of pad outside of the conditional. Prior to this change, valgrind warned about unitialized bytes on ppc64, ppc64le, s390x, and aarch64. Tested on ppc64le with no regressions. Used valgrind to confirm that the uninitialized bytes warning was fixed. 2018-06-22 Patsy Franklin * nptl/sem_open.c [!__HAVE_64B_ATOMICS] (sem_open): Don't update pad. (sem_open): Set sem.newsem.pad to zero for valgrind. diff --git a/nptl/sem_open.c b/nptl/sem_open.c index 1d7f142134..c5389f6873 100644 --- a/nptl/sem_open.c +++ b/nptl/sem_open.c @@ -215,10 +215,11 @@ sem_open (const char *name, int oflag, ...) sem.newsem.data = value; #else sem.newsem.value = value << SEM_VALUE_SHIFT; - /* pad is used as a mutex on pre-v9 sparc and ignored otherwise. */ - sem.newsem.pad = 0; sem.newsem.nwaiters = 0; #endif + /* pad is used as a mutex on pre-v9 sparc and ignored otherwise. */ + sem.newsem.pad = 0; + /* This always is a shared semaphore. */ sem.newsem.private = FUTEX_SHARED;