diff --git a/nativeunwind/elfunwindinfo/elfehframe_aarch64.go b/nativeunwind/elfunwindinfo/elfehframe_aarch64.go index 0d9c85260..a4a19cfaa 100644 --- a/nativeunwind/elfunwindinfo/elfehframe_aarch64.go +++ b/nativeunwind/elfunwindinfo/elfehframe_aarch64.go @@ -144,19 +144,11 @@ func (regs *vmRegs) getUnwindInfoARM() sdtypes.UnwindInfo { info.FPOpcode = support.UnwindOpcodeBaseLR info.FPParam = 0 case regCFA: - if regs.cfa.off != 0 { - // In ARM64, nothing can be assumed regarding RA location, it is - // simply somewhere on the stack, its detailed location needs to - // be extracted from FDE record. - // In our approach, RA offset part of stack delta always points - // to RA location no matter whether CFA is evaluated with respect - // to SP or FP. - // Use same opcode as for CFA: - info.FPOpcode = info.Opcode - // Convert CFA base to SP / FP base in order to keep - // offset to RA from frame bottom (FP based heuristic). - // CFA offset needs to be added to the one denoting RA location. - info.FPParam = int32(regs.cfa.off) + int32(regs.ra.off) + info.FPParam = int32(regs.ra.off) + if regs.fp.reg == regCFA && regs.fp.off+8 == regs.ra.off { + info.FPOpcode = support.UnwindOpcodeBaseCFAFrame + } else { + info.FPOpcode = support.UnwindOpcodeBaseCFA } } diff --git a/support/ebpf/native_stack_trace.ebpf.c b/support/ebpf/native_stack_trace.ebpf.c index 85727ff2f..847a433d3 100644 --- a/support/ebpf/native_stack_trace.ebpf.c +++ b/support/ebpf/native_stack_trace.ebpf.c @@ -300,6 +300,9 @@ static EBPF_INLINE u64 unwind_register_address(UnwindState *state, u64 cfa, u8 o // Resolve the 'BASE' register, and fetch the CFA/FP/SP value. switch (opcode & ~UNWIND_OPCODEF_DEREF) { +#if defined(__aarch64__) + case UNWIND_OPCODE_BASE_CFA_FRAME: +#endif case UNWIND_OPCODE_BASE_CFA: addr = cfa; break; case UNWIND_OPCODE_BASE_FP: addr = state->fp; break; case UNWIND_OPCODE_BASE_SP: addr = state->sp; break; @@ -342,6 +345,9 @@ static EBPF_INLINE u64 unwind_register_address(UnwindState *state, u64 cfa, u8 o #ifdef OPTI_DEBUG switch (opcode) { case UNWIND_OPCODE_BASE_CFA: DEBUG_PRINT("unwind: cfa+%d", preDeref); break; + #if defined(__aarch64__) + case UNWIND_OPCODE_BASE_CFA_FRAME: DEBUG_PRINT("unwind (fp+ra): cfa+%d", preDeref - 8); break; + #endif case UNWIND_OPCODE_BASE_FP: DEBUG_PRINT("unwind: fp+%d", preDeref); break; case UNWIND_OPCODE_BASE_SP: DEBUG_PRINT("unwind: sp+%d", preDeref); break; case UNWIND_OPCODE_BASE_CFA | UNWIND_OPCODEF_DEREF: @@ -569,7 +575,18 @@ static EBPF_INLINE ErrorCode unwind_one_frame(struct UnwindState *state, bool *s DEBUG_PRINT("RA: %016llX", (u64)ra); // read the value of RA from stack - if (bpf_probe_read_user(&state->pc, sizeof(state->pc), (void *)ra)) { + int err; + u64 fpra[2]; + fpra[0] = state->fp; + if (info->fpOpcode == UNWIND_OPCODE_BASE_CFA_FRAME) { + err = bpf_probe_read_user(fpra, sizeof(fpra), (void *)(ra - 8)); + } else { + err = bpf_probe_read_user(&fpra[1], sizeof(fpra[0]), (void *)ra); + } + if (!err) { + state->fp = fpra[0]; + state->pc = fpra[1]; + } else { // error reading memory, mark RA as invalid ra = 0; } @@ -586,22 +603,6 @@ static EBPF_INLINE ErrorCode unwind_one_frame(struct UnwindState *state, bool *s return ERR_NATIVE_PC_READ; } - // Try to resolve frame pointer - // simple heuristic for FP based frames - // the GCC compiler usually generates stack frame records in such a way, - // so that FP/RA pair is at the bottom of a stack frame (stack frame - // record at lower addresses is followed by stack vars at higher ones) - // this implies that if no other changes are applied to the stack such - // as alloca(), following the prolog SP/FP points to the frame record - // itself, in such a case FP offset will be equal to 8 - if (info->fpParam == 8) { - // we can assume the presence of frame pointers - if (info->fpOpcode != UNWIND_OPCODE_BASE_LR) { - // FP precedes the RA on the stack (Aarch64 ABI requirement) - bpf_probe_read_user(&state->fp, sizeof(state->fp), (void *)(ra - 8)); - } - } - state->sp = cfa; unwinder_mark_nonleaf_frame(state); frame_ok: diff --git a/support/ebpf/stackdeltatypes.h b/support/ebpf/stackdeltatypes.h index 3c9a6a422..f2197b5d3 100644 --- a/support/ebpf/stackdeltatypes.h +++ b/support/ebpf/stackdeltatypes.h @@ -2,19 +2,22 @@ #define OPTI_STACKDELTATYPES_H // Command without arguments, the argument is instead an UNWIND_COMMAND_* value -#define UNWIND_OPCODE_COMMAND 0x00 +#define UNWIND_OPCODE_COMMAND 0x00 // Expression with base value being the Canonical Frame Address (CFA) -#define UNWIND_OPCODE_BASE_CFA 0x01 +#define UNWIND_OPCODE_BASE_CFA 0x01 // Expression with base value being the Stack Pointer -#define UNWIND_OPCODE_BASE_SP 0x02 +#define UNWIND_OPCODE_BASE_SP 0x02 // Expression with base value being the Frame Pointer -#define UNWIND_OPCODE_BASE_FP 0x03 +#define UNWIND_OPCODE_BASE_FP 0x03 // Expression with base value being the Link Register (ARM64) -#define UNWIND_OPCODE_BASE_LR 0x04 +#define UNWIND_OPCODE_BASE_LR 0x04 // Expression with base value being a Generic Register -#define UNWIND_OPCODE_BASE_REG 0x05 +#define UNWIND_OPCODE_BASE_REG 0x05 +// Expression for RA with base value being the CFA, and +// also indicating that the FP immediately precedes the RA (ARM64). +#define UNWIND_OPCODE_BASE_CFA_FRAME 0x06 // An opcode flag to indicate that the value should be dereferenced -#define UNWIND_OPCODEF_DEREF 0x80 +#define UNWIND_OPCODEF_DEREF 0x80 // Unsupported or no value for the register #define UNWIND_COMMAND_INVALID 0 diff --git a/support/ebpf/tracer.ebpf.amd64 b/support/ebpf/tracer.ebpf.amd64 index 7eb352daa..0335aac71 100644 Binary files a/support/ebpf/tracer.ebpf.amd64 and b/support/ebpf/tracer.ebpf.amd64 differ diff --git a/support/ebpf/tracer.ebpf.arm64 b/support/ebpf/tracer.ebpf.arm64 index 02f14ee39..48dfc2e92 100644 Binary files a/support/ebpf/tracer.ebpf.arm64 and b/support/ebpf/tracer.ebpf.arm64 differ diff --git a/support/types.go b/support/types.go index e011abca1..46171649e 100644 --- a/support/types.go +++ b/support/types.go @@ -324,13 +324,14 @@ const ( ) const ( - UnwindOpcodeCommand uint8 = 0x0 - UnwindOpcodeBaseCFA uint8 = 0x1 - UnwindOpcodeBaseSP uint8 = 0x2 - UnwindOpcodeBaseFP uint8 = 0x3 - UnwindOpcodeBaseLR uint8 = 0x4 - UnwindOpcodeBaseReg uint8 = 0x5 - UnwindOpcodeFlagDeref uint8 = 0x80 + UnwindOpcodeCommand uint8 = 0x0 + UnwindOpcodeBaseCFA uint8 = 0x1 + UnwindOpcodeBaseSP uint8 = 0x2 + UnwindOpcodeBaseFP uint8 = 0x3 + UnwindOpcodeBaseLR uint8 = 0x4 + UnwindOpcodeBaseReg uint8 = 0x5 + UnwindOpcodeBaseCFAFrame uint8 = 0x6 + UnwindOpcodeFlagDeref uint8 = 0x80 UnwindCommandInvalid int32 = 0x0 UnwindCommandStop int32 = 0x1 diff --git a/support/types_def.go b/support/types_def.go index 6aeaca3e9..342075723 100644 --- a/support/types_def.go +++ b/support/types_def.go @@ -146,13 +146,14 @@ const ( const ( // UnwindOpcodes from the C header file - UnwindOpcodeCommand uint8 = C.UNWIND_OPCODE_COMMAND - UnwindOpcodeBaseCFA uint8 = C.UNWIND_OPCODE_BASE_CFA - UnwindOpcodeBaseSP uint8 = C.UNWIND_OPCODE_BASE_SP - UnwindOpcodeBaseFP uint8 = C.UNWIND_OPCODE_BASE_FP - UnwindOpcodeBaseLR uint8 = C.UNWIND_OPCODE_BASE_LR - UnwindOpcodeBaseReg uint8 = C.UNWIND_OPCODE_BASE_REG - UnwindOpcodeFlagDeref uint8 = C.UNWIND_OPCODEF_DEREF + UnwindOpcodeCommand uint8 = C.UNWIND_OPCODE_COMMAND + UnwindOpcodeBaseCFA uint8 = C.UNWIND_OPCODE_BASE_CFA + UnwindOpcodeBaseSP uint8 = C.UNWIND_OPCODE_BASE_SP + UnwindOpcodeBaseFP uint8 = C.UNWIND_OPCODE_BASE_FP + UnwindOpcodeBaseLR uint8 = C.UNWIND_OPCODE_BASE_LR + UnwindOpcodeBaseReg uint8 = C.UNWIND_OPCODE_BASE_REG + UnwindOpcodeBaseCFAFrame uint8 = C.UNWIND_OPCODE_BASE_CFA_FRAME + UnwindOpcodeFlagDeref uint8 = C.UNWIND_OPCODEF_DEREF // UnwindCommands from the C header file UnwindCommandInvalid int32 = C.UNWIND_COMMAND_INVALID diff --git a/tools/coredump/testdata/arm64/node-hidden-internal-symbols.json b/tools/coredump/testdata/arm64/node-hidden-internal-symbols.json index 3087c539a..60d2a7178 100644 --- a/tools/coredump/testdata/arm64/node-hidden-internal-symbols.json +++ b/tools/coredump/testdata/arm64/node-hidden-internal-symbols.json @@ -58,7 +58,6 @@ "node+0x17f07fb", "node+0x90848b", "libc.so.6+0x8202f", - "libc.so.6+0x8202f", "libc.so.6+0xebf1b" ] }, @@ -70,7 +69,6 @@ "node+0x17f07fb", "node+0x90848b", "libc.so.6+0x8202f", - "libc.so.6+0x8202f", "libc.so.6+0xebf1b" ] }, @@ -82,7 +80,6 @@ "node+0x17f07fb", "node+0x90848b", "libc.so.6+0x8202f", - "libc.so.6+0x8202f", "libc.so.6+0xebf1b" ] }, @@ -94,7 +91,6 @@ "node+0x17f07fb", "node+0x90848b", "libc.so.6+0x8202f", - "libc.so.6+0x8202f", "libc.so.6+0xebf1b" ] }, @@ -106,7 +102,6 @@ "node+0x17e1abb", "node+0x90d2ff", "libc.so.6+0x8202f", - "libc.so.6+0x8202f", "libc.so.6+0xebf1b" ] } diff --git a/tools/coredump/testdata/arm64/node1600-inlining.json b/tools/coredump/testdata/arm64/node1600-inlining.json index 6585a2180..795b9f04d 100644 --- a/tools/coredump/testdata/arm64/node1600-inlining.json +++ b/tools/coredump/testdata/arm64/node1600-inlining.json @@ -72,7 +72,6 @@ "node+0x14efc2f", "node+0xb6add7", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -84,7 +83,6 @@ "node+0x14fd073", "node+0xb66667", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -96,7 +94,6 @@ "node+0x14fd073", "node+0xb66667", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -108,7 +105,6 @@ "node+0x14fd073", "node+0xb66667", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -120,7 +116,6 @@ "node+0x14fd073", "node+0xb66667", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, diff --git a/tools/coredump/testdata/arm64/node16110-inlining.json b/tools/coredump/testdata/arm64/node16110-inlining.json index ab0dbf47f..4077c115e 100644 --- a/tools/coredump/testdata/arm64/node16110-inlining.json +++ b/tools/coredump/testdata/arm64/node16110-inlining.json @@ -70,7 +70,6 @@ "node+0x14bb6bf", "node+0xb5a0b7", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -82,7 +81,6 @@ "node+0x14c8bfb", "node+0xb55947", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -94,7 +92,6 @@ "node+0x14c8bfb", "node+0xb55947", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -106,7 +103,6 @@ "node+0x14c8bfb", "node+0xb55947", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -118,7 +114,6 @@ "node+0x14c8bfb", "node+0xb55947", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, diff --git a/tools/coredump/testdata/arm64/node1640-inlining.json b/tools/coredump/testdata/arm64/node1640-inlining.json index 1f362b160..5ac7d2f53 100644 --- a/tools/coredump/testdata/arm64/node1640-inlining.json +++ b/tools/coredump/testdata/arm64/node1640-inlining.json @@ -72,7 +72,6 @@ "node+0x151c917", "node+0xb7a817", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -84,7 +83,6 @@ "node+0x1529d5b", "node+0xb760a7", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -96,7 +94,6 @@ "node+0x1529d5b", "node+0xb760a7", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -108,7 +105,6 @@ "node+0x1529d5b", "node+0xb760a7", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -120,7 +116,6 @@ "node+0x1529d5b", "node+0xb760a7", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, diff --git a/tools/coredump/testdata/arm64/node1660-inlining.json b/tools/coredump/testdata/arm64/node1660-inlining.json index 58d2a0dfb..5b2edd9b3 100644 --- a/tools/coredump/testdata/arm64/node1660-inlining.json +++ b/tools/coredump/testdata/arm64/node1660-inlining.json @@ -72,7 +72,6 @@ "node+0x14a292f", "node+0xb5630f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -84,7 +83,6 @@ "node+0x14afd73", "node+0xb51b9f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -96,7 +94,6 @@ "node+0x14afd73", "node+0xb51b9f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -108,7 +105,6 @@ "node+0x14afd73", "node+0xb51b9f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -120,7 +116,6 @@ "node+0x14afd73", "node+0xb51b9f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, diff --git a/tools/coredump/testdata/arm64/node1890-inlining.json b/tools/coredump/testdata/arm64/node1890-inlining.json index 99f9748ef..fa3fd1d44 100644 --- a/tools/coredump/testdata/arm64/node1890-inlining.json +++ b/tools/coredump/testdata/arm64/node1890-inlining.json @@ -71,7 +71,6 @@ "node+0x15c30c7", "node+0xbc168b", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -83,7 +82,6 @@ "node+0x15d120f", "node+0xbbc81f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -95,7 +93,6 @@ "node+0x15d120f", "node+0xbbc81f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -107,7 +104,6 @@ "node+0x15d120f", "node+0xbbc81f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -119,7 +115,6 @@ "node+0x15d120f", "node+0xbbc81f", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, diff --git a/tools/coredump/testdata/arm64/node2010-inlining.json b/tools/coredump/testdata/arm64/node2010-inlining.json index 4817ef990..2953b84d5 100644 --- a/tools/coredump/testdata/arm64/node2010-inlining.json +++ b/tools/coredump/testdata/arm64/node2010-inlining.json @@ -72,7 +72,6 @@ "node+0x179ab93", "node+0xcd9daf", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -84,7 +83,6 @@ "node+0x17a855b", "node+0xcd5347", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -96,7 +94,6 @@ "node+0x17a855b", "node+0xcd5347", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -108,7 +105,6 @@ "node+0x17a855b", "node+0xcd5347", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -120,7 +116,6 @@ "node+0x17a855b", "node+0xcd5347", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, diff --git a/tools/coredump/testdata/arm64/node2110-inlining.json b/tools/coredump/testdata/arm64/node2110-inlining.json index 0aecd1ab8..a5057e62e 100644 --- a/tools/coredump/testdata/arm64/node2110-inlining.json +++ b/tools/coredump/testdata/arm64/node2110-inlining.json @@ -78,7 +78,6 @@ "node+0x1941a5b", "node+0xe2d1cf", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -96,7 +95,6 @@ "node+0x194f93b", "node+0xe28677", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -108,7 +106,6 @@ "node+0x194f93b", "node+0xe28677", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -120,7 +117,6 @@ "node+0x194f93b", "node+0xe28677", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, @@ -132,7 +128,6 @@ "node+0x194f93b", "node+0xe28677", "libc.so.6+0x7d5c7", - "libc.so.6+0x7d5c7", "libc.so.6+0xe5d9b" ] }, diff --git a/tools/coredump/testdata/arm64/ruby-3.2.2-loop-with-ractors.json b/tools/coredump/testdata/arm64/ruby-3.2.2-loop-with-ractors.json index dd9c2b8e2..cb98c0b42 100644 --- a/tools/coredump/testdata/arm64/ruby-3.2.2-loop-with-ractors.json +++ b/tools/coredump/testdata/arm64/ruby-3.2.2-loop-with-ractors.json @@ -56,9 +56,10 @@ "block in
+0 in /app/loop-with-ractors.rb:29", "libruby.so.3.2.2+0x3382d7", "libruby.so.3.2.2+0x2edb13", - "block in
+0 in /app/loop-with-ractors.rb:29", - "libruby.so.3.2.2+0x3382d7", - "" + "libruby.so.3.2.2+0x2ee5bb", + "libruby.so.3.2.2+0x2ee7d3", + "libc.so.6+0x7ee17", + "libc.so.6+0xe7e9b" ] } ], diff --git a/tools/coredump/testdata/arm64/ruby-3.3.9-loop-with-ractors.json b/tools/coredump/testdata/arm64/ruby-3.3.9-loop-with-ractors.json index eeb47876d..da94fd706 100644 --- a/tools/coredump/testdata/arm64/ruby-3.3.9-loop-with-ractors.json +++ b/tools/coredump/testdata/arm64/ruby-3.3.9-loop-with-ractors.json @@ -46,8 +46,10 @@ "block (3 levels) in
+0 in /app/loop-with-ractors.rb:31", "libruby.so.3.3.9+0x2feedb", "libruby.so.3.3.9+0x2abdaf", - "libruby.so.3.3.9+0x307d87", - "" + "libruby.so.3.3.9+0x2ac5cf", + "libruby.so.3.3.9+0x2aca0b", + "libruby.so.3.3.9+0x2ac8e7", + "" ] }, { @@ -59,7 +61,6 @@ "libc.so.6+0xee143", "libruby.so.3.3.9+0x2a78f3", "libc.so.6+0x85f77", - "libc.so.6+0x85f77", "libc.so.6+0xedc1b" ] } diff --git a/tools/coredump/testdata/arm64/ruby-3.3.9-loop.json b/tools/coredump/testdata/arm64/ruby-3.3.9-loop.json index f0121e5a4..4f30380ac 100644 --- a/tools/coredump/testdata/arm64/ruby-3.3.9-loop.json +++ b/tools/coredump/testdata/arm64/ruby-3.3.9-loop.json @@ -44,7 +44,6 @@ "libc.so.6+0xee143", "libruby.so.3.3.9+0x2a78f3", "libc.so.6+0x85f77", - "libc.so.6+0x85f77", "libc.so.6+0xedc1b" ] } diff --git a/tools/coredump/testdata/arm64/ruby-3.4.5-loop-with-ractors.json b/tools/coredump/testdata/arm64/ruby-3.4.5-loop-with-ractors.json index 44ad05f47..21fc2919f 100644 --- a/tools/coredump/testdata/arm64/ruby-3.4.5-loop-with-ractors.json +++ b/tools/coredump/testdata/arm64/ruby-3.4.5-loop-with-ractors.json @@ -50,24 +50,10 @@ "block (3 levels) in
+0 in /app/loop-with-ractors.rb:31", "libruby.so.3.4.5+0x325fd3", "libruby.so.3.4.5+0x2ce40f", - "libruby.so.3.4.5+0x30eac7", - "libruby.so.3.4.5+0x313c07", - "libruby.so.3.4.5+0x31fe1b", - "Range#each+0 in :0", - "block (2 levels) in
+0 in /app/loop-with-ractors.rb:30", - "Kernel#loop+0 in :168", - "block in
+0 in /app/loop-with-ractors.rb:29", - "libruby.so.3.4.5+0x3261bb", - "libruby.so.3.4.5+0x32a937", - "libruby.so.3.4.5+0x2328cb", - "libruby.so.3.4.5+0x30d193", - "libruby.so.3.4.5+0x313c07", - "libruby.so.3.4.5+0x31fe1b", - "block in
+0 in /app/loop-with-ractors.rb:29", - "libruby.so.3.4.5+0x325fd3", - "libruby.so.3.4.5+0x2ce40f", - "libruby.so.3.4.5+0x313c07", - "" + "libruby.so.3.4.5+0x2ce9f7", + "libruby.so.3.4.5+0x2cefbf", + "libruby.so.3.4.5+0x2cee9f", + "" ] }, { @@ -79,7 +65,6 @@ "libc.so.6+0xee143", "libruby.so.3.4.5+0x2ca01b", "libc.so.6+0x85f77", - "libc.so.6+0x85f77", "libc.so.6+0xedc1b" ] } diff --git a/tools/coredump/testdata/arm64/ruby-3.4.5-loop.json b/tools/coredump/testdata/arm64/ruby-3.4.5-loop.json index 7447928ee..076020ab8 100644 --- a/tools/coredump/testdata/arm64/ruby-3.4.5-loop.json +++ b/tools/coredump/testdata/arm64/ruby-3.4.5-loop.json @@ -38,7 +38,6 @@ "libc.so.6+0xee143", "libruby.so.3.4.5+0x2ca01b", "libc.so.6+0x85f77", - "libc.so.6+0x85f77", "libc.so.6+0xedc1b" ] } diff --git a/tools/coredump/testdata/arm64/ruby-3.5.0-loop-with-ractors.json b/tools/coredump/testdata/arm64/ruby-3.5.0-loop-with-ractors.json index 7d6610c08..3d78bc8ea 100644 --- a/tools/coredump/testdata/arm64/ruby-3.5.0-loop-with-ractors.json +++ b/tools/coredump/testdata/arm64/ruby-3.5.0-loop-with-ractors.json @@ -47,8 +47,10 @@ "block (3 levels) in
+0 in /app/loop-with-ractors.rb:31", "libruby.so.3.5.0+0x31c543", "libruby.so.3.5.0+0x2c6463", - "libruby.so.3.5.0+0x22a817", - "" + "libruby.so.3.5.0+0x2c6a47", + "libruby.so.3.5.0+0x2c700b", + "libruby.so.3.5.0+0x2c6eeb", + "" ] }, { @@ -60,7 +62,6 @@ "libc.so.6+0xee143", "libruby.so.3.5.0+0x2c205b", "libc.so.6+0x85f77", - "libc.so.6+0x85f77", "libc.so.6+0xedc1b" ] } diff --git a/tools/coredump/testdata/arm64/ruby-3.5.0-loop.json b/tools/coredump/testdata/arm64/ruby-3.5.0-loop.json index 3ac26a5c8..f6194c57e 100644 --- a/tools/coredump/testdata/arm64/ruby-3.5.0-loop.json +++ b/tools/coredump/testdata/arm64/ruby-3.5.0-loop.json @@ -39,7 +39,6 @@ "libc.so.6+0xee143", "libruby.so.3.5.0+0x2c205b", "libc.so.6+0x85f77", - "libc.so.6+0x85f77", "libc.so.6+0xedc1b" ] } diff --git a/tools/stackdeltas/stackdeltas.go b/tools/stackdeltas/stackdeltas.go index e090f7f2b..3fa075043 100644 --- a/tools/stackdeltas/stackdeltas.go +++ b/tools/stackdeltas/stackdeltas.go @@ -55,6 +55,8 @@ func getOpcode(opcode uint8, param int32) string { str = "fp" case support.UnwindOpcodeBaseSP: str = "sp" + case support.UnwindOpcodeBaseCFAFrame: + str += "cfa (fpra)" default: return "?" }