Open Bug 1954046 Opened 1 month ago Updated 9 days ago

nsTestCrasher.cpp:254:12: error: pointer ‘p’ used after ‘void free(void*)’ [-Werror=use-after-free]

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

 0:10.42 In file included from Unified_cpp_crashreporter_test0.cpp:83:
 0:10.42 /root/firefox-gcc-last/toolkit/crashreporter/test/nsTestCrasher.cpp: In function ‘void Cras
h(int16_t)’:
 0:10.42 /root/firefox-gcc-last/toolkit/crashreporter/test/nsTestCrasher.cpp:254:12: error: pointer
‘p’ used after ‘void free(void*)’ [-Werror=use-after-free]
 0:10.42   254 |       p[0] = 0;
 0:10.42       |       ~~~~~^~~
 0:10.42 /root/firefox-gcc-last/toolkit/crashreporter/test/nsTestCrasher.cpp:253:11: note: call to ‘
void free(void*)’ here
 0:10.42   253 |       free(p);
 0:10.42       |       ~~~~^~~
 0:10.42 /root/firefox-gcc-last/toolkit/crashreporter/test/nsTestCrasher.cpp:261:11: error: pointer
‘p’ used after ‘void free(void*)’ [-Werror=use-after-free]
 0:10.42   261 |       free(p);
 0:10.42       |       ~~~~^~~
 0:10.42 /root/firefox-gcc-last/toolkit/crashreporter/test/nsTestCrasher.cpp:260:11: note: call to ‘
void free(void*)’ here
 0:10.42   260 |       free(p);
 0:10.42       |       ~~~~^~~
 0:10.42 /root/firefox-gcc-last/toolkit/crashreporter/test/nsTestCrasher.cpp:201:7: warning: array s
ubscript 0 is outside array bounds of ‘volatile int [0]’ [-Warray-bounds=]
 0:10.42   201 |       *foo = 0;
 0:10.42       |       ^~~~
 0:10.42 cc1plus: note: source object is likely at address zero
Assignee: nobody → sledru
Status: NEW → ASSIGNED
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bf16ee951c46 nsTestCrasher.cpp: silent two -Werror=use-after-free warnings r=gsvelto

Backed out for causing build bustages in nsTestCrasher.cpp.

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: /builds/worker/checkouts/gecko/toolkit/crashreporter/test/nsTestCrasher.cpp:256:34: error: unknown option after '#pragma GCC diagnostic' kind [-Werror=pragmas]
Flags: needinfo?(sledru)

ok, i will have a look, thanks

Flags: needinfo?(sledru)

The severity field is not set for this bug.
:andi, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(bpostelnicu)
Severity: -- → S3
Flags: needinfo?(bpostelnicu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: