Update of /cvsroot/monetdb/MonetDB/src/gdk
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29934
Modified Files:
Tag: MonetDB_1-22
gdk_heap.mx
Log Message:
[ 1872685 ] PF(tijah): HEAPsetmmap: Assertion `p' failed.
Recent lowering te gdk_vm_minsize threshold, that determines when BAT heap
allocs (due to a new or extending BAT) start directly mapping on disk,
exposed this bug that has been there for 4 years already.
The gdk_vm_minsize threshold is now 64MB on Linux (it is higher on Windows,
because of high cost).
Direct-mmaps usually are only allowed for non-writable bats, but in this
case we get it in a temporary, but non-persistent bat.
Such cases are (DIRTY) recognized by filename extension: the mode
is STORE_MMAP, it the filename ends with .priv.
The bug occurred when making the bat non-writable again. The assert
goes off because it expects the .priv extension, but it is gone.
Turns out it was gone for two reasons:
(1) the initial HEAPalloc/HEAPextend failed to attach the privext
extension in the first place
(2) on a subsequent HEAPextend, the .priv extension would be
lost due to the behavior of decompose_filename()
Index: gdk_heap.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_heap.mx,v
retrieving revision 1.93.2.1
retrieving revision 1.93.2.2
diff -u -d -r1.93.2.1 -r1.93.2.2
--- gdk_heap.mx 6 Feb 2008 13:12:28 -0000 1.93.2.1
+++ gdk_heap.mx 11 Feb 2008 00:34:32 -0000 1.93.2.2
@@ -70,14 +70,11 @@
static char *
decompose_filename(str nme)
{
- char *ext, *priv;
+ char *ext;
ext = strchr(nme, '.'); /* extract base and ext from heap file name */
if (ext) {
*ext++ = 0;
- priv = strchr(ext, '.');
- if (priv)
- *priv = 0;
}
return ext;
}
@@ -139,7 +136,7 @@
fclose(fp);
/* a non-persistent heap: we create a .priv but *not*
MMAP_PRIV !!! */
h->storage = STORE_MMAP;
- HEAPload(h, nme, ext, FALSE);
+ HEAPload(h, nme, privext, FALSE);
}
GDKfree(of);
}
@@ -222,7 +219,7 @@
/* a non-persistent heap: we create a .priv but
*not* MMAP_PRIV !!! */
h->storage = STORE_MMAP;
h->base = NULL;
- if (HEAPload(h, nme, ext, FALSE) >= 0) {
+ if (HEAPload(h, nme, privext, FALSE) >= 0) {
memcpy(h->base, bak.base, bak.free);
HEAPfree(&bak);
return 0;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins