Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning from ddt_load breaking -Werror #15905

Closed
rincebrain opened this issue Feb 18, 2024 · 3 comments
Closed

Warning from ddt_load breaking -Werror #15905

rincebrain opened this issue Feb 18, 2024 · 3 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@rincebrain
Copy link
Contributor

System information

Type Version/Name
Distribution Name Debian
Distribution Version 11
Kernel Version 5.10.0-27-amd64
Architecture amd64
OpenZFS Version af4da5c

Describe the problem you're observing

I'm guessing this is fallout from something in the recent DDT series, but I'm not sure why the CI wouldn't have screamed about it...

I was cutting a build to test something, and got this on vanilla git:

In file included from ./include/sys/spa.h:46,
                 from module/zfs/ddt.c:30:
module/zfs/ddt.c: In function ‘ddt_load’:
./include/sys/dmu.h:377:24: warning: ‘%s’ directive output may be truncated writing likely 5 or more bytes into a region of size between 1 and 104 [-Wformat-truncation=]
  377 | #define DMU_POOL_DDT   "DDT-%s-%s-%s"
      |                        ^~~~~~~~~~~~~~
module/zfs/ddt.c:377:37: note: in expansion of macro ‘DMU_POOL_DDT’
  377 |  (void) snprintf(name, DDT_NAMELEN, DMU_POOL_DDT,
      |                                     ^~~~~~~~~~~~
./include/sys/dmu.h:377:35: note: format string is defined here
  377 | #define DMU_POOL_DDT   "DDT-%s-%s-%s"
      |                                   ^~
./include/sys/dmu.h:377:24: note: assuming directive output of 5 bytes
  377 | #define DMU_POOL_DDT   "DDT-%s-%s-%s"
      |                        ^~~~~~~~~~~~~~
module/zfs/ddt.c:377:37: note: in expansion of macro ‘DMU_POOL_DDT’
  377 |  (void) snprintf(name, DDT_NAMELEN, DMU_POOL_DDT,
      |                                     ^~~~~~~~~~~~
module/zfs/ddt.c:377:9: note: ‘snprintf’ output 7 or more bytes (assuming 115) into a destination of size 110
  377 |  (void) snprintf(name, DDT_NAMELEN, DMU_POOL_DDT,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  378 |      zio_checksum_table[ddt->ddt_checksum].ci_name,
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  379 |      ddt_ops[type]->ddt_op_name, ddt_class_name[class]);
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Describe how to reproduce the problem

Just build on Debian 11, I assume.

Include any warning/errors/backtraces from the system logs

See above.

@rincebrain rincebrain added the Type: Defect Incorrect behavior (e.g. crash, hang) label Feb 18, 2024
@robn
Copy link
Member

robn commented Feb 18, 2024

Sigh this thing. What compiler version?

@rincebrain
Copy link
Contributor Author

Sorry, I meant to include that and forgot.

 $ gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@behlendorf
Copy link
Contributor

Fixed by #15908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants