From d76cdd5140f97defdb6a51c416e83b5a47c2f50e Mon Sep 17 00:00:00 2001 From: Hongyan Jiang Date: Thu, 16 Nov 2023 00:21:48 -0800 Subject: [PATCH] Add more raw crash payload info to stackTrace --- Changelog.md | 3 +++ InstanaAgent.podspec | 2 +- .../InstanaAgent/Configuration/Defines.swift | 2 +- .../Configuration/VersionConfig.swift | 2 +- .../DiagnosticSymbolicator.swift | 3 ++- .../Metric/Symbolication/StackTrace.swift | 21 ++++++++++++------- .../InstanaSystemUtilsTests.swift | 2 +- 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Changelog.md b/Changelog.md index 45f53f8..67bc9a8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,8 @@ # Changelog +## 1.6.7 +- Add more raw crash payload info to stackTrace + ## 1.6.6 - Fix client side crash symbolication for arm64e architecture - Fix unit test cases that failed in command line execution diff --git a/InstanaAgent.podspec b/InstanaAgent.podspec index 392825a..fcbb927 100644 --- a/InstanaAgent.podspec +++ b/InstanaAgent.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "InstanaAgent" - s.version = "1.6.6" + s.version = "1.6.7" s.summary = "Instana iOS agent." # This description is used to generate tags and improve search results. diff --git a/Sources/InstanaAgent/Configuration/Defines.swift b/Sources/InstanaAgent/Configuration/Defines.swift index 3c73019..1e323dd 100644 --- a/Sources/InstanaAgent/Configuration/Defines.swift +++ b/Sources/InstanaAgent/Configuration/Defines.swift @@ -44,7 +44,7 @@ let crashMetaKeyUserID = "ui" let crashMetaKeyUserName = "un" let crashMetaKeyUserEmail = "ue" -let currentInstanaCrashPayloadVersion = "0.92" +let currentInstanaCrashPayloadVersion = "0.93" let defaultCrashViewName = "CrashView" let maxSecondsToKeepCrashLog = (maxDaysToKeepCrashLog * 60 * 60 * 24) diff --git a/Sources/InstanaAgent/Configuration/VersionConfig.swift b/Sources/InstanaAgent/Configuration/VersionConfig.swift index 9e2de0e..137ecc2 100644 --- a/Sources/InstanaAgent/Configuration/VersionConfig.swift +++ b/Sources/InstanaAgent/Configuration/VersionConfig.swift @@ -1,3 +1,3 @@ struct VersionConfig { - static let agentVersion = "1.6.6" + static let agentVersion = "1.6.7" } diff --git a/Sources/InstanaAgent/Monitors/Metric/Symbolication/DiagnosticSymbolicator.swift b/Sources/InstanaAgent/Monitors/Metric/Symbolication/DiagnosticSymbolicator.swift index 2a962e4..4ffa91d 100644 --- a/Sources/InstanaAgent/Monitors/Metric/Symbolication/DiagnosticSymbolicator.swift +++ b/Sources/InstanaAgent/Monitors/Metric/Symbolication/DiagnosticSymbolicator.swift @@ -119,8 +119,9 @@ struct DiagnosticSymbolicator { } stThread.appendFrame(name: frame.binaryName!, address: String(format: "0x%llx", frame.address!), + offsetIntoBinaryTextSegment: String(frame.offsetIntoBinaryTextSegment!), symbol: stSymbol, - offset: stOffset) + symbolOffset: stOffset) } stackTrace.appendThread(stThread: stThread) } diff --git a/Sources/InstanaAgent/Monitors/Metric/Symbolication/StackTrace.swift b/Sources/InstanaAgent/Monitors/Metric/Symbolication/StackTrace.swift index 2959948..1c9163a 100644 --- a/Sources/InstanaAgent/Monitors/Metric/Symbolication/StackTrace.swift +++ b/Sources/InstanaAgent/Monitors/Metric/Symbolication/StackTrace.swift @@ -71,29 +71,36 @@ class StThread: Codable { frames = [] } - func appendFrame(name: String, address: String, symbol: String?, offset: String?) { - frames.append(StFrame(name: name, address: address, symbol: symbol, offset: offset)) + func appendFrame(name: String, address: String, offsetIntoBinaryTextSegment: String, + symbol: String?, symbolOffset: String?) { + frames.append(StFrame(name: name, address: address, + offsetIntoBinaryTextSegment: offsetIntoBinaryTextSegment, + symbol: symbol, symbolOffset: symbolOffset)) } } struct StFrame: Codable { let name: String - let address: String + let address: String // raw crash payload address + let offsetIntoBinaryTextSegment: String // raw crash payload offsetIntoBinaryTextSegment let symbol: String? - let offset: String? + let symbolOffset: String? private enum CodingKeys: String, CodingKey { case name = "n" case address = "a" + case offsetIntoBinaryTextSegment = "o" case symbol = "f" - case offset = "o" + case symbolOffset = "o2" } - init(name: String, address: String, symbol: String?, offset: String?) { + init(name: String, address: String, offsetIntoBinaryTextSegment: String, + symbol: String?, symbolOffset: String?) { self.name = name self.address = address + self.offsetIntoBinaryTextSegment = offsetIntoBinaryTextSegment self.symbol = symbol - self.offset = offset + self.symbolOffset = symbolOffset } } diff --git a/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift b/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift index 532062d..50656c6 100644 --- a/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift +++ b/Tests/InstanaAgentTests/Configuration/InstanaSystemUtilsTests.swift @@ -5,7 +5,7 @@ class InstanaSystemUtilsTests: InstanaTestCase { func test_AgentVersion() { // Then - AssertTrue(InstanaSystemUtils.agentVersion == "1.6.6") + AssertTrue(InstanaSystemUtils.agentVersion == "1.6.7") } func test_systemVersion() {