NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: toolchain/53918: X crashes on pinebook and stack unwinding broken



matthew green writes:
> i hacked the xorg_backtrace() function into a simple test case that
> also hangs on arm64 for me.
> 

this "fixes" the hang for me by avoiding an infinite loop in
the libexecinfo unwind tracer() function, but it still shows
that there is a bug in the handling (i had to fix a bug in the
test program to call _exit(1) for this to work properly):

soft-irony ~> ./a.out

Backtrace:
bt size = 2
0: ./a.out (0x200100000+0xb18) [0x200100b18]
1: ./a.out (0x200100000+0xcc4) [0x200100cc4]

signo: 11

Backtrace:
bt size = 63
0: ./a.out (0x200100000+0xb18) [0x200100b18]
1: ./a.out (0x200100000+0xcb0) [0x200100cb0]
2: /usr/lib/libc.so.12 (__sigtramp_siginfo_2+0x0) [0xf68683d9d6d0]
3: /usr/lib/libc.so.12 (__sigtramp_siginfo_2+0x0) [0xf68683d9d6d0]
4: /usr/lib/libc.so.12 (__sigtramp_siginfo_2+0x0) [0xf68683d9d6d0]
[ ... ]
62: /usr/lib/libc.so.12 (__sigtramp_siginfo_2+0x0) [0xf68683d9d6d0]

soft-irony ~> 

on amd64, this ends at frame#2 -- the libc trampoline.  on arm64
it is recursing to itself.


.mrg.


Index: unwind.c
===================================================================
RCS file: /cvsroot/src/lib/libexecinfo/unwind.c,v
retrieving revision 1.2
diff -p -u -r1.2 unwind.c
--- unwind.c	24 Mar 2014 21:26:01 -0000	1.2
+++ unwind.c	29 Jan 2019 00:29:30 -0000
@@ -52,6 +52,8 @@ tracer(struct _Unwind_Context *ctx, void
 	}
 	if (t->n < t->len)
 		t->arr[t->n++] = (void *)_Unwind_GetIP(ctx);
+	else
+		return 1; // other code better, but will do for now
 	return 0;
 }
 


Home | Main Index | Thread Index | Old Index