Module Name: src Committed By: mrg Date: Wed Jan 30 22:46:49 UTC 2019
Modified Files: src/lib/libexecinfo: unwind.c Log Message: make the backtrace()'s tracer() return _URC_FOREIGN_EXCEPTION_CAUGHT when the array is full. it won't be able to do any more work if so, and avoids infinite loops in unwinding as seen on arm64. XXX: lack of signal support here means that backtrace() is useless XXX: from a signal handler, such as attempting to display the stack XXX: when handling a SIGSEGV. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libexecinfo/unwind.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libexecinfo/unwind.c diff -u src/lib/libexecinfo/unwind.c:1.2 src/lib/libexecinfo/unwind.c:1.3 --- src/lib/libexecinfo/unwind.c:1.2 Mon Mar 24 21:26:01 2014 +++ src/lib/libexecinfo/unwind.c Wed Jan 30 22:46:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: unwind.c,v 1.2 2014/03/24 21:26:01 joerg Exp $ */ +/* $NetBSD: unwind.c,v 1.3 2019/01/30 22:46:49 mrg Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -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 _URC_FOREIGN_EXCEPTION_CAUGHT; return 0; }