mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 15:41:00 -05:00
Crash: use SA_SIGINFO on Linux for enhanced crash diagnostics
Switch signal handler registration from signal() to sigaction(SA_SIGINFO) on Linux to capture fault address, signal code description, and program counter at crash time. These are logged to the file logger and included in OpenTelemetry crash reports.
This commit is contained in:
1 parent
02416bb4c7
commit
c9b3bb4409
4 files changed
+176
-14
No files matched your search
@@ -327,7 +327,7 @@ static std::string extractRelevantPath( const std::string& fullPath )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaOpenTelemetryManager::reportCrash( int signalCode, const std::stacktrace& trace )
|
||||
void RiaOpenTelemetryManager::reportCrash( int signalCode, const std::stacktrace& trace, const std::map<std::string, std::string>& extraAttributes )
|
||||
{
|
||||
if ( !isEnabled() )
|
||||
{
|
||||
@@ -378,6 +378,12 @@ void RiaOpenTelemetryManager::reportCrash( int signalCode, const std::stacktrace
|
||||
attributes["service.name"] = RiaPreferencesOpenTelemetry::current()->serviceName().toStdString();
|
||||
attributes["service.version"] = RiaPreferencesOpenTelemetry::current()->serviceVersion().toStdString();
|
||||
|
||||
// Merge platform-specific crash context (fault address, signal code, program counter)
|
||||
for ( const auto& [key, value] : extraAttributes )
|
||||
{
|
||||
attributes[key] = value;
|
||||
}
|
||||
|
||||
// Add system information
|
||||
addOsInfo( attributes );
|
||||
|
||||
|
||||
Reference in new issue
Block a user