Skip to content

Commit fa35aa7

Browse files
committed
Add segfault debugging to unit test binaries
1 parent 929c7a9 commit fa35aa7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1717
- Refactored documentation
1818
- External libraries aren't forcibly installed via the Arduino binary (in `arduino_cmd_remote.rb`) if they appear to exist on disk already
1919
- `attachInterrupt` and `detachInterrupt` are now mocked instead of `_NOP`
20+
- Unit test binaries now run with debugging symbols and address sanitization, to help isolate the causes of segfaults
2021

2122
### Deprecated
2223

lib/arduino_ci/cpp_library.rb

+6
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g
211211
File.delete(executable) if File.exist?(executable)
212212
args = [
213213
["-std=c++0x", "-o", executable, "-DARDUINO=100"],
214+
[ # Stuff to help with dynamic memory mishandling
215+
"-g", "-O1",
216+
"-fno-omit-frame-pointer",
217+
"-fno-optimize-sibling-calls",
218+
"-fsanitize=address"
219+
],
214220
test_args(aux_libraries, ci_gcc_config),
215221
cpp_files_libraries(aux_libraries),
216222
[test_file],

0 commit comments

Comments
 (0)