[PATCH] gitlab-ci.yml: Use unrecoverable address sanitizer

Thomas Huth posted 1 patch 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210331160546.3071575-1-thuth@redhat.com
Maintainers: Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Willian Rampazzo <willianr@redhat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
.gitlab-ci.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] gitlab-ci.yml: Use unrecoverable address sanitizer
Posted by Thomas Huth 3 years ago
Make sure that errors don't go unnoticed by using the unrecoverable
sanitizer switch here, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4c43dd2570..846d3932cf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -661,7 +661,8 @@ build-oss-fuzz:
     IMAGE: fedora
   script:
     - mkdir build-oss-fuzz
-    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
+    - CC="clang" CXX="clang++"
+      CFLAGS="-fsanitize=address -fno-sanitize-recover=address"
       ./scripts/oss-fuzz/build.sh
     - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
     - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
-- 
2.27.0


Re: [PATCH] gitlab-ci.yml: Use unrecoverable address sanitizer
Posted by Alexander Bulekov 3 years ago
On 210331 1805, Thomas Huth wrote:
> Make sure that errors don't go unnoticed by using the unrecoverable
> sanitizer switch here, too.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---

I thought sanitizer recovery is disabled by default for ASan. I've only
seen it enabled by default for UBSan. The docs seem to hint at this as
well [1]. Was there something specific in the CI logs that went
unnoticed?

[1] https://github.com/llvm/llvm-project/blame/04f10ab367b5c547f5de3285890e74146a5949b0/clang/docs/UsersManual.rst#L1579
(No clue how to properly view non-rendered markdown on github, without
the blame ui)

-Alex

>  .gitlab-ci.yml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 4c43dd2570..846d3932cf 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -661,7 +661,8 @@ build-oss-fuzz:
>      IMAGE: fedora
>    script:
>      - mkdir build-oss-fuzz
> -    - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
> +    - CC="clang" CXX="clang++"
> +      CFLAGS="-fsanitize=address -fno-sanitize-recover=address"
>        ./scripts/oss-fuzz/build.sh
>      - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
>      - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
> -- 
> 2.27.0
> 

Re: [PATCH] gitlab-ci.yml: Use unrecoverable address sanitizer
Posted by Thomas Huth 3 years ago
On 31/03/2021 18.36, Alexander Bulekov wrote:
> On 210331 1805, Thomas Huth wrote:
>> Make sure that errors don't go unnoticed by using the unrecoverable
>> sanitizer switch here, too.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
> 
> I thought sanitizer recovery is disabled by default for ASan. I've only
> seen it enabled by default for UBSan. The docs seem to hint at this as
> well [1]. Was there something specific in the CI logs that went
> unnoticed?

Oh, you're right. I just wanted to turn this on pro-actively, but also the 
GCC man page says: "... error recovery is turned on by default, except 
-fsanitize=address ...".

So never mind, this patch is not required.

Thanks,
  Thomas