forked from OSchip/llvm-project
[asan] Also allow for SIGBUS in high-address-dereference.c
FreeBSD delivers a SIGBUS signal for bad addresses rather than SIGSEGV. Reviewed By: #sanitizers, vitalybuka, yln Differential Revision: https://reviews.llvm.org/D85409
This commit is contained in:
parent
ee2fdedd84
commit
5695fa9190
|
@ -293,7 +293,7 @@ uptr SignalContext::GetAddress() const {
|
||||||
|
|
||||||
bool SignalContext::IsMemoryAccess() const {
|
bool SignalContext::IsMemoryAccess() const {
|
||||||
auto si = static_cast<const siginfo_t *>(siginfo);
|
auto si = static_cast<const siginfo_t *>(siginfo);
|
||||||
return si->si_signo == SIGSEGV;
|
return si->si_signo == SIGSEGV || si->si_signo == SIGBUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SignalContext::GetType() const {
|
int SignalContext::GetType() const {
|
||||||
|
|
|
@ -25,8 +25,8 @@ int main(int argc, const char *argv[]) {
|
||||||
// ZERO: SEGV on unknown address 0x000000000000 (pc
|
// ZERO: SEGV on unknown address 0x000000000000 (pc
|
||||||
// LOW1: SEGV on unknown address 0x000000000fff (pc
|
// LOW1: SEGV on unknown address 0x000000000fff (pc
|
||||||
// LOW2: SEGV on unknown address 0x000000001000 (pc
|
// LOW2: SEGV on unknown address 0x000000001000 (pc
|
||||||
// HIGH: SEGV on unknown address (pc
|
// HIGH: {{BUS|SEGV}} on unknown address (pc
|
||||||
// MAX: SEGV on unknown address (pc
|
// MAX: {{BUS|SEGV}} on unknown address (pc
|
||||||
|
|
||||||
// HINT-PAGE0-NOT: Hint: this fault was caused by a dereference of a high value address
|
// HINT-PAGE0-NOT: Hint: this fault was caused by a dereference of a high value address
|
||||||
// HINT-PAGE0: Hint: address points to the zero page.
|
// HINT-PAGE0: Hint: address points to the zero page.
|
||||||
|
@ -40,8 +40,8 @@ int main(int argc, const char *argv[]) {
|
||||||
// ZERO: SCARINESS: 10 (null-deref)
|
// ZERO: SCARINESS: 10 (null-deref)
|
||||||
// LOW1: SCARINESS: 10 (null-deref)
|
// LOW1: SCARINESS: 10 (null-deref)
|
||||||
// LOW2: SCARINESS: 20 (wild-addr-read)
|
// LOW2: SCARINESS: 20 (wild-addr-read)
|
||||||
// HIGH: SCARINESS: 20 (wild-addr-read)
|
// HIGH: SCARINESS: {{(20 \(wild-addr-read\))|(60 \(wild-jump\))}}
|
||||||
// MAX: SCARINESS: 20 (wild-addr-read)
|
// MAX: SCARINESS: {{(20 \(wild-addr-read\))|(60 \(wild-jump\))}}
|
||||||
|
|
||||||
// TODO: Currently, register values are only printed on Mac. Once this changes,
|
// TODO: Currently, register values are only printed on Mac. Once this changes,
|
||||||
// remove the 'TODO_' prefix in the following lines.
|
// remove the 'TODO_' prefix in the following lines.
|
||||||
|
|
Loading…
Reference in New Issue