All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Miquel Sabaté Solà" <mikisabate@gmail.com>
To: kernel test robot <lkp@intel.com>
Cc: linux-riscv@lists.infradead.org,  oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org,  pjw@kernel.org,
	 palmer@dabbelt.com, alex@ghiti.fr,  wangyuli@uniontech.com,
	 chenhuacai@kernel.org
Subject: Re: [PATCH] riscv: kgdb: Prefer strscpy instead of strcpy
Date: Tue, 16 Sep 2025 14:39:34 +0200	[thread overview]
Message-ID: <68c95a87.050a0220.362e95.5aa5@mx.google.com> (raw)
In-Reply-To: <202509161619.eJeLbfU0-lkp@intel.com> (kernel test robot's message of "Tue, 16 Sep 2025 17:10:50 +0800")


[-- Attachment #1.1: Type: text/plain, Size: 5293 bytes --]

Hello,

kernel test robot @ 2025-09-16 17:10 +08:

> Hi Miquel,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on linus/master]
> [also build test ERROR on v6.17-rc6 next-20250915]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Miquel-Sabat-Sol/riscv-kgdb-Prefer-strscpy-instead-of-strcpy/20250916-040750
> base:   linus/master
> patch link:    https://lore.kernel.org/r/20250915200644.200498-1-mikisabate%40gmail.com
> patch subject: [PATCH] riscv: kgdb: Prefer strscpy instead of strcpy
> config: riscv-randconfig-002-20250916 (https://download.01.org/0day-ci/archive/20250916/202509161619.eJeLbfU0-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 10.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250916/202509161619.eJeLbfU0-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/202509161619.eJeLbfU0-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>    In file included from include/linux/ptrace.h:5,
>                     from arch/riscv/kernel/kgdb.c:6:
>    arch/riscv/kernel/kgdb.c: In function 'kgdb_arch_handle_qxfer_pkt':
>>> include/linux/compiler.h:197:67: error: static assertion failed: "must be array"
>      197 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
>          |                                                                   ^~~~~~~~~~~~~~
>    include/linux/compiler.h:202:28: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>      202 | #define __must_be_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
>          |                            ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/string.h:80:40: note: in expansion of macro '__must_be_array'
>       80 |  sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) + \
>          |                                        ^~~~~~~~~~~~~~~
>    include/linux/args.h:25:24: note: in expansion of macro '__strscpy0'
>       25 | #define __CONCAT(a, b) a ## b
>          |                        ^
>    include/linux/args.h:26:27: note: in expansion of macro '__CONCAT'
>       26 | #define CONCATENATE(a, b) __CONCAT(a, b)
>          |                           ^~~~~~~~
>    include/linux/string.h:114:2: note: in expansion of macro 'CONCATENATE'
>      114 |  CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
>          |  ^~~~~~~~~~~
>    arch/riscv/kernel/kgdb.c:268:3: note: in expansion of macro 'strscpy'
>      268 |   strscpy(remcom_out_buffer, riscv_gdb_stub_target_desc);
>          |   ^~~~~~~
>>> include/linux/compiler.h:197:67: error: static assertion failed: "must be array"
>      197 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
>          |                                                                   ^~~~~~~~~~~~~~
>    include/linux/compiler.h:202:28: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>      202 | #define __must_be_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
>          |                            ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/string.h:80:40: note: in expansion of macro '__must_be_array'
>       80 |  sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) + \
>          |                                        ^~~~~~~~~~~~~~~
>    include/linux/args.h:25:24: note: in expansion of macro '__strscpy0'
>       25 | #define __CONCAT(a, b) a ## b
>          |                        ^
>    include/linux/args.h:26:27: note: in expansion of macro '__CONCAT'
>       26 | #define CONCATENATE(a, b) __CONCAT(a, b)
>          |                           ^~~~~~~~
>    include/linux/string.h:114:2: note: in expansion of macro 'CONCATENATE'
>      114 |  CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
>          |  ^~~~~~~~~~~
>    arch/riscv/kernel/kgdb.c:271:3: note: in expansion of macro 'strscpy'
>      271 |   strscpy(remcom_out_buffer, riscv_gdb_stub_cpuxml);
>          |   ^~~~~~~
>
>
> vim +197 include/linux/compiler.h
>
> 230fa253df6352 Christian Borntraeger 2014-11-25  193
> cb7380de9e4cbc Kees Cook             2025-02-05  194  #ifdef __CHECKER__
> 243c90e917f5cf Vincent Mailhol       2025-03-29  195  #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) (0)
> cb7380de9e4cbc Kees Cook             2025-02-05  196  #else /* __CHECKER__ */
> 243c90e917f5cf Vincent Mailhol       2025-03-29 @197  #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> cb7380de9e4cbc Kees Cook             2025-02-05  198  #endif /* __CHECKER__ */
> cb7380de9e4cbc Kees Cook             2025-02-05  199

I was testing on the RISC-V tree, but I should've definitely tested this
on 'next' instead to catch this compiler error.

Since this is not too important, feel free to drop this patch.

Sorry for the noise,
Miquel

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: "Miquel Sabaté Solà" <mikisabate@gmail.com>
To: kernel test robot <lkp@intel.com>
Cc: linux-riscv@lists.infradead.org,  oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org,  pjw@kernel.org,
	 palmer@dabbelt.com, alex@ghiti.fr,  wangyuli@uniontech.com,
	 chenhuacai@kernel.org
