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

Method Panic

util/system/yassert.cpp:41–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39} // namespace NPrivate
40
41void ::NPrivate::Panic(const TStaticBuf& file, int line, const char* function, const char* expr, const char* format, ...) noexcept {
42 try {
43 // We care of panic of first failed thread only
44 // Otherwise stderr could contain multiple messages and stack traces shuffled
45 auto guard = Guard(*Singleton<TPanicLockHolder>());
46
47 TString errorMsg;
48 va_list args;
49 va_start(args, format);
50 // format has " " prefix to mute GCC warning on empty format
51 vsprintf(errorMsg, format[0] == ' ' ? format + 1 : format, args);
52 va_end(args);
53
54 constexpr int abiPlaceholder = 0;
55 ::NPrivate::InternalPanicImpl(line, function, expr, abiPlaceholder, abiPlaceholder, abiPlaceholder, file.As<TStringBuf>(), errorMsg.c_str(), errorMsg.size());
56 } catch (...) {
57 // ¯\_(ツ)_/¯
58 }
59
60 abort();
61}
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 {

Callers

nothing calls this directly

Calls 5

GuardFunction · 0.85
vsprintfFunction · 0.85
InternalPanicImplFunction · 0.85
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected