2024-03-05 03:50:36

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the kspp tree

Hi all,

After merging the kspp tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from lib/string_kunit.c:8:
lib/string_kunit.c: In function 'test_strspn':
lib/string_kunit.c:176:25: error: format '%d' expects argument of type 'int', but argument 7 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
176 | "i:%d", i);
| ^~~~~~ ~
| |
| size_t {aka long unsigned int}
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
597 | fmt, \
| ^~~
include/kunit/test.h:722:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
722 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1253:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
1253 | KUNIT_BINARY_INT_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/string_kunit.c:175:17: note: in expansion of macro 'KUNIT_ASSERT_EQ_MSG'
175 | KUNIT_ASSERT_EQ_MSG(test, s->a, strspn(s->str, s->accept),
| ^~~~~~~~~~~~~~~~~~~
lib/string_kunit.c:176:29: note: format string is defined here
176 | "i:%d", i);
| ~^
| |
| int
| %ld
lib/string_kunit.c:178:25: error: format '%d' expects argument of type 'int', but argument 7 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
178 | "i:%d", i);
| ^~~~~~ ~
| |
| size_t {aka long unsigned int}
include/kunit/test.h:597:37: note: in definition of macro '_KUNIT_FAILED'
597 | fmt, \
| ^~~
include/kunit/test.h:722:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
722 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1253:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
1253 | KUNIT_BINARY_INT_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/string_kunit.c:177:17: note: in expansion of macro 'KUNIT_ASSERT_EQ_MSG'
177 | KUNIT_ASSERT_EQ_MSG(test, s->r, strcspn(s->str, s->reject),
| ^~~~~~~~~~~~~~~~~~~
lib/string_kunit.c:178:29: note: format string is defined here
178 | "i:%d", i);
| ~^
| |
| int
| %ld
cc1: all warnings being treated as errors

Caused by commit

578914ebade8 ("string: Convert selftest to KUnit")

I have used the kspp tree from next-20240304 for today.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-03-05 09:55:12

by Kees Cook

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On Tue, Mar 05, 2024 at 02:50:18PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> In file included from lib/string_kunit.c:8:
> lib/string_kunit.c: In function 'test_strspn':
> lib/string_kunit.c:176:25: error: format '%d' expects argument of type 'int', but argument 7 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
> 176 | "i:%d", i);
> | ^~~~~~ ~
> | |
> | size_t {aka long unsigned int}

I was really scratching my head on this one. I didn't see the warning on
my end because this is actually a result of the merge, namely KUnit
becoming correctly stricter about format strings:

806cb2270237 ("kunit: Annotate _MSG assertion variants with gnu printf specifiers")

I will fix the format string! :)

--
Kees Cook

2017-11-09 00:33:38

by Kees Cook

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On Wed, Nov 8, 2017 at 4:18 PM, Darrick J. Wong <[email protected]> wrote:
> Agreed. I guess we'll see you for round X when you get to general
> kmalloc annotating. :)

That should be "fun". :)

-Kees

--
Kees Cook
Pixel Security

From 1583545664719164831@xxx Thu Nov 09 00:20:29 +0000 2017
X-GM-THRID: 1583483273139093098
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-09 00:20:29

