This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81524] Bogus or missing warnings when dereferencing pointer to deallocated stack memory
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Jul 2017 08:08:19 +0000
- Subject: [Bug c/81524] Bogus or missing warnings when dereferencing pointer to deallocated stack memory
- Auto-submitted: auto-generated
- References: <bug-81524-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81524
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Fredrik Hederstierna from comment #3)
> Isn't AddressSanitizer checking in run-time? There are several tools that
> can find this bugs in runtime I think like Valgrind, but I need to find this
> at compile-time.
Yes, it's run-time checking.
>
> I use embedded arm-eabi target and cannot add memory for instrumentation
> with compile AddressSanitizer, or can AddressSanitizer do jobs alos in
> compile-time without adding code size for run-time instrumentation?
No, it verifies stuff just in compile time. Well I understand the arm-eabi is
not a good target for AddressSanization. Maybe you will be able to run the code
on x86_64 in a testing environment where you can catch various undefined
behavior stuff.
Please be note that AddressSanitizer is much powerful tool that a compile-time
checking, because due to multiple compilation modules or conservative
assumptions that compiler has to do, one can't find these issues in compile
time.