| 39 | } // namespace NPrivate |
| 40 | |
| 41 | void ::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 | |
| 63 | namespace 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 { |
nothing calls this directly
no test coverage detected