diff options
author | unknown <knielsen@knielsen-hq.org> | 2011-04-01 15:07:10 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2011-04-01 15:07:10 +0200 |
commit | c677fea7d01ef1fab3357496b309a3e3b3c00dfe (patch) | |
tree | b6000be3447e5a41440cffee8b8d927d37a1dcde /storage/pbxt | |
parent | 09bd2894973fbdbacec9bfc31a3635165b120200 (diff) | |
parent | 9aa44bb4b3e0fc69306626b961c7d9309e6ab114 (diff) | |
download | mariadb-git-c677fea7d01ef1fab3357496b309a3e3b3c00dfe.tar.gz |
Merge MariaDB 5.2.5 release into MariaDB-5.2-rpl.
Diffstat (limited to 'storage/pbxt')
-rw-r--r-- | storage/pbxt/src/lock_xt.cc | 5 | ||||
-rw-r--r-- | storage/pbxt/src/memory_xt.h | 17 | ||||
-rw-r--r-- | storage/pbxt/src/table_xt.cc | 6 |
3 files changed, 22 insertions, 6 deletions
diff --git a/storage/pbxt/src/lock_xt.cc b/storage/pbxt/src/lock_xt.cc index 0e9af277c7b..946adfecccc 100644 --- a/storage/pbxt/src/lock_xt.cc +++ b/storage/pbxt/src/lock_xt.cc @@ -2058,11 +2058,12 @@ static void lck_free_thread_data(XTThreadPtr XT_UNUSED(self), void *XT_UNUSED(da static void lck_do_job(XTThreadPtr self, int job, XSLockTestPtr data, xtBool reader) { - char b1[2048], b2[2048]; + char b1[1024], b2[1024]; switch (job) { case JOB_MEMCPY: - memcpy(b1, b2, 2048); + memset(b1, 0, sizeof(b1)); + memset(b2, 1, sizeof(b2)); data->xs_inc++; break; case JOB_SLEEP: diff --git a/storage/pbxt/src/memory_xt.h b/storage/pbxt/src/memory_xt.h index 1785cd0bd51..bfc7990f914 100644 --- a/storage/pbxt/src/memory_xt.h +++ b/storage/pbxt/src/memory_xt.h @@ -29,8 +29,21 @@ struct XTThread; -#ifdef DEBUG -#define DEBUG_MEMORY +#if (defined DEBUG) +/* + Disable PBXT debug malloc on Windows, as it is not properly aligned. + malloc() alignment requiremebt on x64 is documented as 16 bytes. PBXT debug + malloc is only 8 bytes aligned. Improper alignment will lead to a crash if + e.g SSE instructions access heap memory. + + This might be general problem , however crashes were seen so far only + on Windows (crash during setjmp() on memory allocated with pbxt debug malloc). + + Besides, on Windows there is already a debug malloc by C runtime. +*/ +#ifndef _WIN32 + #define DEBUG_MEMORY +#endif #endif #ifdef DEBUG_MEMORY diff --git a/storage/pbxt/src/table_xt.cc b/storage/pbxt/src/table_xt.cc index a9fec660697..35b4ea3be3d 100644 --- a/storage/pbxt/src/table_xt.cc +++ b/storage/pbxt/src/table_xt.cc @@ -726,7 +726,7 @@ xtPublic void xt_check_tables(XTThreadPtr self) { u_int edx; XTTableEntryPtr te_ptr; - volatile XTTableHPtr tab; + volatile XTTableHPtr tab= 0; char path[PATH_MAX]; enter_(); @@ -1132,7 +1132,7 @@ static int tab_new_handle(XTThreadPtr self, XTTableHPtr *r_tab, XTDatabaseHPtr d XTOpenFilePtr of_rec, of_ind; XTTableEntryPtr te_ptr; size_t tab_format_offset; - size_t tab_head_size; + size_t tab_head_size= 0; enter_(); @@ -1755,6 +1755,8 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name, xtBool drop tab_close_mapped_files(self, tab); tab_delete_table_files(self, tab_name, tab_id); + /* Remove table from "repair-pending" */ + xt_tab_table_repaired(tab); ASSERT(xt_get_self() == self); if ((te_ptr = (XTTableEntryPtr) xt_sl_find(self, db->db_table_by_id, &tab_id))) { |