aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/db
diff options
context:
space:
mode:
authorJun Kuriyama <kuriyama@FreeBSD.org>2004-09-10 14:45:00 +0000
committerJun Kuriyama <kuriyama@FreeBSD.org>2004-09-10 14:45:00 +0000
commita5906b6cd2cd2d4bd212cc6ead8c08f39f1997f2 (patch)
tree275a61e6e3712fca6d4c240d812e0c013d351dce /lib/libc/db
parent2106ffb5e5c8d9dc2eb97a09485715b4ad0942ee (diff)
downloadsrc-a5906b6cd2cd2d4bd212cc6ead8c08f39f1997f2.tar.gz
src-a5906b6cd2cd2d4bd212cc6ead8c08f39f1997f2.zip
I found "portsdb -u" dumps core with recent INDEX file, and this is
caused by refering broken (uninitialized?) pointer which is retrieved from __bt_new() (and from mpool_new()). I don't know why this linp[0] is read before stored because this should be controlled by .lower and .upper member of PAGE structure which are correctly initialized. But this workaround fixes the problem on my environment and this module has #ifdef PURIFY option which initializes new and reused memory from mpool by memset(p, 0xff, size) like as I did. Please feel free to fix the real bug instead of my workaround.
Notes
Notes: svn path=/head/; revision=135038
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/btree/bt_split.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c
index 9112ec8a0330..0e478dee7be6 100644
--- a/lib/libc/db/btree/bt_split.c
+++ b/lib/libc/db/btree/bt_split.c
@@ -361,6 +361,8 @@ bt_page(t, h, lp, rp, skip, ilen)
r->nextpg = h->nextpg;
r->prevpg = h->pgno;
r->flags = h->flags & P_TYPE;
+ /* XXX: Workaround for broken page data access. */
+ r->linp[0] = 0xffff;
/*
* If we're splitting the last page on a level because we're appending