linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hongyu Xie <xiehongyu1@kylinos.cn>
To: sfr@canb.auug.org.au
Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
	Hongyu Xie <xiehongyu1@kylinos.cn>
Subject: Report a compile err
Date: Mon, 30 Jan 2023 15:30:12 +0800	[thread overview]
Message-ID: <20230130073012.374172-1-xiehongyu1@kylinos.cn> (raw)
In-Reply-To: <20230130165442.29f65a51@canb.auug.org.au>

source code:
  https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
base:
  ae0c77e1bc6963c67c6c09e8c72959fcb1ed8d5f
config tested:
  x86_64_defconfig
  defconfig(arm64)
toolchain:
  gcc version 10.4.0 (Ubuntu 10.4.0-4ubuntu1~22.04)
cross compile toolchain:
  gcc version 10.4.0 (Ubuntu 10.4.0-4ubuntu1~22.04)

reproduce compile err:
  CONFIG_WERROR=y && CONFIG_PRINTK=n && CONFIG_UBSAN_ALIGNMENT=y &&
  CONFIG_UBSAN_SANITIZE_ALL=y

compile err log:
kernel/printk/printk.c: In function ‘console_flush_all’:
kernel/printk/printk.c:2845:17: error: array subscript 0 is outside array
bounds of ‘char[0]’ [-Werror=array-bounds]
 2845 |  char *outbuf = &pbufs.outbuf[0];
      |                 ^~~~~~~~~~~~~~~~
In file included from kernel/printk/printk.c:61:
kernel/printk/internal.h:87:7: note: while referencing ‘outbuf’
   87 |  char outbuf[PRINTK_MESSAGE_MAX];
      |       ^~~~~~
kernel/printk/printk.c:2842:31: note: defined here ‘pbufs’
 2842 |  static struct printk_buffers pbufs;
      |                               ^~~~~

I applied the way 5a41237ad1d4 in mainline did for gcc 10, problem goes
away. I'm guessing this is a gcc bug.

  reply	other threads:[~2023-01-30  7:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  5:54 linux-next: Tree for Jan 30 Stephen Rothwell
2023-01-30  7:30 ` Hongyu Xie [this message]
2023-01-30  8:10   ` Report a compile err Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230130073012.374172-1-xiehongyu1@kylinos.cn \
    --to=xiehongyu1@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).