You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/HotspotCrashLogParserTest.java
+51Lines changed: 51 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@
13
13
importjava.io.InputStream;
14
14
importjava.io.InputStreamReader;
15
15
importjava.nio.charset.StandardCharsets;
16
+
importjava.util.Map;
16
17
importjava.util.Objects;
17
18
importjava.util.UUID;
18
19
importjava.util.stream.Collectors;
@@ -68,6 +69,12 @@ public void testRegisterParsingMacosAarch64() throws Exception {
"0x0000000106c1ccc0: _ZN19TemplateInterpreter13_active_tableE+0 in /redacted/redacted/redacted/redacted/redacted/redacted/redacted/redacted/redacted/server/libjvm.dylib at 0x0000000105efc000");
117
+
118
+
// "Top of Stack: (sp=0x...)" and "Instructions: (pc=0x...)" must not leak into register values
119
+
assertThat(mapping).doesNotContainKey("Top of Stack");
120
+
assertThat(mapping)
121
+
.allSatisfy(
122
+
(k, v) -> assertThat(v).doesNotContain("Top of Stack:", "Instructions:"));
123
+
124
+
// sp is the last register before "Top of Stack:" — its value must be clean
125
+
assertThat(mapping)
126
+
.extractingByKey("sp", STRING)
127
+
.isEqualTo("0x000000016feee0f0 is pointing into the stack for thread: 0x0000000100a153f0");
128
+
}
129
+
79
130
/** Linux aarch64 uses uppercase register names: R0-R30 */
"0x0000ffff9efa1650: <offset 0x0000000000e01650> in /opt/company/lib/server/app.so at 0x0000ffff9e1a0000"))
131
131
.isEqualTo(
132
132
"0x0000ffff9efa1650: <offset 0x0000000000e01650> in /redacted/redacted/redacted/server/app.so at 0x0000ffff9e1a0000");
133
133
}
134
134
135
+
@Test
136
+
voidtestRedactLibraryPath_symbolOffsetFormat() {
137
+
// macOS/Linux: dladdr resolved a C++ mangled symbol — "symbol+offset in /path at 0x..."
138
+
assertThat(
139
+
RedactUtils.redactLibraryPath(
140
+
"0x0000000106c1ccc0: _ZN19TemplateInterpreter13_active_tableE+0 in /Users/USER/.local/share/mise/installs/java/25.0.2/lib/server/libjvm.dylib at 0x0000000105efc000"))
141
+
.isEqualTo(
142
+
"0x0000000106c1ccc0: _ZN19TemplateInterpreter13_active_tableE+0 in /redacted/redacted/redacted/redacted/redacted/redacted/redacted/redacted/redacted/server/libjvm.dylib at 0x0000000105efc000");
143
+
}
144
+
145
+
@Test
146
+
voidtestRedactLibraryPath_cSymbolFormat() {
147
+
// macOS: C symbol "symbol+0 in /usr/lib/system/lib.dylib at 0x..."
148
+
assertThat(
149
+
RedactUtils.redactLibraryPath(
150
+
"0x0000000182d709d0: pthread_jit_write_protect_np+0 in /usr/lib/system/libsystem_pthread.dylib at 0x0000000182d69000"))
151
+
.isEqualTo(
152
+
"0x0000000182d709d0: pthread_jit_write_protect_np+0 in /redacted/redacted/system/libsystem_pthread.dylib at 0x0000000182d69000");
0 commit comments