-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #44410 - alexcrichton:fix-travis, r=Mark-Simulacrum
Fix sanitizer tests on buggy kernels Travis recently pushed an update to the Linux environments, namely the kernels that we're running on. This in turn caused some of the sanitizer tests we run to fail. We also apparently weren't the first to hit these failures! Detailed in google/sanitizers#837 these tests were failing due to a specific commit in the kernel which has since been backed out, but for now work around the buggy kernel that's deployed on Travis and eventually we should be able to remove these flags.
- Loading branch information
Showing
4 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
-include ../tools.mk | ||
|
||
LOG := $(TMPDIR)/log.txt | ||
|
||
# This test builds a shared object, then an executable that links it as a native | ||
# rust library (constrast to an rlib). The shared library and executable both | ||
# are compiled with address sanitizer, and we assert that a fault in the cdylib | ||
# is correctly detected. | ||
|
||
ifeq ($(TARGET),x86_64-unknown-linux-gnu) | ||
ASAN_SUPPORT=$(SANITIZER_SUPPORT) | ||
EXTRA_RUSTFLAG= | ||
|
||
# See comment in sanitizer-address/Makefile for why this is here | ||
EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic | ||
endif | ||
|
||
all: | ||
ifeq ($(ASAN_SUPPORT),1) | ||
$(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) library.rs | ||
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs | ||
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | grep -q stack-buffer-overflow | ||
$(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs | ||
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs | ||
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | tee $(LOG) | ||
grep -q stack-buffer-overflow $(LOG) | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
-include ../tools.mk | ||
|
||
LOG := $(TMPDIR)/log.txt | ||
|
||
# This test builds a shared object, then an executable that links it as a native | ||
# rust library (constrast to an rlib). The shared library and executable both | ||
# are compiled with address sanitizer, and we assert that a fault in the dylib | ||
# is correctly detected. | ||
|
||
ifeq ($(TARGET),x86_64-unknown-linux-gnu) | ||
ASAN_SUPPORT=$(SANITIZER_SUPPORT) | ||
EXTRA_RUSTFLAG= | ||
|
||
# See comment in sanitizer-address/Makefile for why this is here | ||
EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic | ||
endif | ||
|
||
all: | ||
ifeq ($(ASAN_SUPPORT),1) | ||
$(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) library.rs | ||
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs | ||
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | grep -q stack-buffer-overflow | ||
$(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs | ||
$(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs | ||
LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | tee $(LOG) | ||
grep -q stack-buffer-overflow $(LOG) | ||
endif | ||
|