Closed
Bug 1711828
Opened 3 years ago
Closed 3 years ago
[gcc 11] tools/power/rapl.cpp:623:20: error: '%5.2f' directive writing between 5 and 313 bytes into a region of size 16
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
FIXED
90 Branch
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
[task 2021-05-19T04:16:54.645Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.645Z] 04:16:54 INFO - 34 | __bos (__s), __fmt, __va_arg_pack ());
[task 2021-05-19T04:16:54.645Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.645Z] 04:16:54 ERROR - /builds/worker/checkouts/gecko/tools/power/rapl.cpp:623:20: error: '%5.2f' directive writing between 5 and 313 bytes into a region of size 16 [-Werror=format-overflow=]
[task 2021-05-19T04:16:54.645Z] 04:16:54 INFO - 623 | sprintf(aBuf, "%5.2f", JoulesToWatts(aValue_J));
[task 2021-05-19T04:16:54.646Z] 04:16:54 INFO - | ^~~~~
[task 2021-05-19T04:16:54.646Z] 04:16:54 INFO - In file included from /builds/worker/fetches/sysroot/usr/include/stdio.h:937,
[task 2021-05-19T04:16:54.646Z] 04:16:54 INFO - from /builds/worker/workspace/obj-build/dist/system_wrappers/stdio.h:3,
[task 2021-05-19T04:16:54.646Z] 04:16:54 INFO - from /builds/worker/checkouts/gecko/tools/power/rapl.cpp:41:
[task 2021-05-19T04:16:54.646Z] 04:16:54 INFO - /builds/worker/fetches/sysroot/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:34: note: '__builtin___sprintf_chk' output between 6 and 314 bytes into a destination of size 16
[task 2021-05-19T04:16:54.647Z] 04:16:54 INFO - 33 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[task 2021-05-19T04:16:54.647Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.647Z] 04:16:54 INFO - 34 | __bos (__s), __fmt, __va_arg_pack ());
[task 2021-05-19T04:16:54.647Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.647Z] 04:16:54 ERROR - /builds/worker/checkouts/gecko/tools/power/rapl.cpp:623:20: error: '%5.2f' directive writing between 5 and 313 bytes into a region of size 16 [-Werror=format-overflow=]
[task 2021-05-19T04:16:54.648Z] 04:16:54 INFO - 623 | sprintf(aBuf, "%5.2f", JoulesToWatts(aValue_J));
[task 2021-05-19T04:16:54.648Z] 04:16:54 INFO - | ^~~~~
[task 2021-05-19T04:16:54.648Z] 04:16:54 INFO - In file included from /builds/worker/fetches/sysroot/usr/include/stdio.h:937,
[task 2021-05-19T04:16:54.648Z] 04:16:54 INFO - from /builds/worker/workspace/obj-build/dist/system_wrappers/stdio.h:3,
[task 2021-05-19T04:16:54.648Z] 04:16:54 INFO - from /builds/worker/checkouts/gecko/tools/power/rapl.cpp:41:
[task 2021-05-19T04:16:54.648Z] 04:16:54 INFO - /builds/worker/fetches/sysroot/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:34: note: '__builtin___sprintf_chk' output between 6 and 314 bytes into a destination of size 16
[task 2021-05-19T04:16:54.649Z] 04:16:54 INFO - 33 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[task 2021-05-19T04:16:54.649Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.649Z] 04:16:54 INFO - 34 | __bos (__s), __fmt, __va_arg_pack ());
[task 2021-05-19T04:16:54.649Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.649Z] 04:16:54 ERROR - /builds/worker/checkouts/gecko/tools/power/rapl.cpp:623:20: error: '%5.2f' directive writing between 5 and 313 bytes into a region of size 16 [-Werror=format-overflow=]
[task 2021-05-19T04:16:54.650Z] 04:16:54 INFO - 623 | sprintf(aBuf, "%5.2f", JoulesToWatts(aValue_J));
[task 2021-05-19T04:16:54.650Z] 04:16:54 INFO - | ^~~~~
[task 2021-05-19T04:16:54.650Z] 04:16:54 INFO - In file included from /builds/worker/fetches/sysroot/usr/include/stdio.h:937,
[task 2021-05-19T04:16:54.650Z] 04:16:54 INFO - from /builds/worker/workspace/obj-build/dist/system_wrappers/stdio.h:3,
[task 2021-05-19T04:16:54.650Z] 04:16:54 INFO - from /builds/worker/checkouts/gecko/tools/power/rapl.cpp:41:
[task 2021-05-19T04:16:54.650Z] 04:16:54 INFO - /builds/worker/fetches/sysroot/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:34: note: '__builtin___sprintf_chk' output between 6 and 314 bytes into a destination of size 16
[task 2021-05-19T04:16:54.651Z] 04:16:54 INFO - 33 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[task 2021-05-19T04:16:54.651Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.651Z] 04:16:54 INFO - 34 | __bos (__s), __fmt, __va_arg_pack ());
[task 2021-05-19T04:16:54.651Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.651Z] 04:16:54 ERROR - /builds/worker/checkouts/gecko/tools/power/rapl.cpp:623:20: error: '%5.2f' directive writing between 5 and 313 bytes into a region of size 16 [-Werror=format-overflow=]
[task 2021-05-19T04:16:54.652Z] 04:16:54 INFO - 623 | sprintf(aBuf, "%5.2f", JoulesToWatts(aValue_J));
[task 2021-05-19T04:16:54.652Z] 04:16:54 INFO - | ^~~~~
[task 2021-05-19T04:16:54.652Z] 04:16:54 INFO - In file included from /builds/worker/fetches/sysroot/usr/include/stdio.h:937,
[task 2021-05-19T04:16:54.652Z] 04:16:54 INFO - from /builds/worker/workspace/obj-build/dist/system_wrappers/stdio.h:3,
[task 2021-05-19T04:16:54.652Z] 04:16:54 INFO - from /builds/worker/checkouts/gecko/tools/power/rapl.cpp:41:
[task 2021-05-19T04:16:54.653Z] 04:16:54 INFO - /builds/worker/fetches/sysroot/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:34: note: '__builtin___sprintf_chk' output between 6 and 314 bytes into a destination of size 16
[task 2021-05-19T04:16:54.653Z] 04:16:54 INFO - 33 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[task 2021-05-19T04:16:54.653Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.653Z] 04:16:54 INFO - 34 | __bos (__s), __fmt, __va_arg_pack ());
[task 2021-05-19T04:16:54.653Z] 04:16:54 INFO - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2021-05-19T04:16:54.653Z] 04:16:54 INFO - cc1plus: all warnings being treated as errors
Assignee | ||
Comment 1•3 years ago
|
||
If for some reason the input number is a very large double, printing it
can overflow the 16-bytes buffers the function is called with. But
anything above 1000W is very likely invalid.
Updated•3 years ago
|
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Updated•3 years ago
|
Blocks: build-gcc-11
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/a14a237da54e
Cap printed Watts to 6 characters. r=xpcom-reviewers,mccr8
Comment 3•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox90:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•