Skip to content

Segmentation fault during coverage collection #52617

@pavelkryukov

Description

@pavelkryukov

I observe segmentation fault while collecting code coverage.
The binary is built with Clang 11: clang++ test.cpp --coverage -std=c++17 -g -O0

If code coverage is disabled during the build, or code is insignificantly changed, segfault disappears.
Address sanitizer shows no warnings regardless of coverage enablement.

Compiler Explorer link: https://godbolt.org/z/n53ETGrMz
You can substitute some code lines with commented ones to make segfault disappear.
Strangely, error appears while using std::reverse_iterator instead of Boost one.

I could not reproduce it with Clang 12 or newer, but there might be "dynamic" changes to hide the root causes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other categorycoverage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions