| OLD | NEW |
| 1 Using AddressSanitizer in Subzero | 1 Using AddressSanitizer in Subzero |
| 2 ================================= | 2 ================================= |
| 3 | 3 |
| 4 AddressSanitizer is a powerful compile-time tool used to detect and report | 4 AddressSanitizer is a powerful compile-time tool used to detect and report |
| 5 illegal memory accesses. For a full description of the tool, see the original | 5 illegal memory accesses. For a full description of the tool, see the original |
| 6 `paper | 6 `paper |
| 7 <https://www.usenix.org/system/files/conference/atc12/atc12-final39.pdf>`_. | 7 <https://www.usenix.org/system/files/conference/atc12/atc12-final39.pdf>`_. |
| 8 AddressSanitizer is only supported on native builds of .pexe files and cannot be | 8 AddressSanitizer is only supported on native builds of .pexe files and cannot be |
| 9 used in production. | 9 used in production. |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 pydir/szbuild.py --fsanitize-address hello.pexe | 36 pydir/szbuild.py --fsanitize-address hello.pexe |
| 37 | 37 |
| 38 Handling Wide Loads | 38 Handling Wide Loads |
| 39 =================== | 39 =================== |
| 40 | 40 |
| 41 Since AddressSanitizer is implemented only in Subzero, the target .pexe may | 41 Since AddressSanitizer is implemented only in Subzero, the target .pexe may |
| 42 contain widened loads that would cause false positives. To avoid reporting such | 42 contain widened loads that would cause false positives. To avoid reporting such |
| 43 loads as errors, we treat any word-aligned, four byte load as a potentially | 43 loads as errors, we treat any word-aligned, four byte load as a potentially |
| 44 widened load and only check the first byte of the loaded word against shadow | 44 widened load and only check the first byte of the loaded word against shadow |
| 45 memory. | 45 memory. |
| 46 |
| 47 Building SPEC2000 Benchmark Suite |
| 48 ================================= |
| 49 |
| 50 Most of the SPEC2000 benchmarks can be built with Subzero and AddressSanitizer, |
| 51 however due to the nature of our solution for LLVM's aggressive inlining of |
| 52 calloc, 300.twolf and 252.eon will not build. AddressSanitizer correctly finds |
| 53 bugs in 197.parser and 253.perlbmk. 176.gcc crashes for unknown reasons. Among |
| 54 the benchmarks that do run to completion, the average slowdown introduced is |
| 55 4.6x. |
| 56 |
| 57 To build the benchmarks with AddressSanitizer, some small changes to the |
| 58 Makefile are needed. They can be found `here |
| 59 <https://codereview.chromium.org/2266553002/>`_. |
| 60 |
| 61 Once the Makefile has been patched, build and run with these commands:: |
| 62 |
| 63 cd native_client/tests/spec2k |
| 64 ./run_all.sh BuildBenchmarks 0 SetupPnaclX8632Opt <benchmarks> |
| 65 ../../toolchain_build/src/subzero/pydir/szbuild_spec2k.py -v -O2 \ |
| 66 --fsanitize-address <benchmarks> |
| 67 ./run_all.sh RunTimedBenchmarks SetupGccX8632Opt train <benchmarks> |
| OLD | NEW |