This is an archive of the discontinued LLVM Phabricator instance.

[asan] Print a "PC is at a non-executable memory region" message if that's the case
ClosedPublic

Authored by filcab on Feb 27 2017, 3:05 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

filcab created this revision.Feb 27 2017, 3:05 PM

We can probably remove zero_page_pc.cc since it would share a lot with this one anyway. So I added the same checks here.

kcc accepted this revision.Feb 27 2017, 4:40 PM

LGTM with a nit, nice!

lib/asan/asan_errors.cc
67 ↗(On Diff #89945)

start with "Hint: " as in some other similarplaces

This revision is now accepted and ready to land.Feb 27 2017, 4:40 PM
This revision was automatically updated to reflect the committed changes.

@filcab From the commit history it looks like this test was re-landed with a REQUIRES: linux || freebsd to fix the ppc64be sanitizer bot but those features weren't actually set on linux/freebsd until I just landed https://reviews.llvm.org/rCRT336633 so the test is failing again. http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/7924/steps/64-bit%20check-asan-dynamic/logs/stdio

Did you have a PPC environment to test this change against originally? I'm not sure what the correct fix is.

This is also failing on s390x (randomly). The problem is that we don't actually have a non-executable flag, so the processor *will* execute the contents of "array" as code. Depending on what's there (it is just uninitialized memory), this will crash sooner or later, but in a way that may or may not make the check succeed randomly.

I believe this (i.e. the "n" variant of the test) should only be attempted on architectures that are actually supposed to have non-execute protection.

I've now disabled the test on s390 to get the build bot going reliably again.

@kcc @filcab Should this test be disabled for PPC?

I've updated the test to be x86/x86_64 only in r336714