Skip to content

ASan: enable -disable-fp-elim by default? #2222

@JohanEngelen

Description

@JohanEngelen

Should we set -disable-fp-elim as soon as any sanitizer is set? (-fsanitize=...)

This example requires -disable-fp-elim, otherwise LLVMFuzzerTestOneInput is missing from the stacktrace (only FuzzMe is shown).

// RUN: %ldc -g -fsanitize=address,fuzzer -disable-fp-elim %s -of=%t%exe
// RUN: %t%exe 2>&1 | FileCheck %s

bool FuzzMe(ubyte* data, size_t dataSize)
{
    return dataSize >= 4 &&
           data[0] == 'F' &&
           data[1] == 'U' &&
           data[2] == 'Z' &&
           data[3] == 'Z' &&
           data[4] == 'Z'; // :‑<
}

extern (C) int LLVMFuzzerTestOneInput(const(ubyte*) data, size_t size)
{
    FuzzMe(data, size);
    return 0;
}

See the sanitizers/fuzz_asan.d test in our testsuite.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions