Skip to content

[CMake] sanitizer is forced to "address sanitizer" #1124

Description

@vrabaud

In fuzzing mode or compatibility mode, address sanitizer is forced.

if (FUZZTEST_FUZZING_MODE OR (FUZZTEST_COMPATIBILITY_MODE STREQUAL "libfuzzer"))
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -UNDEBUG -fsanitize=address")

This is problematic on oss-fuzz which has different sanitizers. We therefore remove those flags https://github.com/AOMediaCodec/libavif/blob/d074bae4b0b1d7423d102f6d9d5e0c5303971a51/ext/fuzztest.cmd#L14 and use the ones set in the environment variable CXXFLAGS by oss-fuzz.

I believe those sanitizer flags should only be set for FUZZTEST_FUZZING_MODE, not when FUZZTEST_COMPATIBILITY_MODE STREQUAL "libfuzzer").

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions