Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
e0236da7
Commit
e0236da7
authored
Sep 17, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure undefined behavior sanitizer crashes the programs
parent
7b04d793
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
configure.ac
configure.ac
+28
-2
tests/tests-c-compiler/check-assembly.sh
tests/tests-c-compiler/check-assembly.sh
+1
-1
No files found.
configure.ac
View file @
e0236da7
...
...
@@ -62,9 +62,15 @@ AX_CHECK_COMPILE_FLAG([-Wno-error=parentheses-equality],
[CFLAGS="$CFLAGS -Wno-error=parentheses-equality"])
AX_CHECK_COMPILE_FLAG([-std=gnu99],
[CFLAGS="$CFLAGS -std=gnu99"
TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS
-std=gnu99"])
TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS}
-std=gnu99"])
AX_CHECK_COMPILE_FLAG([-Wno-error=unused-variable],
[TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS -Wno-error=unused-variable"])
[TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -Wno-error=unused-variable"])
dnl Lower the optimization level in tests to aid debugging.
dnl AX_CHECK_COMPILE_FLAG([-O1],
dnl [TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -O1"])
dnl AX_CHECK_COMPILE_FLAG([-fno-inline],
dnl [TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -fno-inline"])
AX_CODE_COVERAGE
AS_IF([test x$enable_code_coverage != xno], [
...
...
@@ -131,6 +137,26 @@ AS_IF([test "x$disable_test_ubsan" != xno], [
[--disable-test-ubsan=$disable_test_ubsan is not supported on a target system.
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#how-to-build])])
])
AX_CHECK_COMPILE_FLAG([-fno-sanitize-recover=undefined],
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-sanitize-recover=undefined"])
dnl Unsigned integer overflow is enabled separately.
AX_CHECK_COMPILE_FLAG([-fsanitize=unsigned-integer-overflow],
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=unsigned-integer-overflow"])
AX_CHECK_COMPILE_FLAG([-fno-sanitize-recover=unsigned-integer-overflow],
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-sanitize-recover=unsigned-integer-overflow"])
dnl Nullability is enabled separately.
AX_CHECK_COMPILE_FLAG([-fsanitize=nullability],
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=nullability"])
AX_CHECK_COMPILE_FLAG([-fno-sanitize-recover=nullability],
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-sanitize-recover=nullability"])
dnl Keep error messages nice. Also consider:
dnl export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
dnl export UBSAN_OPTIONS=print_stacktrace=1
AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer],
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-omit-frame-pointer"])
])
dnl Enable Address Sanitizer, if supported by gcc (4.8+) or clang.
...
...
tests/tests-c-compiler/check-assembly.sh
View file @
e0236da7
...
...
@@ -116,7 +116,7 @@ cat <<TARGETS >> "${testdir}/Makefile.targets"
check-fuzzer:
TARGETS
else
CHECK_FUZZER
=
"./check-fuzzer -timeout=3 -max_total_time=60 -max_len=512 -detect_leaks=1"
CHECK_FUZZER
=
"
UBSAN_OPTIONS=print_stacktrace=1
./check-fuzzer -timeout=3 -max_total_time=60 -max_len=512 -detect_leaks=1"
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets"
check-fuzzer:
\$
(OBJS)
rm -f
${
source_obj
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment