BUGFIX: dirtyPageTable was accidentally using the deprecated red black tree, which leads to in-memory corruption and crashes. Fixed this, and set the deprecated red black tree to issue a warning on startup if it is used

This commit is contained in:
Sears Russell 2010-11-09 21:11:37 +00:00
parent 09d113246c
commit 81d2c1590e
3 changed files with 12 additions and 5 deletions

View file

@ -5,8 +5,8 @@
* Author: sears
*/
#include <stasis/redblack.h>
#include <stasis/common.h>
#include <stasis/redblack.h>
#include <stasis/flags.h>
#include <stasis/dirtyPageTable.h>
#include <stasis/page.h>

View file

@ -1,9 +1,11 @@
#define _GNU_SOURCE
#include <config.h>
#include <stasis/common.h>
#undef STLSEARCH // XXX
#include <stasis/io/rangeTracker.h>
#undef STLSEARCH // XXX
#include <stasis/redblack.h>
#include <stasis/io/rangeTracker.h>
#include <stdio.h>
#include <assert.h>

View file

@ -27,7 +27,7 @@ static char rcsid[]="$Id$";
#include <stasis/common.h>
#undef STLSEARCH
#include <stasis/redblack.h>
#include <stdio.h>
#define assert(expr)
/* Uncomment this if you would rather use a raw sbrk to get memory
@ -138,6 +138,11 @@ rbinit(int (*cmp)(const void *, const void *, const void *), const void *config)
RB_STATIC struct RB_ENTRY(tree) *RB_ENTRY(init)(void)
#endif /* RB_CUSTOMIZE */
{
static int warned = 0;
if(!warned) {
printf("Warning: initting redblack.c tree. These are known to lead to crashes w/ stasis\n");
warned = 1;
}
struct RB_ENTRY(tree) *retval;
char c;