mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Liu, Yujie" <yujie.liu@intel.com>
To: "viresh.kumar@linaro.org" <viresh.kumar@linaro.org>, lkp <lkp@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>
Subject: Re: drivers/opp/debugfs.c:48:54: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8
Date: Wed, 21 Feb 2024 06:01:54 +0000	[thread overview]
Message-ID: <b41c6cdb78c96d5f4a909fc13c253ef0d8576c86.camel@intel.com> (raw)
In-Reply-To: <20240214055836.c5i3zmkhdllldwon@vireshk-i7>

Hi Viresh,

On Wed, 2024-02-14 at 11:28 +0530, Viresh Kumar wrote:
> On 14-02-24, 13:43, kernel test robot wrote:
> > Hi Viresh,
> > 
> > FYI, the error/warning still remains.
> > 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   7e90b5c295ec1e47c8ad865429f046970c549a66
> > commit: 46f48aca2e5aef3f430e95d1a5fb68227ec8ec85 OPP: Fix missing debugfs supply directory for OPPs
> > date:   5 years ago
> > config: x86_64-buildonly-randconfig-001-20231012 (https://download.01.org/0day-ci/archive/20240214/202402141313.81ltVF5g-lkp@intel.com/config)
> > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240214/202402141313.81ltVF5g-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Closes: https://lore.kernel.org/oe-kbuild-all/202402141313.81ltVF5g-lkp@intel.com/
> 
> I have informed this earlier too, this report is incorrect and applies
> to a very old commit.

Really sorry for not responding timely to the questions in the
following reports:

[1] https://lore.kernel.org/all/202311061847.BOtfUmbQ-lkp@intel.com/
[2] https://lore.kernel.org/all/202312170608.s9xI4TQb-lkp@intel.com/

We see that this still happens on the latest mainline rc regardless of
x86_64 or arm64 arch. Please note that this is a "W=1" warning. In our
tests, it can be reproduced with gcc-12 and gcc-13, but not with other
versions of gcc.

$ git checkout v6.8-rc5 
HEAD is now at b401b621758e4 Linux 6.8-rc5

$ wget https://download.01.org/0day-ci/archive/20240214/202402141313.81ltVF5g-lkp@intel.com/config -O .config

$ make CC=gcc-12 W=1 -j72 ARCH=x86_64 olddefconfig
$ make CC=gcc-12 W=1 -j72 ARCH=x86_64 drivers/opp/debugfs.o
...
drivers/opp/debugfs.c: In function 'opp_debug_create_one':
drivers/opp/debugfs.c:105:54: error: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
  105 |                 snprintf(name, sizeof(name), "supply-%d", i);
      |                                                      ^~
In function 'opp_debug_create_supplies',
    inlined from 'opp_debug_create_one' at drivers/opp/debugfs.c:163:2:
drivers/opp/debugfs.c:105:46: note: directive argument in the range [-2147483644, 2147483646]
  105 |                 snprintf(name, sizeof(name), "supply-%d", i);
      |                                              ^~~~~~~~~~~
drivers/opp/debugfs.c:105:17: note: 'snprintf' output between 9 and 19 bytes into a destination of size 15
  105 |                 snprintf(name, sizeof(name), "supply-%d", i);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

$ make CROSS_COMPILE=aarch64-linux-gnu- CC=aarch64-linux-gnu-gcc-12 W=1 -j72 ARCH=arm64 olddefconfig
$ make CROSS_COMPILE=aarch64-linux-gnu- CC=aarch64-linux-gnu-gcc-12 W=1 -j72 ARCH=arm64 drivers/opp/debugfs.o
...
drivers/opp/debugfs.c: In function 'opp_debug_create_one':
drivers/opp/debugfs.c:105:54: error: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=]
  105 |                 snprintf(name, sizeof(name), "supply-%d", i);
      |                                                      ^~
In function 'opp_debug_create_supplies',
    inlined from 'opp_debug_create_one' at drivers/opp/debugfs.c:163:2:
drivers/opp/debugfs.c:105:46: note: directive argument in the range [-2147483644, 2147483646]
  105 |                 snprintf(name, sizeof(name), "supply-%d", i);
      |                                              ^~~~~~~~~~~
drivers/opp/debugfs.c:105:17: note: 'snprintf' output between 9 and 19 bytes into a destination of size 15
  105 |                 snprintf(name, sizeof(name), "supply-%d", i);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We are not sure if this is a real problem or a compiler shortcoming
that gcc calculates an incorrect size. Might need gcc experts to take a
look.

Regardless, we will configure the bot to ignore this issue to avoid
further bothering you with duplicate reports.

Best Regards,
Yujie

  reply	other threads:[~2024-02-21  6:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  5:43 kernel test robot
2024-02-14  5:58 ` Viresh Kumar
2024-02-21  6:01   ` Liu, Yujie [this message]
2024-03-04  6:54     ` Viresh Kumar
2024-03-04  8:30       ` Yujie Liu
2024-03-04 11:21         ` Viresh Kumar
2024-03-05  5:37           ` Yujie Liu
2024-03-05  6:10             ` Viresh Kumar
  -- strict thread matches above, loose matches on Subject: below --
2023-12-16 22:23 kernel test robot
2023-12-18  6:10 ` Viresh Kumar
2023-11-06 10:41 kernel test robot
2023-11-08  6:13 ` Viresh Kumar

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=b41c6cdb78c96d5f4a909fc13c253ef0d8576c86.camel@intel.com \
    --to=yujie.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=viresh.kumar@linaro.org \
    /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

all inboxes | Powered by JetHome®