by Darrick J. Wong

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On Wed, Nov 08, 2017 at 03:43:47PM -0800, Kees Cook wrote:
> On Tue, Nov 7, 2017 at 9:23 PM, Stephen Rothwell <[email protected]> wrote:
> > Hi Kees,
> >
> > After merging the kspp tree, today's linux-next build (powerpc
> > ppc64_defconfig) failed like this:
> >
> > In file included from include/linux/compiler_types.h:58:0,
> > from include/uapi/linux/stddef.h:2,
> > from include/linux/stddef.h:5,
> > from include/uapi/linux/posix_types.h:5,
> > from include/uapi/linux/types.h:14,
> > from include/linux/types.h:6,
> > from fs/xfs/xfs_linux.h:21,
> > from fs/xfs/xfs.h:35,
> > from fs/xfs/xfs_super.c:19:
> > fs/xfs/xfs_super.c: In function 'xfs_init_zones':
> > include/linux/compiler-gcc.h:166:2: error: 'xfs_ifork_t {aka struct xfs_ifork}' has no member named 'if_u2'
> > __builtin_offsetof(a, b)
> > ^
> > include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
> > #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
> > ^
> > fs/xfs/xfs_super.c:1862:4: note: in expansion of macro 'offsetof'
> > offsetof(xfs_inode_t, i_df.if_u2.if_inline_data),
> > ^
> > In file included from include/uapi/linux/posix_types.h:5:0,
> > from include/uapi/linux/types.h:14,
> > from include/linux/types.h:6,
> > from fs/xfs/xfs_linux.h:21,
> > from fs/xfs/xfs.h:35,
> > from fs/xfs/xfs_super.c:19:
> > fs/xfs/xfs_super.c:1863:34: error: 'xfs_ifork_t {aka struct xfs_ifork}' has no member named 'if_u2'
> > sizeof_field(xfs_inode_t, i_df.if_u2.if_inline_data),
> > ^
> > include/linux/stddef.h:22:66: note: in definition of macro 'sizeof_field'
> > #define sizeof_field(structure, field) sizeof((((structure *)0)->field))
> > ^
> >
> > Caused by commit
> >
> > 1d48144b9688 ("xfs: Define usercopy region in xfs_inode slab cache")
> >
> > interacting with commit
> >
> > 43518812d297 ("xfs: remove support for inlining data/extents into the inode fork")
> >
> > from the tree.
> >
> > I just reverted the kspp tree commit as it seems like it is no longer
> > needed.
>
> Yup, that looks like the correct fix. Thanks!

Agreed. I guess we'll see you for round X when you get to general
kmalloc annotating. :)

--D

> -Kees
>
> --
> Kees Cook
> Pixel Security
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

From 1583543413026249781@xxx Wed Nov 08 23:44:41 +0000 2017
X-GM-THRID: 1583483273139093098
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-08 23:44:41

by Kees Cook

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp tree

On Tue, Nov 7, 2017 at 9:23 PM, Stephen Rothwell <[email protected]> wrote:
> Hi Kees,
>
> After merging the kspp tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> In file included from include/linux/compiler_types.h:58:0,
> from include/uapi/linux/stddef.h:2,
> from include/linux/stddef.h:5,
> from include/uapi/linux/posix_types.h:5,
> from include/uapi/linux/types.h:14,
> from include/linux/types.h:6,
> from fs/xfs/xfs_linux.h:21,
> from fs/xfs/xfs.h:35,
> from fs/xfs/xfs_super.c:19:
> fs/xfs/xfs_super.c: In function 'xfs_init_zones':
> include/linux/compiler-gcc.h:166:2: error: 'xfs_ifork_t {aka struct xfs_ifork}' has no member named 'if_u2'
> __builtin_offsetof(a, b)
> ^
> include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
> #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
> ^
> fs/xfs/xfs_super.c:1862:4: note: in expansion of macro 'offsetof'
> offsetof(xfs_inode_t, i_df.if_u2.if_inline_data),
> ^
> In file included from include/uapi/linux/posix_types.h:5:0,
> from include/uapi/linux/types.h:14,
> from include/linux/types.h:6,
> from fs/xfs/xfs_linux.h:21,
> from fs/xfs/xfs.h:35,
> from fs/xfs/xfs_super.c:19:
> fs/xfs/xfs_super.c:1863:34: error: 'xfs_ifork_t {aka struct xfs_ifork}' has no member named 'if_u2'
> sizeof_field(xfs_inode_t, i_df.if_u2.if_inline_data),
> ^
> include/linux/stddef.h:22:66: note: in definition of macro 'sizeof_field'
> #define sizeof_field(structure, field) sizeof((((structure *)0)->field))
> ^
>
> Caused by commit
>
> 1d48144b9688 ("xfs: Define usercopy region in xfs_inode slab cache")
>
> interacting with commit
>
> 43518812d297 ("xfs: remove support for inlining data/extents into the inode fork")
>
> from the tree.
>
> I just reverted the kspp tree commit as it seems like it is no longer
> needed.

Yup, that looks like the correct fix. Thanks!

-Kees

--
Kees Cook
Pixel Security

From 1583483273139093098@xxx Wed Nov 08 07:48:48 +0000 2017
X-GM-THRID: 1583483273139093098
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread