[LU-14093] gcc10 fails to build Lustre Created: 29/Oct/20 Updated: 24/Jan/22 Resolved: 25/Aug/21 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.14.0 |
| Fix Version/s: | Lustre 2.15.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alex Zhuravlev | Assignee: | Alex Zhuravlev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
/ldiskfs_extents.h:214:12: error: ‘zero_ex2.ee_start_hi’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 214 | block |= ((ldiskfs_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1; /home/alexey/head2/ldiskfs/extents.c:3411:34: note: ‘zero_ex2.ee_start_hi’ was declared here 3411 | struct ldiskfs_extent zero_ex1, zero_ex2; | ^~~~~~~~ ... /home/alexey/head2/lustre/obdclass/llog_swab.c: In function ‘lustre_swab_update_ops’: /home/alexey/head2/lustre/obdclass/llog_swab.c:137:46: error: array subscript 65534 is outside the bounds of an interior zero-length array ‘__u16[0]’ {aka ‘short unsigned int[]’} [-Werror=zero-length-bounds] 137 | __swab16s(&uops->uops_op[i].uop_params_off[j]); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ ... /home/alexey/head2/lustre/mgc/mgc_request.c: In function ‘mgc_apply_recover_logs’: /home/alexey/head2/lustre/mgc/mgc_request.c:1506:24: error: ‘sprintf’ argument 4 may overlap destination object ‘<unknown>’ [-Werror=restrict] 1506 | pos += sprintf(obdname + pos, "-%s-%s", cname, inst); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... In function ‘lfs_project_item_alloc’, inlined from ‘lfs_project_handle_dir’ at lfs_project.c:288:9: lfs_project.c:72:2: error: ‘strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Werror=stringop-truncation] 72 | strncpy(lpi->lpi_pathname, pathname, sizeof(lpi->lpi_pathname) - 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| Comments |
| Comment by Gerrit Updater [ 30/Oct/20 ] |
|
Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/40484 |
| Comment by Gerrit Updater [ 30/Oct/20 ] |
|
Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/40485 |
| Comment by Gerrit Updater [ 30/Oct/20 ] |
|
Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/40486 |
| Comment by Gerrit Updater [ 07/Nov/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40486/ |
| Comment by Gerrit Updater [ 10/Apr/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40485/ |
| Comment by Gerrit Updater [ 15/May/21 ] |
|
Dominique Martinet (qhufhnrynczannqp.f@noclue.notk.org) uploaded a new patch: https://review.whamcloud.com/43711 |
| Comment by Gerrit Updater [ 15/May/21 ] |
|
Dominique Martinet (qhufhnrynczannqp.f@noclue.notk.org) uploaded a new patch: https://review.whamcloud.com/43712 |
| Comment by Gerrit Updater [ 15/May/21 ] |
|
Dominique Martinet (qhufhnrynczannqp.f@noclue.notk.org) uploaded a new patch: https://review.whamcloud.com/43713 |
| Comment by Gerrit Updater [ 07/Jun/21 ] |
|
James Simmons (jsimmons@infradead.org) uploaded a new patch: https://review.whamcloud.com/43938 |
| Comment by James A Simmons [ 07/Jun/21 ] |
|
I'm also seeing this compile error but don't have a solution. llog_reader.c: In function ‘lustre_swab_lu_fid’: llog_reader.c:781:12: error: taking address of packed member of ‘struct lu_fid’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 781 | __swab64s(&fid->f_seq); |
| Comment by Gerrit Updater [ 14/Jun/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43711/ |
| Comment by Gerrit Updater [ 14/Jun/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43712/ |
| Comment by James A Simmons [ 14/Jun/21 ] |
|
A few more patches are needed so don't close just yet. |
| Comment by Gerrit Updater [ 21/Jun/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43938/ |
| Comment by Gerrit Updater [ 08/Jul/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43713/ |
| Comment by James A Simmons [ 08/Jul/21 ] |
|
Need two more patches to complete this on my end. |
| Comment by James A Simmons [ 20/Jul/21 ] |
|
Ubuntu 20 HWE has moved to gcc 10. New bugs are showing up. |
| Comment by Gerrit Updater [ 21/Jul/21 ] |
|
James Simmons (jsimmons@infradead.org) uploaded a new patch: https://review.whamcloud.com/44363 |
| Comment by Gerrit Updater [ 31/Jul/21 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/44363/ |
| Comment by James A Simmons [ 31/Jul/21 ] |
|
Couple of more patches. |
| Comment by James A Simmons [ 03/Aug/21 ] |
|
So I see this error: badarea_io.c: In function ‘main’: badarea_io.c:59:7: error: ‘write’ reading 2097152 bytes from a region of size 4 [-Werror=stringop-overflow=] 59 | rc = write(fd, &fd, 2UL*1024*1024); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from badarea_io.c:30: /usr/include/unistd.h:367:16: note: in a call to function ‘write’ declared with attribute ‘read_only (2, 3)’ 367 | extern ssize_t write (int _fd, const void *_buf, size_t __n) __wur | ^~~~~ badarea_io.c:63:7: error: ‘write’ reading 2147483648 bytes from a region of size 4 [-Werror=stringop-overflow=] 63 | rc = write(fd, &fd, 2UL*1024*1024*1024); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from badarea_io.c:30: /usr/include/unistd.h:367:16: note: in a call to function ‘write’ declared with attribute ‘read_only (2, 3)’ 367 | extern ssize_t write (int _fd, const void *_buf, size_t __n) __wur | ^~~~~ badarea_io.c:67:7: error: ‘write’ specified size 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 67 | rc = write(fd, &fd, -2); | ^~~~~~~~~~~~~~~~~~ In file included from badarea_io.c:30: /usr/include/unistd.h:367:16: note: in a call to function ‘write’ declared with attribute ‘read_only (2, 3)’ 367 | extern ssize_t write (int _fd, const void *_buf, size_t __n) __wur | ^~~~~
Was the original intent to actually write large amounts of data ? Just want to understand what the original intent was. |
| Comment by Andreas Dilger [ 05/Aug/21 ] |
|
James, the goal of badarea_io is to verify that the /procfs, /sysfs, /debugfs handlers are not doing anything bad with invalid input (e.g. buffer overflows, choking on garbage data, etc). That used to happen on occasion and caused a kernel crash, but is largely robust now due to these tests. It should be fine to replace "&fd" with any other pointer, since the kernel input parsing should stop long before accessing 2MiB or 2GiB or 16EiB of data. It might be enough to malloc() a buffer (e.g. 4KB) and use that directly, but if newer GCC also complains about overflowing the 4KB static buffer size, then it would also be possible to (optionally) accept the buffer size on the command-line just to work around any static size logic in the compiler. We don't necessarily want to avoid passing a bad pointer to the kernel, since that is exactly what this test is trying to exercise (e.g. copy_from_user() is being used properly, etc). |
| Comment by James A Simmons [ 16/Aug/21 ] |
|
I pushed the last patch for this work that I see. https://review.whamcloud.com/#/c/44670 Alex if you see anything else let me know. |
| Comment by Gerrit Updater [ 18/Aug/21 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/40484/ |
| Comment by Gerrit Updater [ 18/Aug/21 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/44484/ |
| Comment by Gerrit Updater [ 25/Aug/21 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/44670/ |
| Comment by James A Simmons [ 25/Aug/21 ] |
|
All the build issues I have seen have been addresses. Alex if you have any more please reopen this ticket. |