Skip to content

[BUG] Failure to compile tools/logger/convert.c #8766

@dbaluta

Description

@dbaluta

Describe the bug

Compiling the sof-logger for aarch64 we get the following warnings which gets translated into an error and compilation stops:

-- Build files have been written to: /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/sof-tools
| [ 20%] Building C object logger/CMakeFiles/sof-logger.dir/convert.c.o
| /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c: In function 'convert':
| /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c:357:34: error: '%*s' directive output between 4294967264 and 4294967284 bytes exceeds 'INT_MAX' [-Werror=format-overflow=]
|   357 |                 fprintf(out_fd, "%*s(us)%*s  ", -ts_width, " TIMESTAMP", ts_width, "DELTA");
|       |                                  ^~~                       ~~~~~~~~~~~~
| In file included from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/recipe-sysroot/usr/include/stdio.h:964,
|                  from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.h:13,
|                  from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c:21:
| In function 'fprintf',
|     inlined from 'print_table_header' at /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c:357:3,
|     inlined from 'logger_read' at /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c:846:3,
|     inlined from 'convert' at /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c:1151:8:
| /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/recipe-sysroot/usr/include/bits/stdio2.h:79:10: note: '__fprintf_chk' output between 4294967283 and 4294967323 bytes
|    79 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
|       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|    80 |                         __va_arg_pack ());
|       |                         ~~~~~~~~~~~~~~~~~

Compiler version: aarch64-poky-linux-gcc (GCC) 13.2.0

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • SOF: 16b53b4 (main) audio: host: reload DMA buffer on non-zero partial_size

It looks like the issues was introduced by 4c905f5

commit 4c905f5234faf2cb32b0663dfd0b1c494b0a2a93
Author: Adrian Warecki <adrian.warecki@intel.com>
Date:   Mon Sep 18 15:31:28 2023 +0200

    logger: convert: Simplified printing of a tim

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions