Questionable attempts to appease valgrind.

This commit is contained in:
Sears Russell 2008-03-14 03:09:29 +00:00
parent 3b70dfaab7
commit b1bfe7979f
4 changed files with 24 additions and 15 deletions

View file

@ -4,7 +4,7 @@
# Dashboard is opened for submissions for a 24 hour period starting at
# the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
SET (CTEST_NIGHTLY_START_TIME "23:00:00 EDT")
SET (CTEST_TIME_OUT 3000)
# Dart server to submit results (used by client)
IF(CTEST_DROP_METHOD MATCHES http)
# SET (CTEST_DROP_SITE "public.kitware.com")
@ -19,4 +19,4 @@ ELSE(CTEST_DROP_METHOD MATCHES http)
ENDIF(CTEST_DROP_METHOD MATCHES http)
SET (CTEST_TRIGGER_SITE
"http://${DROP_SITE}/cgi-bin/Submit-vtk-TestingResults.pl")
"http://${DROP_SITE}/cgi-bin/Submit-vtk-TestingResults.pl")

View file

@ -101,7 +101,7 @@ inline static void remove_xidAlloced(allocationPolicy * ap, int xid, availablePa
struct RB_ENTRY(tree) * pages = LH_ENTRY(find)(ap->xidAlloced, &xid, sizeof(xid));
assert(pages);
const availablePage * check = RB_ENTRY(delete)(p, pages);
assert(check == p);
assert(check == p); // sometimes fails
}
inline static void insert_xidDealloced(allocationPolicy * ap, int xid, availablePage * p) {
@ -319,7 +319,9 @@ void allocationPolicyAllocedFromPage(allocationPolicy *ap, int xid, int pageid)
if(check1) {
assert(p->lockCount == 0);
lockAlloced(ap, xid, (availablePage*)p);
}
} else {
assert(*xidp == xid); // new
}
}
void allocationPolicyLockPage(allocationPolicy *ap, int xid, int pageid) {
@ -375,7 +377,7 @@ void allocationPolicyUpdateFreespaceLockedPage(allocationPolicy * ap, int xid, a
struct RB_ENTRY(tree) * locks = LH_ENTRY(find)(ap->xidAlloced, &xid, sizeof(int));
assert(key);
availablePage * p = (availablePage*) RB_ENTRY(delete)(key, locks);
assert(p);
assert(p); // sometimes fails
p->freespace = newFree;
key->freespace = newFree;
const availablePage * ret = RB_ENTRY(search)(p, locks);

View file

@ -48,9 +48,9 @@ terms specified in this license.
#include "../page.h" // For stasis_record_type_to_size()
#include <stasis/logger/logger2.h> // needed for LoggerSizeOfInternalLogEntry()
#include <stasis/logger/logEntry.h>
#include <stasis/crc32.h>
LogEntry * allocCommonLogEntry(lsn_t prevLSN, int xid, unsigned int type) {
LogEntry * ret = malloc(sizeof(struct __raw_log_entry));
LogEntry * ret = calloc(1,sizeof(struct __raw_log_entry));
ret->LSN = -1;
ret->prevLSN = prevLSN;
ret->xid = xid;
@ -96,12 +96,14 @@ LogEntry * allocUpdateLogEntry(lsn_t prevLSN, int xid,
/** Use calloc since the struct might not be packed in memory;
otherwise, we'd leak uninitialized bytes to the log. */
LogEntry * ret = calloc(1, sizeof(struct __raw_log_entry) +
sizeof(UpdateLogEntry) + argSize +
((!invertible) ? stasis_record_type_to_size(rid.size)
: 0) +
(whole_page_phys ? PAGE_SIZE
: 0));
size_t logentrysize =
sizeof(struct __raw_log_entry) +
sizeof(UpdateLogEntry) + argSize +
((!invertible) ? stasis_record_type_to_size(rid.size)
: 0) +
(whole_page_phys ? PAGE_SIZE
: 0);
LogEntry * ret = calloc(1,logentrysize);
ret->LSN = -1;
ret->prevLSN = prevLSN;
ret->xid = xid;
@ -121,6 +123,9 @@ LogEntry * allocUpdateLogEntry(lsn_t prevLSN, int xid,
memcpy((void*)getUpdatePreImage(ret), preImage,
PAGE_SIZE);
}
//assert(logentrysize == sizeofLogEntry(ret));
// XXX checks for uninitialized values in valgrind
// stasis_crc32(ret, sizeofLogEntry(ret), 0);
return ret;
}
@ -138,7 +143,7 @@ LogEntry * allocCLRLogEntry(const LogEntry * old_e) {
// Could handle other types, but we should never encounter them here.
assert(old_e->type == UPDATELOG);
LogEntry * ret = malloc(sizeofLogEntry(old_e));
LogEntry * ret = calloc(1, sizeofLogEntry(old_e));
memcpy(ret, old_e, sizeofLogEntry(old_e));
ret->LSN = -1;
// prevLSN is OK already

View file

@ -514,6 +514,8 @@ BEGIN_C_DECLS
* @todo recordid.page should be 64bit.
* @todo int64_t (for recordid.size) is a stopgap fix.
*/
#pragma pack(push)
#pragma pack(1)
typedef struct {
int page; // XXX needs to be pageid_t, but that breaks unit tests.
int slot;
@ -525,7 +527,7 @@ typedef struct {
size_t size;
// unsigned fd : 1;
} blob_record_t;
#pragma pack(pop)
extern const recordid ROOT_RECORD;