Skip to contentSkip to conversation

linux-next: build failure after merge of the perf tree

DISCUSSION Stephen Rothwell 3 participants 7 messages Aug 30, 2022 – Sep 8, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the perf tree, today's linux-next build (native perf) failed like this:

In file included from /usr/include/stdio.h:866,
from /home/sfr/next/next/tools/perf/util/branch.h:9,
from util/branch.c:2:
In function 'fprintf',
inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]

  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Presumably caused by commit

9781e500dcb8 ("perf branch: Extend branch type classification")

"native" here is PowerPC64 LE.

$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0

I have used the perf tree from next-20220830 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hello Stephen,

This seems to be the same problem as pointed by ACME on the patch series [1]. Could this be a compiler false positive ? Because the new code block is exact same like the existing one. This warning seems to only occurs on powerpc64el platform, but not on others.

[1] https://lore.kernel.org/lkml/[email protected]/

- Anshuman

Quoted 27 lines · Stephen Rothwell

Hi all,

After merging the perf tree, today's linux-next build (native perf) failed like this:

In file included from /usr/include/stdio.h:866,
from /home/sfr/next/next/tools/perf/util/branch.h:9,
from util/branch.c:2:
In function 'fprintf',
inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]

  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Presumably caused by commit

9781e500dcb8 ("perf branch: Extend branch type classification")

"native" here is PowerPC64 LE.

$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0

I have used the perf tree from next-20220830 for today.

#2 lore raw
In reply to Stephen Rothwell

Hi all,

Quoted 18 lines · On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <[email protected]>…

After merging the perf tree, today's linux-next build (native perf) failed like this:

In file included from /usr/include/stdio.h:866,
from /home/sfr/next/next/tools/perf/util/branch.h:9,
from util/branch.c:2:
In function 'fprintf',
inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]

  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Presumably caused by commit

Quoted 7 lines

9781e500dcb8 ("perf branch: Extend branch type classification")

"native" here is PowerPC64 LE.

$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0

I have used the perf tree from next-20220830 for today.

I am still seeing this build failure.

Signature · 2 lines
Cheers,
Stephen Rothwell
#3 lore raw
Quoted 23 lines · Stephen Rothwell

Hi all,

Quoted 20 lines · On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <[email protected]>…

After merging the perf tree, today's linux-next build (native perf) failed like this:

In file included from /usr/include/stdio.h:866,
from /home/sfr/next/next/tools/perf/util/branch.h:9,
from util/branch.c:2:
In function 'fprintf',
inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]

  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Presumably caused by commit

9781e500dcb8 ("perf branch: Extend branch type classification")

Quoted 7 lines
Quoted 5 lines

"native" here is PowerPC64 LE.

$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0

I have used the perf tree from next-20220830 for today.

I am still seeing this build failure.

But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow compiler option for the file util/branch.c ?

https://lore.kernel.org/all/[email protected]/

- Anshuman

#4 lore raw

Hi all,

Quoted 29 lines · On Wed, 7 Sep 2022 08:01:34 +0530 Anshuman Khandual…
Quoted 27 lines · Stephen Rothwell

Hi all,

Quoted 24 lines · On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <[email protected]>…

After merging the perf tree, today's linux-next build (native perf) failed like this:

In file included from /usr/include/stdio.h:866,
from /home/sfr/next/next/tools/perf/util/branch.h:9,
from util/branch.c:2:
In function 'fprintf',
inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]

  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Presumably caused by commit

9781e500dcb8 ("perf branch: Extend branch type classification")

"native" here is PowerPC64 LE.

$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I have used the perf tree from next-20220830 for today.

I am still seeing this build failure.

But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow compiler option for the file util/branch.c ?

https://lore.kernel.org/all/[email protected]/

No, I expected a fix to be in the perf tree ...

Also note that the following fixes the problem for me:

tools/perf/util/branch.c +2 -1
index d40776c44b06..b7b898f2872e 100644
@@ -88,7 +88,8 @@ const char *branch_type_name(int type)
 		"ERET",
 		"IRQ",
 		"SERROR",
-		"NO_TX"
+		"NO_TX",
+		""
 	};
 
 	if (type >= 0 && type < PERF_BR_MAX)

PERF_BR_MAX has been increased by one (when PERF_BR_EXTEND_ABI was added), but a new string has not been added to the array ...

Signature · 2 lines
Cheers,
Stephen Rothwell
#5 lore raw
Quoted 50 lines · Stephen Rothwell

Hi all,

Quoted 29 lines · On Wed, 7 Sep 2022 08:01:34 +0530 Anshuman Khandual…
Quoted 27 lines · Stephen Rothwell

Hi all,

Quoted 24 lines · On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <[email protected]>…

After merging the perf tree, today's linux-next build (native perf) failed like this:

