summaryrefslogtreecommitdiff
path: root/innobase/mem
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-08 15:24:47 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-08 15:24:47 +0300
commit267b80834ad524c0d72976bc71e5b5bc9815ea1a (patch)
treee7f4a2013ed3d66e640f6574e62cb7e534a5d77f /innobase/mem
parentca1875f54033c5ea067ec3ec07b00375de6975d7 (diff)
parent40d3c3901b0427eba76119730f46784f946990b3 (diff)
downloadmariadb-git-267b80834ad524c0d72976bc71e5b5bc9815ea1a.tar.gz
merge with 3.23.52
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged Docs/manual.texi: Auto merged include/my_pthread.h: Auto merged include/mysql_com.h: Auto merged include/mysql_version.h.in: Auto merged innobase/btr/btr0cur.c: Auto merged innobase/btr/btr0sea.c: Auto merged innobase/buf/buf0buf.c: Auto merged innobase/buf/buf0lru.c: Auto merged innobase/configure.in: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/fsp/fsp0fsp.c: Auto merged innobase/include/buf0buf.ic: Auto merged innobase/include/dyn0dyn.ic: Auto merged innobase/include/ha0ha.ic: Auto merged innobase/include/sync0rw.ic: Auto merged innobase/include/univ.i: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/log/log0log.c: Auto merged innobase/mem/mem0dbg.c: Auto merged innobase/os/os0file.c: Auto merged innobase/os/os0thread.c: Auto merged innobase/page/page0cur.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/sync/sync0arr.c: Auto merged innobase/sync/sync0rw.c: Auto merged innobase/sync/sync0sync.c: Auto merged innobase/trx/trx0trx.c: Auto merged myisam/mi_create.c: Auto merged sql/ha_innodb.h: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_insert.cc: Auto merged strings/Makefile.am: Auto merged support-files/mysql.server.sh: Auto merged include/my_base.h: merge with 3.23.52 (use local file) include/sslopt-usage.h: merge with 3.23.52 (use local file) myisam/mi_search.c: merge with 3.23.52 (use local file) myisam/mi_write.c: merge with 3.23.52 (use local file) mysql-test/r/group_by.result: merge with 3.23.52 (Need to be fixed before push) mysys/my_pthread.c: merge with 3.23.52 (use local file) sql/gen_lex_hash.cc: merge with 3.23.52 (use local file) sql/ha_innodb.cc: Total hand-merge with 3.23.52 sql/sql_yacc.yy: merge with 3.23.52 (use local file) support-files/mysql.spec.sh: merge with 3.23.52 (use local file)
Diffstat (limited to 'innobase/mem')
-rw-r--r--innobase/mem/mem0dbg.c2
-rw-r--r--innobase/mem/mem0pool.c53
2 files changed, 51 insertions, 4 deletions
diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c
index f94119b7f38..23585e494b8 100644
--- a/innobase/mem/mem0dbg.c
+++ b/innobase/mem/mem0dbg.c
@@ -668,7 +668,7 @@ mem_print_info_low(
mem_pool_print_info(outfile, mem_comm_pool);
- mem_validate();
+/* mem_validate(); */
/* fclose(outfile); */
#endif
diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c
index 3681c8ef779..61cf1e50ce9 100644
--- a/innobase/mem/mem0pool.c
+++ b/innobase/mem/mem0pool.c
@@ -251,6 +251,7 @@ mem_pool_fill_free_list(
mem_area_t* area;
mem_area_t* area2;
ibool ret;
+ char err_buf[500];
ut_ad(mutex_own(&(pool->mutex)));
@@ -279,15 +280,34 @@ mem_pool_fill_free_list(
area = UT_LIST_GET_FIRST(pool->free_list[i + 1]);
if (area == NULL) {
+ if (UT_LIST_GET_LEN(pool->free_list[i + 1]) > 0) {
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+" InnoDB: Error: mem pool free list %lu length is %lu\n"
+"InnoDB: though the list is empty!\n",
+ i + 1, UT_LIST_GET_LEN(pool->free_list[i + 1]));
+ }
+
ret = mem_pool_fill_free_list(i + 1, pool);
if (ret == FALSE) {
+
return(FALSE);
}
area = UT_LIST_GET_FIRST(pool->free_list[i + 1]);
}
-
+
+ if (UT_LIST_GET_LEN(pool->free_list[i + 1]) == 0) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Removing element from mem pool free list %lu\n"
+"InnoDB: though the list length is 0! Dump of 100 bytes around element:\n%s\n",
+ i + 1, err_buf);
+ ut_a(0);
+ }
+
UT_LIST_REMOVE(free_list, pool->free_list[i + 1], area);
area2 = (mem_area_t*)(((byte*)area) + ut_2_exp(i));
@@ -320,6 +340,7 @@ mem_area_alloc(
mem_area_t* area;
ulint n;
ibool ret;
+ char err_buf[500];
n = ut_2_log(ut_max(size + MEM_AREA_EXTRA_SIZE, MEM_AREA_MIN_SIZE));
@@ -342,7 +363,24 @@ mem_area_alloc(
area = UT_LIST_GET_FIRST(pool->free_list[n]);
}
- ut_a(mem_area_get_free(area));
+ if (!mem_area_get_free(area)) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Removing element from mem pool free list %lu though the\n"
+"InnoDB: element is not marked free! Dump of 100 bytes around element:\n%s\n",
+ n, err_buf);
+ ut_a(0);
+ }
+
+ if (UT_LIST_GET_LEN(pool->free_list[n]) == 0) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Removing element from mem pool free list %lu\n"
+"InnoDB: though the list length is 0! Dump of 100 bytes around element:\n%s\n",
+ n, err_buf);
+ ut_a(0);
+ }
+
ut_ad(mem_area_get_size(area) == ut_2_exp(n));
mem_area_set_free(area, FALSE);
@@ -413,6 +451,7 @@ mem_area_free(
void* new_ptr;
ulint size;
ulint n;
+ char err_buf[500];
if (mem_out_of_mem_err_msg_count > 0) {
/* It may be that the area was really allocated from the
@@ -429,10 +468,18 @@ mem_area_free(
area = (mem_area_t*) (((byte*)ptr) - MEM_AREA_EXTRA_SIZE);
+ if (mem_area_get_free(area)) {
+ ut_sprintf_buf(err_buf, ((byte*)area) - 50, 100);
+ fprintf(stderr,
+"InnoDB: Error: Freeing element to mem pool free list though the\n"
+"InnoDB: element is marked free! Dump of 100 bytes around element:\n%s\n",
+ err_buf);
+ ut_a(0);
+ }
+
size = mem_area_get_size(area);
ut_ad(size != 0);
- ut_a(!mem_area_get_free(area));
#ifdef UNIV_LIGHT_MEM_DEBUG
if (((byte*)area) + size < pool->buf + pool->size) {