Skip to contentSkip to conversation

New: make qemu_x86_64_defconfig stopped working

Buildroot [email protected] 1 participant 8 messages May 30, 2022 – Jun 4, 2022

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=14826

            Bug ID: 14826
           Summary: make qemu_x86_64_defconfig stopped working
           Product: buildroot
           Version: 2022.02.2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Target Milestone: ---

Runnning

make qemu_x86_64_defconfig; make clean all

has stopped working for me. I get the following compilation error:

In file included from sigchain.c:3:
In function 'xrealloc',
inlined from 'sigchain_push.isra' at sigchain.c:26:2:
subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]

   56 |                 ret = realloc(ptr, size);
      |                       ^~~~~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to 'realloc' here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
subcmd-util.h:58:31: error: pointer may be used after 'realloc'
[-Werror=use-after-free]
   58 |                         ret = realloc(ptr, 1);
      |                               ^~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to 'realloc' here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s

In function 'xrealloc',
inlined from 'sigchain_push' at sigchain.c:26:2, inlined from 'sigchain_push_common' at sigchain.c:53:2:
subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]

   56 |                 ret = realloc(ptr, size);
      |                       ^~~~~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to 'realloc' here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~
subcmd-util.h:58:31: error: pointer may be used after 'realloc'
[-Werror=use-after-free]
   58 |                         ret = realloc(ptr, 1);
      |                               ^~~~~~~~~~~~~~~
subcmd-util.h:52:21: note: call to 'realloc' here
   52 |         void *ret = realloc(ptr, size);
      |                     ^~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

[Buildroot] [Bug 14826] make qemu_x86_64_defconfig stopped working

https://bugs.busybox.net/show_bug.cgi?id=14826

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Yann E. MORIN <[email protected]> --- Hello,

I am afraid I was not able to reproduce the failure.

From a clean checkout of git master (d590003), I did:

    make qemu_x86_64_defconfig
    make

And the build succeeded.

What version of Buildroot are you using?
What system are you building on?

Regards,
Yann E. MORIN.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

[Buildroot] [Bug 14826] make qemu_x86_64_defconfig stopped working

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14826

--- Comment #2 from [email protected] ---
I'd say that's good news. I just tried master and it doesn't work either.

A system update just broke something on my end. I'm using Arch on kernel 5.17.9.

Is there a recommended distro to use for building buildroot?

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

[Buildroot] [Bug 14826] make qemu_x86_64_defconfig stopped working

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14826

--- Comment #3 from [email protected] ---
I'd say that's good news. I just tried master and it doesn't work either.

A system update just broke something on my end. I'm using Arch on kernel 5.17.9.

Is there a recommended distro to use for building buildroot?

EDIT: **A system update probably broke something on my end

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

[Buildroot] [Bug 14826] make qemu_x86_64_defconfig stopped working

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14826

--- Comment #4 from Yann E. MORIN <[email protected]> --- Hello,

This issue is caused by a gcc-12 extra check about use-after-free, which has been fixed in the kernel with:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=52a9dab6d892763b2a8334a568bd4e2c1a6fde66

You hit this issue because Archlinux is now using gcc-12.1.0 as the default compiler, and because the kernel uses -Werror to build that host tool.

So, either update your kernel to one that has the fix, or backport it yourself, or downgrade your compiler to a (slightly) older one.

Regards,
Yann E. MORIN.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

[Buildroot] [Bug 14826] make qemu_x86_64_defconfig stopped working

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14826

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |ASSIGNED
           Assignee|[email protected] |[email protected]
                   |.org                        |

--- Comment #5 from Yann E. MORIN <[email protected]> --- Created attachment 9316
--> https://bugs.busybox.net/attachment.cgi?id=9316&action=edit
linux: don't build host tools with -Werror

Hello,

Can you please try this patch, and report the result?

If that works for you, I'll submit a proper patch later.

Regards,
Yann E. MORIN.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

[Buildroot] [Bug 14826] make qemu_x86_64_defconfig stopped working

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14826

--- Comment #6 from [email protected] ---
Thanks for figuring this out! I can confirm that the patch works on master, commit eb5e2d2d43c5c0f71ae8243081625261de2cd134.

Bit of a tangential question: is there an easy way to see what kernel version commit 52a9dab6d892763b2a8334a568bd4e2c1a6fde66 would have made it into?

Thanks again!

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

[Buildroot] [Bug 14826] make qemu_x86_64_defconfig stopped working

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14826

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Yann E. MORIN <[email protected]> --- All,

Thanks for the report. We believe this has now been fixed with commit baa55a4e26e6 (linux: disable -Werror when building host tools) that has just been applied to master.

Regards,
Yann E. MORIN.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot