[LU-16980] format-truncation errors Created: 25/Jul/23 Updated: 07/Aug/23 Resolved: 07/Aug/23 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.16.0 |
| Fix Version/s: | Lustre 2.16.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Jian Yu | Assignee: | Jian Yu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Severity: | 3 | ||||
| Rank (Obsolete): | 9223372036854775807 | ||||
| Description |
|
While building master branch against kernel 6.2.0-26-generic with gcc 12.2.0, the following errors occurred: liblnetconfig.c: In function 'open_sysfs_file':
liblnetconfig.c:106:49: error: '%s' directive output may be truncated writing up to 127 bytes into a region of size between 1 and 128 [-Werror=format-truncation=]
106 | snprintf(filename, sizeof(filename), "%s%s",
| ^~
lfs_project.c: In function ‘lfs_project_handle_dir’:
lfs_project.c:324:50: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 1 and 4095 [-Werror=format-truncation=]
324 | snprintf(fullname, PATH_MAX, "%s/%s", pathname,
| ^~
statx.c: In function ‘do_dir_list’:
statx.c:1427:58: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 1 and 4095 [-Werror=format-truncation=]
1427 | snprintf(fullname, PATH_MAX, "%s/%s",
| ^~
|
| Comments |
| Comment by Jian Yu [ 25/Jul/23 ] |
|
More build errors: /root/lustre-release/libcfs/include/libcfs/util/list.h:481:42: error: pointer ‘tmp’ used after ‘free’ [-Werror=use-after-free]
481 | pos = list_entry(pos->member.next, typeof(*pos), member), \
| ^
/root/lustre-release/libcfs/include/libcfs/util/list.h:239:28: note: in definition of macro ‘list_entry’
239 | ((type *)((char *)(ptr)-(char *)(&((type *)0)->member)))
| ^~~
obd.c:5118:9: note: in expansion of macro ‘list_for_each_entry’
5118 | list_for_each_entry(tmp, head, lpn_list) {
| ^~~~~~~~~~~~~~~~~~~
obd.c:5124:17: note: call to ‘free’ here
5124 | free(tmp);
| ^~~~~~~~~
cc1: all warnings being treated as errors
lutf_python.c: In function ‘python_init’:
lutf_python.c:216:9: error: ‘Py_SetProgramName’ is deprecated [-Werror=deprecated-declarations]
216 | Py_SetProgramName(program);
| ^~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:94,
from lutf_python.c:1:
/usr/include/python3.11/pylifecycle.h:37:38: note: declared here
37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [Makefile:600: lutf-lutf_python.o] Error 1
test_brw.c: In function ‘main’:
test_brw.c:227:22: error: ‘write’ specified size between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
227 | rc = write(fd, buf, len);
| ^~~~~~~~~~~~~~~~~~~
In file included from test_brw.c:40:
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with attribute ‘access (read_only, 2, 3)’
378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
| ^~~~~
cc1: all warnings being treated as errors
|
| Comment by Gerrit Updater [ 26/Jul/23 ] |
|
"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51765 |
| Comment by Gerrit Updater [ 31/Jul/23 ] |
|
"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51819 |
| Comment by Gerrit Updater [ 07/Aug/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51765/ |
| Comment by Gerrit Updater [ 07/Aug/23 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51819/ |
| Comment by Peter Jones [ 07/Aug/23 ] |
|
Landed for 2.16 |