Subject: Re: [PATCH] riscv: kgdb: Prefer strscpy instead of strcpy
Date: Tue, 16 Sep 2025 14:39:34 +0200	[thread overview]
Message-ID: <68c95a87.050a0220.362e95.5aa5@mx.google.com> (raw)
In-Reply-To: <202509161619.eJeLbfU0-lkp@intel.com> (kernel test robot's message of "Tue, 16 Sep 2025 17:10:50 +0800")

[-- Attachment #1: Type: text/plain, Size: 5293 bytes --]

Hello,

kernel test robot @ 2025-09-16 17:10 +08:

> Hi Miquel,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on linus/master]
> [also build test ERROR on v6.17-rc6 next-20250915]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Miquel-Sabat-Sol/riscv-kgdb-Prefer-strscpy-instead-of-strcpy/20250916-040750
> base:   linus/master
> patch link:    https://lore.kernel.org/r/20250915200644.200498-1-mikisabate%40gmail.com
> patch subject: [PATCH] riscv: kgdb: Prefer strscpy instead of strcpy
> config: riscv-randconfig-002-20250916 (https://download.01.org/0day-ci/archive/20250916/202509161619.eJeLbfU0-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 10.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250916/202509161619.eJeLbfU0-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/202509161619.eJeLbfU0-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>    In file included from include/linux/ptrace.h:5,
>                     from arch/riscv/kernel/kgdb.c:6:
>    arch/riscv/kernel/kgdb.c: In function 'kgdb_arch_handle_qxfer_pkt':
>>> include/linux/compiler.h:197:67: error: static assertion failed: "must be array"
>      197 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
>          |                                                                   ^~~~~~~~~~~~~~
>    include/linux/compiler.h:202:28: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>      202 | #define __must_be_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
>          |                            ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/string.h:80:40: note: in expansion of macro '__must_be_array'
>       80 |  sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) + \
>          |                                        ^~~~~~~~~~~~~~~
>    include/linux/args.h:25:24: note: in expansion of macro '__strscpy0'
>       25 | #define __CONCAT(a, b) a ## b
>          |                        ^
>    include/linux/args.h:26:27: note: in expansion of macro '__CONCAT'
>       26 | #define CONCATENATE(a, b) __CONCAT(a, b)
>          |                           ^~~~~~~~
>    include/linux/string.h:114:2: note: in expansion of macro 'CONCATENATE'
>      114 |  CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
>          |  ^~~~~~~~~~~
>    arch/riscv/kernel/kgdb.c:268:3: note: in expansion of macro 'strscpy'
>      268 |   strscpy(remcom_out_buffer, riscv_gdb_stub_target_desc);
>          |   ^~~~~~~
>>> include/linux/compiler.h:197:67: error: static assertion failed: "must be array"
>      197 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
>          |                                                                   ^~~~~~~~~~~~~~
>    include/linux/compiler.h:202:28: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>      202 | #define __must_be_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
>          |                            ^~~~~~~~~~~~~~~~~~~~~~~
>    include/linux/string.h:80:40: note: in expansion of macro '__must_be_array'
>       80 |  sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) + \
>          |                                        ^~~~~~~~~~~~~~~
>    include/linux/args.h:25:24: note: in expansion of macro '__strscpy0'
>       25 | #define __CONCAT(a, b) a ## b
>          |                        ^
>    include/linux/args.h:26:27: note: in expansion of macro '__CONCAT'
>       26 | #define CONCATENATE(a, b) __CONCAT(a, b)
>          |                           ^~~~~~~~
>    include/linux/string.h:114:2: note: in expansion of macro 'CONCATENATE'
>      114 |  CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
>          |  ^~~~~~~~~~~
>    arch/riscv/kernel/kgdb.c:271:3: note: in expansion of macro 'strscpy'
>      271 |   strscpy(remcom_out_buffer, riscv_gdb_stub_cpuxml);
>          |   ^~~~~~~
>
>
> vim +197 include/linux/compiler.h
>
> 230fa253df6352 Christian Borntraeger 2014-11-25  193
> cb7380de9e4cbc Kees Cook             2025-02-05  194  #ifdef __CHECKER__
> 243c90e917f5cf Vincent Mailhol       2025-03-29  195  #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) (0)
> cb7380de9e4cbc Kees Cook             2025-02-05  196  #else /* __CHECKER__ */
> 243c90e917f5cf Vincent Mailhol       2025-03-29 @197  #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> cb7380de9e4cbc Kees Cook             2025-02-05  198  #endif /* __CHECKER__ */
> cb7380de9e4cbc Kees Cook             2025-02-05  199

I was testing on the RISC-V tree, but I should've definitely tested this
on 'next' instead to catch this compiler error.

Since this is not too important, feel free to drop this patch.

Sorry for the noise,
Miquel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2025-09-16 12:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 20:06 [PATCH] riscv: kgdb: Prefer strscpy instead of strcpy Miquel Sabaté Solà
2025-09-15 20:06 ` Miquel Sabaté Solà
2025-09-16  9:10 ` kernel test robot
2025-09-16  9:10   ` kernel test robot
2025-09-16 12:39   ` Miquel Sabaté Solà [this message]
2025-09-16 12:39     ` Miquel Sabaté Solà

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=68c95a87.050a0220.362e95.5aa5@mx.google.com \
    --to=mikisabate@gmail.com \
    --cc=alex@ghiti.fr \
    --cc=chenhuacai@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=wangyuli@uniontech.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.