This allows us to better diagnose free() and realloc() with a bad
pointer, instead of SIGSEGV.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I'm somewhat worried about the performance implications of this. IsAccessibleMemoryRange is a syscall after all, not sure it would be nice to call it on every malloc/free. We do run non-trivial operations on these calls though, like collecting stack traces.
Comment Actions
Thanks for doing this!
One comment for the test.
test/asan/TestCases/Posix/bad-free-no-segv.cc | ||
---|---|---|
15 | I'd prefer the test to use a separate mprotec-ted chunk, not the shadow gap. |
lib/asan/asan_allocator.cc | ||
---|---|---|
527 | Oh, yes, I've totally missed this. For some reason I thought this is on the error-reporting path. |
Oh, yes, I've totally missed this. For some reason I thought this is on the error-reporting path.
Thanks Alexey.
Yes, on the main path we can't do this.