lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YxJBh3wvAGol+Ekq@kernel.org>
Date:   Fri, 2 Sep 2022 14:46:47 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Anshuman Khandual <anshuman.khandual@....com>,
        Stephen Rothwell <sfr@...b.auug.org.au>
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        peterz@...radead.org, alexander.shishkin@...ux.intel.com,
        jolsa@...hat.com, mark.rutland@....com,
        Robin Murphy <robin.murphy@....com>,
        Suzuki Poulose <suzuki.poulose@....com>,
        James Clark <james.clark@....com>,
        Ingo Molnar <mingo@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Will Deacon <will@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH V7 6/8] perf/tools: Extend branch type classification

Em Fri, Sep 02, 2022 at 02:31:34PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Sep 01, 2022 at 10:37:24AM +0530, Anshuman Khandual escreveu:
> > On 8/31/22 02:41, Arnaldo Carvalho de Melo wrote:
> > > Strange:
> > > 
> > >   75     8.89 ubuntu:20.04-x-powerpc64el    : FAIL gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
> > >         inlined from 'branch_type_stat_display' at util/branch.c:152:4:
> > >     /usr/powerpc64le-linux-gnu/include/bits/stdio2.h:100:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
> > >       100 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
> > >           |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >       101 |    __va_arg_pack ());
> > >           |    ~~~~~~~~~~~~~~~~~
> > > 
> > 
> > Indeed. But this new code block here looks exact same like the previous and existing one
> > i.e with branch_new_name() and PERF_BR_NEW_MAX. The complain is that - '%8s' directive
> > argument is NULL. This warning might just be a false positive [1], because of a compiler
> > problem on powerpc64el ? But please do let me know if something needs to be changed here
> > to avoid this warning.
> > 
> > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036
> > 
> 
> So, I tried not returning NULL in the functions that are ultimately
> called, but that didn't help, so I'll try just disabling that specific
> warning for this specific file.

Got it building:

    23.68 ubuntu:20.04-x-powerpc64el    : Ok   powerpc64le-linux-gnu-gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
BUILD_TARBALL_HEAD=b0f700972d9d0c9b8e73f69ccf0e56d74c580d71

With:

>From b0f700972d9d0c9b8e73f69ccf0e56d74c580d71 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@...hat.com>
Date: Fri, 2 Sep 2022 14:35:26 -0300
Subject: [PATCH 1/1] perf build: Avoid false positive with
 -Werror=format-overflow= with gcc 10.3.0 on powerpc

When building with gcc 10.3.0 on powerpc this is happening:

   75     8.89 ubuntu:20.04-x-powerpc64el    : FAIL gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
         inlined from 'branch_type_stat_display' at util/branch.c:152:4:
     /usr/powerpc64le-linux-gnu/include/bits/stdio2.h:100:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
       100 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
           |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       101 |    __va_arg_pack ());
           |    ~~~~~~~~~~~~~~~~~

Looks related to:

  [10/11/12/13 Regression] false positive: directive argument is null [-Werror=format-overflow=]
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036

So lets disable this just for the util/branch.o file.

Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Anshuman Khandual <anshuman.khandual@....com>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: James Clark <james.clark@....com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Robin Murphy <robin.murphy@....com>
Cc: Suzuki Poulouse <suzuki.poulose@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Will Deacon <will@...nel.org>
Link: http://lore.kernel.org/lkml/YxI99uLvpgAZjm2r@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/Build | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 8fd6dc8de5210336..20a5524e88a04d44 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -223,6 +223,10 @@ CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
 # avoid compiler warnings in 32-bit mode
 CFLAGS_genelf_debug.o  += -Wno-packed
 
+# avoid false positive when building with gcc 10.3.0 on powerpc
+# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90036
+CFLAGS_branch.o += -Wno-format-overflow
+
 $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \
-- 
2.37.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