In file included from /usr/include/stdio.h:866,
from /home/sfr/next/next/tools/perf/util/branch.h:9,
from util/branch.c:2:
In function 'fprintf',
inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]

  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Presumably caused by commit

9781e500dcb8 ("perf branch: Extend branch type classification")

"native" here is PowerPC64 LE.

$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I have used the perf tree from next-20220830 for today.

I am still seeing this build failure.

But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow compiler option for the file util/branch.c ?

https://lore.kernel.org/all/[email protected]/

No, I expected a fix to be in the perf tree ...

Also note that the following fixes the problem for me:

tools/perf/util/branch.c +0 -0
index d40776c44b06..b7b898f2872e 100644

tools/perf/util/branch.c const char *branch_type_name(int type) · line 95

Quoted 9 lines
tools/perf/util/branch.c +2 -1
@@ -88,7 +88,8 @@ const char *branch_type_name(int type)
 		"ERET",
 		"IRQ",
 		"SERROR",
-		"NO_TX"
+		"NO_TX",
+		""
 	};
 
 	if (type >= 0 && type < PERF_BR_MAX)

This looks right, makes sense.

Quoted 4 lines

PERF_BR_MAX has been increased by one (when PERF_BR_EXTEND_ABI was added), but a new string has not been added to the array ...

Right, even though new branch_new_names[] array gets queried on when type value is PERF_BR_EXTEND_ABI, branch_names[] should still contain an empty string "" just to match the now incremented PERF_BR_MAX which extends the array size as well. I guess the compiler detects this mismatch here and just complains about it.

Hello Arnaldo,

As adding empty string to the array solves the build problem, I guess we should fold this fix instead, rather than trying to drop the compiler option itself, as discussed earlier.

The above fix should be folded into the following commit

9781e500dcb8 ("perf branch: Extend branch type classification")

in the following perf tree - branch.

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git (perf/core)

- Anshuman

#6 lore raw

Em Wed, Sep 07, 2022 at 09:52:48AM +0530, Anshuman Khandual escreveu:

Quoted 76 lines · Stephen Rothwell
Quoted 50 lines

Hi all,

Quoted 29 lines · On Wed, 7 Sep 2022 08:01:34 +0530 Anshuman Khandual…
Quoted 27 lines · Stephen Rothwell

Hi all,

Quoted 24 lines · On Wed, 31 Aug 2022 08:34:52 +1000 Stephen Rothwell <[email protected]>…

After merging the perf tree, today's linux-next build (native perf) failed like this:

In file included from /usr/include/stdio.h:866,
from /home/sfr/next/next/tools/perf/util/branch.h:9,
from util/branch.c:2:
In function 'fprintf',
inlined from 'branch_type_stat_display' at util/branch.c:152:4:
/usr/include/powerpc64le-linux-gnu/bits/stdio2.h:105:10: error: '%8s' directive argument is null [-Werror=format-overflow=]

  105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |                         __va_arg_pack ());
      |                         ~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Presumably caused by commit

9781e500dcb8 ("perf branch: Extend branch type classification")

"native" here is PowerPC64 LE.

$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I have used the perf tree from next-20220830 for today.

I am still seeing this build failure.

But did you apply the fix patch from Arnaldo that removes -Wno-format-overflow compiler option for the file util/branch.c ?

https://lore.kernel.org/all/[email protected]/

No, I expected a fix to be in the perf tree ...

Also note that the following fixes the problem for me:

tools/perf/util/branch.c +0 -0
index d40776c44b06..b7b898f2872e 100644

tools/perf/util/branch.c const char *branch_type_name(int type) · line 95

Quoted 9 lines
tools/perf/util/branch.c +2 -1
@@ -88,7 +88,8 @@ const char *branch_type_name(int type)
 		"ERET",
 		"IRQ",
 		"SERROR",
-		"NO_TX"
+		"NO_TX",
+		""
 	};
 
 	if (type >= 0 && type < PERF_BR_MAX)

This looks right, makes sense.

Quoted 4 lines

PERF_BR_MAX has been increased by one (when PERF_BR_EXTEND_ABI was added), but a new string has not been added to the array ...

Right, even though new branch_new_names[] array gets queried on when type value is PERF_BR_EXTEND_ABI, branch_names[] should still contain an empty string "" just to match the now incremented PERF_BR_MAX which extends the array size as well. I guess the compiler detects this mismatch here and just complains about it.

Quoted 5 lines

Hello Arnaldo,

As adding empty string to the array solves the build problem, I guess we should fold this fix instead, rather than trying to drop the compiler option itself, as discussed earlier.

I'll do it, and even force push perf/core so that this problem doesn't get into the bisection history upstream.

- Arnaldo

Quoted 9 lines

The above fix should be folded into the following commit

9781e500dcb8 ("perf branch: Extend branch type classification")

in the following perf tree - branch.

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git (perf/core)

- Anshuman

Signature · 1 line
- Arnaldo