MCPcopy Create free account
hub / github.com/catboost/catboost / InternalPanicImpl

Function InternalPanicImpl

util/system/yassert.cpp:64–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63namespace NPrivate {
64 [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept try {
65 TStringBuf errorMsg{errorMessage, errorMessageSize};
66 const TString now = TInstant::Now().ToStringLocal();
67
68 TString r;
69 TStringOutput o(r);
70 if (expr) {
71 o << "VERIFY failed (" << now << "): " << errorMsg << Endl;
72 } else {
73 o << "FAIL (" << now << "): " << errorMsg << Endl;
74 }
75 o << " " << file << ":" << line << Endl;
76 if (expr) {
77 o << " " << function << "(): requirement " << expr << " failed" << Endl;
78 } else {
79 o << " " << function << "() failed" << Endl;
80 }
81
82 TString backTrace;
83#ifndef WITH_VALGRIND
84 try {
85 TStringOutput backTraceOutput(backTrace);
86 FormatBackTrace(&backTraceOutput);
87 } catch (...) {
88 backTrace = "Failed to print backtrace due: " + CurrentExceptionMessage() + "\n";
89 }
90#endif
91 o << backTrace;
92 Cerr << r << Flush;
93#ifdef CLANG_COVERAGE
94 if (__llvm_profile_write_file()) {
95 Cerr << "Failed to dump clang coverage" << Endl;
96 }
97#endif
98 abort();
99 } catch (...) {
100 abort();
101 }
102} // namespace NPrivate

Callers 1

PanicMethod · 0.85

Calls 5

FormatBackTraceFunction · 0.85
CurrentExceptionMessageFunction · 0.85
ToStringLocalMethod · 0.80
NowFunction · 0.50

Tested by

no test coverage detected