Changeset: d2bb75d965f7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d2bb75d965f7
Modified Files:
MonetDB4/src/modules/plain/aggrX3_be_minmax.mx
MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx
MonetDB5/src/modules/kernel/aggr_be_minmax.mx
MonetDB5/src/modules/kernel/aggr_bge_minmax.mx
MonetDB5/src/modules/kernel/batcast.mx
Branch: Jun2010
Log Message:
replaced ATOMput() by Tputvalue() to ensure correct string handling
Triggered by crashes (segfaults or bus errors) due to non-aligned memory access
with some customer tests on our Sun Solaris T1000 machine:
To insert string values into a BAT, we need to use [HT]putvalue()
instead of ATOMput(), as only the former ensures correct handling
of variable/adaptive BUNheap type/width.
diffs (105 lines):
diff -r 820b55208c5c -r d2bb75d965f7
MonetDB4/src/modules/plain/aggrX3_be_minmax.mx
--- a/MonetDB4/src/modules/plain/aggrX3_be_minmax.mx Mon Aug 23 10:15:54
2010 +0200
+++ b/MonetDB4/src/modules/plain/aggrX3_be_minmax.mx Mon Aug 23 22:17:30
2010 +0200
@@ -115,7 +115,7 @@
ptr val = extrem...@8];
(void) h; /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are
(over)written */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), val?val:nil);
+ Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
@c
/* aggrX3_minmax_oid
@@ -200,7 +200,7 @@
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h; /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are
(over)written */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), &val);
+ Tputvalue(bn, BUNtloc(bni,r), &val, 0);
}
@c
diff -r 820b55208c5c -r d2bb75d965f7
MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx
--- a/MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx Mon Aug 23 10:15:54
2010 +0200
+++ b/MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx Mon Aug 23 22:17:30
2010 +0200
@@ -127,7 +127,7 @@
oid *h = (oid*)b...@4(bni,r);
ptr val = extrem...@8];
(void) h; /* silence compiler about unused variable */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), val?val:nil);
+ Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
@c
/* aggrX3_minmax3_oid
@@ -224,7 +224,7 @@
oid *h = (oid*)b...@4(bni,r);
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h; /* silence compiler about unused variable */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), &val);
+ Tputvalue(bn, BUNtloc(bni,r), &val, 0);
}
@c
diff -r 820b55208c5c -r d2bb75d965f7
MonetDB5/src/modules/kernel/aggr_be_minmax.mx
--- a/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Mon Aug 23 10:15:54
2010 +0200
+++ b/MonetDB5/src/modules/kernel/aggr_be_minmax.mx Mon Aug 23 22:17:30
2010 +0200
@@ -118,7 +118,7 @@
ptr val = extrem...@8];
(void) h; /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are
(over)written */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), val?val:nil);
+ Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
@c
@@ -209,7 +209,7 @@
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h; /* silence compiler about unused variable */
/* trick: using a void head-type, only the tail are
(over)written */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), &val);
+ Tputvalue(bn, BUNtloc(bni,r), &val, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
@c
diff -r 820b55208c5c -r d2bb75d965f7
MonetDB5/src/modules/kernel/aggr_bge_minmax.mx
--- a/MonetDB5/src/modules/kernel/aggr_bge_minmax.mx Mon Aug 23 10:15:54
2010 +0200
+++ b/MonetDB5/src/modules/kernel/aggr_bge_minmax.mx Mon Aug 23 22:17:30
2010 +0200
@@ -98,7 +98,7 @@
oid *h = (oid*)b...@4(bni,r);
ptr val = extrem...@8];
(void) h; /* silence compiler about unused variable */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), val?val:nil);
+ Tputvalue(bn, BUNtloc(bni,r), val?val:nil, 0);
}
BATaccessEnd(bn,USE_HEAD|USE_TAIL,MMAP_SEQUENTIAL);
@c
@@ -264,7 +264,7 @@
oid *h = (oid*)b...@4(bni,r);
oid val = h...@8] ? extrem...@8] : *(oid*)nil;
(void) h; /* silence compiler about unused variable */
- ATOMput(bn->ttype, bn->T->vheap, BUNtloc(bni,r), &val);
+ Tputvalue(bn, BUNtloc(bni,r), &val, 0);
}
@c
diff -r 820b55208c5c -r d2bb75d965f7 MonetDB5/src/modules/kernel/batcast.mx
--- a/MonetDB5/src/modules/kernel/batcast.mx Mon Aug 23 10:15:54 2010 +0200
+++ b/MonetDB5/src/modules/kernel/batcast.mx Mon Aug 23 22:17:30 2010 +0200
@@ -235,7 +235,7 @@
@1 *v = (@1*)BUNtail(bi,p);
@1ToStr(&dst,&len, (ptr) v);
- ATOMput(ty...@1, bn->T->vheap, Tloc(bn,r), dst);
+ Tputvalue(bn, Tloc(bn,r), dst, 1);
if (dst)
GDKfree(dst);
}
@@ -260,7 +260,7 @@
BATaccessBegin(b, USE_TAIL, MMAP_SEQUENTIAL);
BATloop(b, p, q) {
ATOMfromstr(ty...@1, &v, &len, (char *) BUNtvar(bi, p));
- ATOMput(ty...@1, bn->T->vheap, Tloc(bn, r), v);
+ Tputvalue(bn, Tloc(bn,r), v, 1);
r++;
}
GDKfree(v);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list