Skip to content

reporter_junit causes segfault with clang 16 #566

@wirew0rm

Description

@wirew0rm

Expected Behavior

Clang 16 seems to be in the set of supported compilers and UT should work there generally.

Actual Behavior

When testing with clang 16 I experienced segfaults for all UT tests.

Small reproducer on compiler explorer: https://godbolt.org/z/dvxezoTsP (exit code 139 is the container way of reporting segfault), locally I get a segfault.

The debugger points to the redirection of the output stream buffers as a possible cause, but I didn't manage to fix it and it seems to me that all buffers get reconfigured correctly. Maybe someone else sees what the problem is.

image

Workaround

Falling back to the more basic reporter resolves the issue (but of course looses a lot of nice features).

#if defined(__clang__) && __clang_major__ >= 16
// clang 16 does not like ut's default reporter_junit due to some issues with stream buffers and output redirection
template <>
auto boost::ut::cfg<boost::ut::override> = boost::ut::runner<boost::ut::reporter<>>{};
#endif

Specifications

  • Version: master
  • Platform: linux + clang 16.0.1
  • Subsystem: reporter

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