linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* selftests/filesystem: clang warning null passed to a callee that requires a non-null argument [-Wnonnull]
@ 2025-06-05 12:11 Naresh Kamboju
  2025-06-11 16:47 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Naresh Kamboju @ 2025-06-05 12:11 UTC (permalink / raw)
  To: clang-built-linux, open list:KERNEL SELFTEST FRAMEWORK, open list,
	lkft-triage
  Cc: Nathan Chancellor, Anders Roxell, Dan Carpenter, Arnd Bergmann,
	Sasha Levin

Regressions found on arm, arm64 and x86_64 building warnings with clang-20
and clang-nightly started from Linux next-20250603

Regressions found on arm, arm64 and x86_64
 - selftests/filesystem

Regression Analysis:
 - New regression? Yes
 - Reproducible? Yes

First seen on the next-20250603
Good: next-20250530
Bad:  next-20250603

Test regression: arm arm64 x86_64 clang warning null passed to a
callee that requires a non-null argument [-Wnonnull]

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

## Build warnings
make[4]: Entering directory '/builds/linux/tools/testing/selftests/filesystems'
  CC       devpts_pts
  CC       file_stressor
  CC       anon_inode_test
anon_inode_test.c:45:37: warning: null passed to a callee that
requires a non-null argument [-Wnonnull]
   45 |         ASSERT_LT(execveat(fd_context, "", NULL, NULL,
AT_EMPTY_PATH), 0);
      |                                            ^~~~

## Source
* Kernel version: 6.15.0-next-20250605
* Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
* Git sha: a0bea9e39035edc56a994630e6048c8a191a99d8
* Toolchain: Debian clang version 21.0.0
(++20250529012636+c474f8f2404d-1~exp1~20250529132821.1479)

## Build
* Test log: https://qa-reports.linaro.org/api/testruns/28651387/log_file/
* Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/
* Kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/config

--
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: selftests/filesystem: clang warning null passed to a callee that requires a non-null argument [-Wnonnull]
  2025-06-05 12:11 selftests/filesystem: clang warning null passed to a callee that requires a non-null argument [-Wnonnull] Naresh Kamboju
@ 2025-06-11 16:47 ` Dan Carpenter
  2025-06-11 17:50   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2025-06-11 16:47 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: clang-built-linux, open list:KERNEL SELFTEST FRAMEWORK, open list,
	lkft-triage, Nathan Chancellor, Anders Roxell, Arnd Bergmann,
	Sasha Levin

This seems like a Clang bug, right?  The test for _Nullable is reversed
or something?

regards,
dan carpenter

On Thu, Jun 05, 2025 at 05:41:01PM +0530, Naresh Kamboju wrote:
> Regressions found on arm, arm64 and x86_64 building warnings with clang-20
> and clang-nightly started from Linux next-20250603
> 
> Regressions found on arm, arm64 and x86_64
>  - selftests/filesystem
> 
> Regression Analysis:
>  - New regression? Yes
>  - Reproducible? Yes
> 
> First seen on the next-20250603
> Good: next-20250530
> Bad:  next-20250603
> 
> Test regression: arm arm64 x86_64 clang warning null passed to a
> callee that requires a non-null argument [-Wnonnull]
> 
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> 
> ## Build warnings
> make[4]: Entering directory '/builds/linux/tools/testing/selftests/filesystems'
>   CC       devpts_pts
>   CC       file_stressor
>   CC       anon_inode_test
> anon_inode_test.c:45:37: warning: null passed to a callee that
> requires a non-null argument [-Wnonnull]
>    45 |         ASSERT_LT(execveat(fd_context, "", NULL, NULL,
> AT_EMPTY_PATH), 0);
>       |                                            ^~~~
> 
> ## Source
> * Kernel version: 6.15.0-next-20250605
> * Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
> * Git sha: a0bea9e39035edc56a994630e6048c8a191a99d8
> * Toolchain: Debian clang version 21.0.0
> (++20250529012636+c474f8f2404d-1~exp1~20250529132821.1479)
> 
> ## Build
> * Test log: https://qa-reports.linaro.org/api/testruns/28651387/log_file/
> * Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/
> * Kernel config:
> https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/config
> 
> --
> Linaro LKFT
> https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: selftests/filesystem: clang warning null passed to a callee that requires a non-null argument [-Wnonnull]
  2025-06-11 16:47 ` Dan Carpenter
