diff options
author | Maxim Sobolev <sobomax@FreeBSD.org> | 2003-08-10 16:47:03 +0000 |
---|---|---|
committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2003-08-10 16:47:03 +0000 |
commit | e9050dccb62311d2c76d657d1bf9129c2b9b2000 (patch) | |
tree | 3a628b2f7b2161ee49c4895b05a7598539f6bb61 /devel/libexecinfo/files/patch-execinfo.c | |
parent | shorten COMMENT and remove CAPS. (diff) |
Don't rely only on stack frame being 0 when bottom of stack reached, but
check return address as well. It is necessary for avoiding crash when
FreeBSD threads are used.
Notes
Notes:
svn path=/head/; revision=86726
Diffstat (limited to 'devel/libexecinfo/files/patch-execinfo.c')
-rw-r--r-- | devel/libexecinfo/files/patch-execinfo.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/devel/libexecinfo/files/patch-execinfo.c b/devel/libexecinfo/files/patch-execinfo.c new file mode 100644 index 000000000000..5692e9b9dd7f --- /dev/null +++ b/devel/libexecinfo/files/patch-execinfo.c @@ -0,0 +1,18 @@ + +$FreeBSD$ + +--- execinfo.c 2003/08/10 06:14:30 1.1 ++++ execinfo.c 2003/08/10 06:15:23 +@@ -41,8 +41,11 @@ + { + int i; + +- for (i = 1; getframeaddr(i + 1) != NULL && i != size + 1; i++) ++ for (i = 1; getframeaddr(i + 1) != NULL && i != size + 1; i++) { + buffer[i - 1] = getreturnaddr(i); ++ if (buffer[i - 1] == NULL) ++ break; ++ } + + return i - 1; + } |