Open opmtk opened 1 week ago
Describe the bug
The following
try { std::string a{ "string" }; std::string const expected{ "string" }; REQUIRE_THAT(a, Matches(expected)); } catch (std::exception const& e) { std::cerr << std::format("caught '{}'\n", e.what()); }
works as expected. If I get a bigger expected string (e.g. ~110kByte) it crashes with
... [ctest] due to a fatal error condition: [ctest] SIGSEGV - Segmentation violation signal
The problem is related to the Matches matcher - the following doesn't crash:
Matches
// Catch2's matchers haven't support for string_view std::string const expected_str{ csv_data::CsvSV }; try { std::string a{ "string" }; REQUIRE_THAT(expected_str, Matches(a)); } catch (std::exception const& e) { std::cerr << std::format("caught '{}'\n", e.what()); }
Expected behavior I must not crash in that way, even I've a try/catch block/scope!
Reproduction steps
See above.
Platform information:
Additional context
constexpr std::string_view const CsvSV = R"(0,0.999994607194946,... ... ...,0.783392372240895 )";
I can't reproduce this locally, nor on CE.
Are you sure that the segfault comes from the StringMatcher?
Describe the bug
The following
works as expected. If I get a bigger expected string (e.g. ~110kByte) it crashes with
The problem is related to the
Matches
matcher - the following doesn't crash:Expected behavior I must not crash in that way, even I've a try/catch block/scope!
Reproduction steps
See above.
Platform information:
Additional context