folly::symbolizer

Stack trace capture and symbolization utilities.

Types

NameDescription
AddressFormatter Format one address in the way it's usually printed by SymbolizePrinter. Async-signal-safe.
ElfFile A memory-mapped ELF object file.
FDSymbolizePrinter Print a list of symbolized addresses to a file descriptor. Ignores errors. Async-signal-safe.
FILESymbolizePrinter Print a list of symbolized addresses to a FILE*. Ignores errors. Not reentrant. Do not use from signal handling code.
FrameArray A fixed-capacity array of captured addresses and their symbolized frames.
LineReader Async-signal-safe line reader.
LocationInfo Contains location info like file name, line number, etc.
OStreamSymbolizePrinter Print a list of symbolized addresses to a stream. Not reentrant. Do not use from signal handling code.
Path Represent a file path as a collection of three parts (base directory, subdirectory, and file).
SafeStackTracePrinter Use this class to print a stack trace from a signal handler, or other place where you shouldn't allocate memory on the heap, and fsync()ing your file descriptor is more important than performance.
StringSymbolizePrinter Print a list of symbolized addresses to a std::string. Not reentrant. Do not use from signal handling code.
SymbolCacheBase A cache of symbolized frames, keyed by instruction address.
SymbolizePrinter Print a list of symbolized addresses. Base class.
SymbolizedFrame Frame information: symbol name and location.

Type Aliases

NameDescription
CachedSymbolizedFrames Symbolized frames for a single address: the stacked inline calls, if any, followed by the non-inlined call. Most addresses have no inlined frames, so optimize for the single-entry case.
SignalCallback Add a callback to be run when receiving a fatal signal. They will also be called by LOG(FATAL) and abort() (as those raise SIGABRT internally).

Enums

NameDescription
LocationInfoMode How aggressively to resolve source location information.

Functions

NameDescription
addFatalSignalCallback Register a callback to be run when a fatal signal is received.
fatalSignalReceived True if a fatal signal was received (i.e. the process is crashing).
getAsyncStackTraceSafe getAsyncStackTraceSafe overloads
getAsyncStackTraceStr Async stack trace as a string; empty when symbolization is unavailable.
getSharedSymbolCache The process-wide cache for mode.
getStackTrace getStackTrace overloads
getStackTraceHeap getStackTraceHeap overloads
getStackTraceSafe getStackTraceSafe overloads
getStackTraceStr getStackTraceStr overloads
getSuspendedStackTraces Async stack traces for suspended coroutines; empty when unavailable.
installFatalSignalCallbacks Install the fatal signal callbacks; fatal signals will call these callbacks in the order in which they were added.
installFatalSignalHandler Install handler for fatal signals. The list of signals being handled is in SignalHandler.cpp.
makeGenerationalSymbolCache A cache of roughly capacity entries, backed by a folly::GenerationalCacheMap: lookups are lock-free, and an address that stops appearing in stack traces is eventually evicted in favour of one that does.
makeLruSymbolCache An LRU cache of capacity entries, backed by a Synchronized EvictingCacheMap.
makeNullSymbolCache A cache that stores nothing.
operator<< Write a Path to an output stream.

Variables

NameDescription
kAllFatalSignals Bitmask of all fatal signals handled by the symbolizer signal handler.