@ 2025-06-11 17:50   ` Nathan Chancellor
  2025-06-11 18:29     ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2025-06-11 17:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Naresh Kamboju, clang-built-linux,
	open list:KERNEL SELFTEST FRAMEWORK, open list, lkft-triage,
	Anders Roxell, Arnd Bergmann, Sasha Levin

On Wed, Jun 11, 2025 at 07:47:39PM +0300, Dan Carpenter wrote:
> This seems like a Clang bug, right?  The test for _Nullable is reversed
> or something?

My copy of unistd.h has

  /* Execute program relative to a directory file descriptor.  */
  extern int execveat (int __fd, const char *__path, char *const __argv[],
                       char *const __envp[], int __flags)
      __THROW __nonnull ((2, 3));

so I think the warning is valid in this case. I will note that
tools/testing/selftests/exec/recursion-depth.c uses execve() with a NULL
argv and disables -Wnonnull so maybe that should happen for this test
case too? Or should that NULL be changed into a ""?

> On Thu, Jun 05, 2025 at 05:41:01PM +0530, Naresh Kamboju wrote:
> > Regressions found on arm, arm64 and x86_64 building warnings with clang-20
> > and clang-nightly started from Linux next-20250603
> > 
> > Regressions found on arm, arm64 and x86_64
> >  - selftests/filesystem
> > 
> > Regression Analysis:
> >  - New regression? Yes
> >  - Reproducible? Yes
> > 
> > First seen on the next-20250603
> > Good: next-20250530
> > Bad:  next-20250603
> > 
> > Test regression: arm arm64 x86_64 clang warning null passed to a
> > callee that requires a non-null argument [-Wnonnull]
> > 
> > Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> > 
> > ## Build warnings
> > make[4]: Entering directory '/builds/linux/tools/testing/selftests/filesystems'
> >   CC       devpts_pts
> >   CC       file_stressor
> >   CC       anon_inode_test
> > anon_inode_test.c:45:37: warning: null passed to a callee that
> > requires a non-null argument [-Wnonnull]
> >    45 |         ASSERT_LT(execveat(fd_context, "", NULL, NULL,
> > AT_EMPTY_PATH), 0);
> >       |                                            ^~~~
> > 
> > ## Source
> > * Kernel version: 6.15.0-next-20250605
> > * Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
> > * Git sha: a0bea9e39035edc56a994630e6048c8a191a99d8
> > * Toolchain: Debian clang version 21.0.0
> > (++20250529012636+c474f8f2404d-1~exp1~20250529132821.1479)
> > 
> > ## Build
> > * Test log: https://qa-reports.linaro.org/api/testruns/28651387/log_file/
> > * Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/
> > * Kernel config:
> > https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/config
> > 
> > --
> > Linaro LKFT
> > https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: selftests/filesystem: clang warning null passed to a callee that requires a non-null argument [-Wnonnull]
  2025-06-11 17:50   ` Nathan Chancellor
@ 2025-06-11 18:29     ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2025-06-11 18:29 UTC (permalink / raw)
  To: Nathan Chancellor, Christian Brauner, Jeff Layton
  Cc: Naresh Kamboju, clang-built-linux,
	open list:KERNEL SELFTEST FRAMEWORK, open list, lkft-triage,
	Anders Roxell, Arnd Bergmann, Sasha Levin

On Wed, Jun 11, 2025 at 10:50:52AM -0700, Nathan Chancellor wrote:
> On Wed, Jun 11, 2025 at 07:47:39PM +0300, Dan Carpenter wrote:
> > This seems like a Clang bug, right?  The test for _Nullable is reversed
> > or something?
> 
> My copy of unistd.h has
> 
>   /* Execute program relative to a directory file descriptor.  */
>   extern int execveat (int __fd, const char *__path, char *const __argv[],
>                        char *const __envp[], int __flags)
>       __THROW __nonnull ((2, 3));
> 
> so I think the warning is valid in this case. I will note that
> tools/testing/selftests/exec/recursion-depth.c uses execve() with a NULL
> argv and disables -Wnonnull so maybe that should happen for this test
> case too? Or should that NULL be changed into a ""?
> 

Oh, huh.  The man page for execveat() says _Nullable but the headerfile
says the opposite.

regards,
dan carpenter

> > On Thu, Jun 05, 2025 at 05:41:01PM +0530, Naresh Kamboju wrote:
> > > Regressions found on arm, arm64 and x86_64 building warnings with clang-20
> > > and clang-nightly started from Linux next-20250603
> > > 
> > > Regressions found on arm, arm64 and x86_64
> > >  - selftests/filesystem
> > > 
> > > Regression Analysis:
> > >  - New regression? Yes
> > >  - Reproducible? Yes
> > > 
> > > First seen on the next-20250603
> > > Good: next-20250530
> > > Bad:  next-20250603
> > > 
> > > Test regression: arm arm64 x86_64 clang warning null passed to a
> > > callee that requires a non-null argument [-Wnonnull]
> > > 
> > > Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> > > 
> > > ## Build warnings
> > > make[4]: Entering directory '/builds/linux/tools/testing/selftests/filesystems'
> > >   CC       devpts_pts
> > >   CC       file_stressor
> > >   CC       anon_inode_test
> > > anon_inode_test.c:45:37: warning: null passed to a callee that
> > > requires a non-null argument [-Wnonnull]
> > >    45 |         ASSERT_LT(execveat(fd_context, "", NULL, NULL,
> > > AT_EMPTY_PATH), 0);
> > >       |                                            ^~~~
> > > 
> > > ## Source
> > > * Kernel version: 6.15.0-next-20250605
> > > * Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
> > > * Git sha: a0bea9e39035edc56a994630e6048c8a191a99d8
> > > * Toolchain: Debian clang version 21.0.0
> > > (++20250529012636+c474f8f2404d-1~exp1~20250529132821.1479)
> > > 
> > > ## Build
> > > * Test log: https://qa-reports.linaro.org/api/testruns/28651387/log_file/
> > > * Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/
> > > * Kernel config:
> > > https://storage.tuxsuite.com/public/linaro/lkft/builds/2xzM4wMl8SvuLKE3mw3csiuv3Jz/config
> > > 
> > > --
> > > Linaro LKFT
> > > https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-11 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 12:11 selftests/filesystem: clang warning null passed to a callee that requires a non-null argument [-Wnonnull] Naresh Kamboju
2025-06-11 16:47 ` Dan Carpenter
2025-06-11 17:50   ` Nathan Chancellor
2025-06-11 18:29     ` Dan Carpenter

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).