From: Nathan Chancellor <nathan@kernel.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: kernel test robot <lkp@intel.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [gustavoars:testing/wfamnae-next20240729-cbc-2 11/18] include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr)': struct member likely outside of struct_group_tagged()
Date: Thu, 1 Aug 2024 12:08:13 -0700 [thread overview]
Message-ID: <20240801190813.GC122261@thelio-3990X> (raw)
In-Reply-To: <138da3e5-0e24-41a6-bb35-df5d07045eb3@embeddedor.com>
On Thu, Aug 01, 2024 at 06:47:58AM -0600, Gustavo A. R. Silva wrote:
>
>
> On 01/08/24 05:35, kernel test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/wfamnae-next20240729-cbc-2
> > head: df15c862c1b93b6e1f6c90b0d7971f7a6ad66751
> > commit: e7cd9f429a852fb7e37a706c7d08fc36e7863e06 [11/18] RDMA/uverbs: Use static_assert() to check struct sizes
> > config: hexagon-randconfig-001-20240801 (https://download.01.org/0day-ci/archive/20240801/202408011956.wscyBwq6-lkp@intel.com/config)
> > compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 430b90f04533b099d788db2668176038be38c53b)
>
>
> Clang 20.0.0?? (thinkingface)
Indeed, Clang 19 branched and main is now 20 :)
https://github.com/llvm/llvm-project/commit/8f701b5df0adb3a2960d78ca2ad9cf53f39ba2fe
Cheers,
Nathan
> --
> Gustavo
>
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240801/202408011956.wscyBwq6-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/202408011956.wscyBwq6-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> > In file included from drivers/infiniband/core/ib_core_uverbs.c:8:
> > In file included from drivers/infiniband/core/uverbs.h:46:
> > In file included from include/rdma/ib_verbs.h:15:
> > In file included from include/linux/ethtool.h:18:
> > In file included from include/linux/if_ether.h:19:
> > In file included from include/linux/skbuff.h:17:
> > In file included from include/linux/bvec.h:10:
> > In file included from include/linux/highmem.h:10:
> > In file included from include/linux/mm.h:2228:
> > include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
> > 514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
> > | ~~~~~~~~~~~ ^ ~~~
> > In file included from drivers/infiniband/core/ib_core_uverbs.c:8:
> > In file included from drivers/infiniband/core/uverbs.h:46:
> > In file included from include/rdma/ib_verbs.h:15:
> > In file included from include/linux/ethtool.h:18:
> > In file included from include/linux/if_ether.h:19:
> > In file included from include/linux/skbuff.h:17:
> > In file included from include/linux/bvec.h:10:
> > In file included from include/linux/highmem.h:12:
> > In file included from include/linux/hardirq.h:11:
> > In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
> > In file included from include/asm-generic/hardirq.h:17:
> > In file included from include/linux/irq.h:20:
> > In file included from include/linux/io.h:14:
> > In file included from arch/hexagon/include/asm/io.h:328:
> > include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> > 548 | val = __raw_readb(PCI_IOBASE + addr);
> > | ~~~~~~~~~~ ^
> > include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> > 561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
> > | ~~~~~~~~~~ ^
> > include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
> > 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
> > | ^
> > In file included from drivers/infiniband/core/ib_core_uverbs.c:8:
> > In file included from drivers/infiniband/core/uverbs.h:46:
> > In file included from include/rdma/ib_verbs.h:15:
> > In file included from include/linux/ethtool.h:18:
> > In file included from include/linux/if_ether.h:19:
> > In file included from include/linux/skbuff.h:17:
> > In file included from include/linux/bvec.h:10:
> > In file included from include/linux/highmem.h:12:
> > In file included from include/linux/hardirq.h:11:
> > In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
> > In file included from include/asm-generic/hardirq.h:17:
> > In file included from include/linux/irq.h:20:
> > In file included from include/linux/io.h:14:
> > In file included from arch/hexagon/include/asm/io.h:328:
> > include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> > 574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
> > | ~~~~~~~~~~ ^
> > include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
> > 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
> > | ^
> > In file included from drivers/infiniband/core/ib_core_uverbs.c:8:
> > In file included from drivers/infiniband/core/uverbs.h:46:
> > In file included from include/rdma/ib_verbs.h:15:
> > In file included from include/linux/ethtool.h:18:
> > In file included from include/linux/if_ether.h:19:
> > In file included from include/linux/skbuff.h:17:
> > In file included from include/linux/bvec.h:10:
> > In file included from include/linux/highmem.h:12:
> > In file included from include/linux/hardirq.h:11:
> > In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
> > In file included from include/asm-generic/hardirq.h:17:
> > In file included from include/linux/irq.h:20:
> > In file included from include/linux/io.h:14:
> > In file included from arch/hexagon/include/asm/io.h:328:
> > include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> > 585 | __raw_writeb(value, PCI_IOBASE + addr);
> > | ~~~~~~~~~~ ^
> > include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> > 595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
> > | ~~~~~~~~~~ ^
> > include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
> > 605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
> > | ~~~~~~~~~~ ^
> > In file included from drivers/infiniband/core/ib_core_uverbs.c:8:
> > In file included from drivers/infiniband/core/uverbs.h:49:
> > In file included from include/rdma/uverbs_std_types.h:10:
> > > > include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr)': struct member likely outside of struct_group_tagged()
> > 643 | static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr),
> > | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 644 | "struct member likely outside of struct_group_tagged()");
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
> > 16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
> > | ^
> > include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
> > 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
> > | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
> > 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
> > | ^~~~
> > include/rdma/uverbs_ioctl.h:643:58: note: expression evaluates to '56 == 52'
> > 643 | static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr),
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 644 | "struct member likely outside of struct_group_tagged()");
> > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
> > 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
> > | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
> > include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
> > 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
> > | ^~~~
> > 7 warnings and 1 error generated.
> >
> >
> > vim +643 include/rdma/uverbs_ioctl.h
> >
> > 630
> > 631 struct uverbs_attr_bundle {
> > 632 /* New members MUST be added within the struct_group() macro below. */
> > 633 struct_group_tagged(uverbs_attr_bundle_hdr, hdr,
> > 634 struct ib_udata driver_udata;
> > 635 struct ib_udata ucore;
> > 636 struct ib_uverbs_file *ufile;
> > 637 struct ib_ucontext *context;
> > 638 struct ib_uobject *uobject;
> > 639 DECLARE_BITMAP(attr_present, UVERBS_API_ATTR_BKEY_LEN);
> > 640 );
> > 641 struct uverbs_attr attrs[];
> > 642 };
> > > 643 static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr),
> > 644 "struct member likely outside of struct_group_tagged()");
> > 645
> >
>
next prev parent reply other threads:[~2024-08-01 19:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 11:35 [gustavoars:testing/wfamnae-next20240729-cbc-2 11/18] include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr)': struct member likely outside of struct_group_tagged() kernel test robot
2024-08-01 12:47 ` Gustavo A. R. Silva
2024-08-01 19:08 ` Nathan Chancellor [this message]
2024-08-01 20:17 ` Gustavo A. R. Silva
2024-08-01 22:14 ` Nathan Chancellor
2024-08-01 22:35 ` Gustavo A. R. Silva
2024-08-02 22:19 ` Nathan Chancellor
2024-08-06 15:36 ` [gustavoars:testing/wfamnae-next20240729-cbc-2 11/18] include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr)': struct memb Brian Cain
2024-08-14 3:27 ` Brian Cain
2024-08-14 16:30 ` Steven Walk
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=20240801190813.GC122261@thelio-3990X \
--to=nathan@kernel.org \
--cc=gustavo@embeddedor.com \
--cc=gustavoars@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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