Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
52d2051e
Commit
52d2051e
authored
Mar 06, 2006
by
osku
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change ut_print_buf() and mem_analyze_corruption() to take a void*, not a
byte*. Remove redundant casts from callers.
parent
c016a86f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
38 additions
and
38 deletions
+38
-38
btr/btr0pcur.c
btr/btr0pcur.c
+1
-1
buf/buf0flu.c
buf/buf0flu.c
+1
-1
handler/ha_innodb.cc
handler/ha_innodb.cc
+1
-1
include/mem0dbg.h
include/mem0dbg.h
+1
-1
include/ut0ut.h
include/ut0ut.h
+1
-1
mem/mem0dbg.c
mem/mem0dbg.c
+4
-4
mem/mem0mem.c
mem/mem0mem.c
+3
-3
mem/mem0pool.c
mem/mem0pool.c
+6
-6
que/que0que.c
que/que0que.c
+4
-4
row/row0mysql.c
row/row0mysql.c
+7
-7
row/row0sel.c
row/row0sel.c
+1
-1
trx/trx0trx.c
trx/trx0trx.c
+1
-1
trx/trx0undo.c
trx/trx0undo.c
+4
-4
ut/ut0ut.c
ut/ut0ut.c
+3
-3
No files found.
btr/btr0pcur.c
View file @
52d2051e
...
...
@@ -158,7 +158,7 @@ btr_pcur_copy_stored_position(
mem_free
(
pcur_receive
->
old_rec_buf
);
}
ut_memcpy
(
(
byte
*
)
pcur_receive
,
(
byte
*
)
pcur_donate
,
sizeof
(
btr_pcur_t
));
ut_memcpy
(
pcur_receive
,
pcur_donate
,
sizeof
(
btr_pcur_t
));
if
(
pcur_donate
->
old_rec_buf
)
{
...
...
buf/buf0flu.c
View file @
52d2051e
...
...
@@ -120,7 +120,7 @@ buf_flush_ready_for_replace(
fprintf
(
stderr
,
" InnoDB: Error: buffer block state %lu in the LRU list!
\n
"
,
(
ulong
)
block
->
state
);
ut_print_buf
(
stderr
,
(
byte
*
)
block
,
sizeof
(
buf_block_t
));
ut_print_buf
(
stderr
,
block
,
sizeof
(
buf_block_t
));
return
(
FALSE
);
}
...
...
handler/ha_innodb.cc
View file @
52d2051e
...
...
@@ -792,7 +792,7 @@ check_trx_exists(
thd
->
ha_data
[
innobase_hton
.
slot
]
=
trx
;
}
else
{
if
(
trx
->
magic_n
!=
TRX_MAGIC_N
)
{
mem_analyze_corruption
(
(
byte
*
)
trx
);
mem_analyze_corruption
(
trx
);
ut_a
(
0
);
}
...
...
include/mem0dbg.h
View file @
52d2051e
...
...
@@ -114,7 +114,7 @@ the neighborhood of a given pointer. */
void
mem_analyze_corruption
(
/*===================*/
byte
*
ptr
);
/* in: pointer to place of possible corruption */
void
*
ptr
);
/* in: pointer to place of possible corruption */
/*********************************************************************
Prints information of dynamic memory usage and currently allocated memory
heaps or buffers. Can only be used in the debug version. */
...
...
include/ut0ut.h
View file @
52d2051e
...
...
@@ -202,7 +202,7 @@ void
ut_print_buf
(
/*=========*/
FILE
*
file
,
/* in: file where to print */
const
byte
*
buf
,
/* in: memory buffer */
const
void
*
buf
,
/* in: memory buffer */
ulint
len
);
/* in: length of the buffer */
/**************************************************************************
...
...
mem/mem0dbg.c
View file @
52d2051e
...
...
@@ -733,18 +733,18 @@ the neighborhood of a given pointer. */
void
mem_analyze_corruption
(
/*===================*/
byte
*
ptr
)
/* in: pointer to place of possible corruption */
void
*
ptr
)
/* in: pointer to place of possible corruption */
{
byte
*
p
;
ulint
i
;
ulint
dist
;
fputs
(
"InnoDB: Apparent memory corruption: mem dump "
,
stderr
);
ut_print_buf
(
stderr
,
ptr
-
250
,
500
);
ut_print_buf
(
stderr
,
(
byte
*
)
ptr
-
250
,
500
);
fputs
(
"
\n
InnoDB: Scanning backward trying to find previous allocated mem blocks
\n
"
,
stderr
);
p
=
ptr
;
p
=
(
byte
*
)
ptr
;
dist
=
0
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
...
...
@@ -781,7 +781,7 @@ mem_analyze_corruption(
fprintf
(
stderr
,
"InnoDB: Scanning forward trying to find next allocated mem blocks
\n
"
);
p
=
ptr
;
p
=
(
byte
*
)
ptr
;
dist
=
0
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
...
...
mem/mem0mem.c
View file @
52d2051e
...
...
@@ -141,7 +141,7 @@ mem_heap_create_block(
||
(
type
==
MEM_HEAP_BUFFER
+
MEM_HEAP_BTR_SEARCH
));
if
(
heap
&&
heap
->
magic_n
!=
MEM_BLOCK_MAGIC_N
)
{
mem_analyze_corruption
(
(
byte
*
)
heap
);
mem_analyze_corruption
(
heap
);
}
/* In dynamic allocation, calculate the size: block header + data. */
...
...
@@ -286,7 +286,7 @@ mem_heap_block_free(
ibool
init_block
;
if
(
block
->
magic_n
!=
MEM_BLOCK_MAGIC_N
)
{
mem_analyze_corruption
(
(
byte
*
)
block
);
mem_analyze_corruption
(
block
);
}
UT_LIST_REMOVE
(
list
,
heap
->
base
,
block
);
...
...
@@ -361,7 +361,7 @@ mem_validate_all_blocks(void)
while
(
block
)
{
if
(
block
->
magic_n
!=
MEM_BLOCK_MAGIC_N
)
{
mem_analyze_corruption
(
(
byte
*
)
block
);
mem_analyze_corruption
(
block
);
}
block
=
UT_LIST_GET_NEXT
(
mem_block_list
,
block
);
...
...
mem/mem0pool.c
View file @
52d2051e
...
...
@@ -294,7 +294,7 @@ mem_pool_fill_free_list(
}
if
(
UT_LIST_GET_LEN
(
pool
->
free_list
[
i
+
1
])
==
0
)
{
mem_analyze_corruption
(
(
byte
*
)
area
);
mem_analyze_corruption
(
area
);
ut_error
;
}
...
...
@@ -363,7 +363,7 @@ mem_area_alloc(
"InnoDB: element is not marked free!
\n
"
,
(
ulong
)
n
);
mem_analyze_corruption
(
(
byte
*
)
area
);
mem_analyze_corruption
(
area
);
/* Try to analyze a strange assertion failure reported at
mysql@lists.mysql.com where the free bit IS 1 in the
...
...
@@ -382,7 +382,7 @@ mem_area_alloc(
"InnoDB: Error: Removing element from mem pool free list %lu
\n
"
"InnoDB: though the list length is 0!
\n
"
,
(
ulong
)
n
);
mem_analyze_corruption
(
(
byte
*
)
area
);
mem_analyze_corruption
(
area
);
ut_error
;
}
...
...
@@ -475,7 +475,7 @@ mem_area_free(
"InnoDB: Error: Freeing element to mem pool free list though the
\n
"
"InnoDB: element is marked free!
\n
"
);
mem_analyze_corruption
(
(
byte
*
)
area
);
mem_analyze_corruption
(
area
);
ut_error
;
}
...
...
@@ -486,7 +486,7 @@ mem_area_free(
"InnoDB: Error: Mem area size is 0. Possibly a memory overrun of the
\n
"
"InnoDB: previous allocated area!
\n
"
);
mem_analyze_corruption
(
(
byte
*
)
area
);
mem_analyze_corruption
(
area
);
ut_error
;
}
...
...
@@ -502,7 +502,7 @@ mem_area_free(
"InnoDB: Error: Memory area size %lu, next area size %lu not a power of 2!
\n
"
"InnoDB: Possibly a memory overrun of the buffer being freed here.
\n
"
,
(
ulong
)
size
,
(
ulong
)
next_size
);
mem_analyze_corruption
(
(
byte
*
)
area
);
mem_analyze_corruption
(
area
);
ut_error
;
}
...
...
que/que0que.c
View file @
52d2051e
...
...
@@ -487,7 +487,7 @@ que_graph_free_recursive(
fprintf
(
stderr
,
"que_thr struct appears corrupt; magic n %lu
\n
"
,
(
unsigned
long
)
thr
->
magic_n
);
mem_analyze_corruption
(
(
byte
*
)
thr
);
mem_analyze_corruption
(
thr
);
ut_error
;
}
...
...
@@ -599,7 +599,7 @@ que_graph_free_recursive(
fprintf
(
stderr
,
"que_node struct appears corrupt; type %lu
\n
"
,
(
unsigned
long
)
que_node_get_type
(
node
));
mem_analyze_corruption
(
(
byte
*
)
node
);
mem_analyze_corruption
(
node
);
ut_error
;
}
}
...
...
@@ -990,7 +990,7 @@ que_thr_move_to_run_state_for_mysql(
"que_thr struct appears corrupt; magic n %lu
\n
"
,
(
unsigned
long
)
thr
->
magic_n
);
mem_analyze_corruption
(
(
byte
*
)
thr
);
mem_analyze_corruption
(
thr
);
ut_error
;
}
...
...
@@ -1027,7 +1027,7 @@ que_thr_stop_for_mysql_no_error(
"que_thr struct appears corrupt; magic n %lu
\n
"
,
(
unsigned
long
)
thr
->
magic_n
);
mem_analyze_corruption
(
(
byte
*
)
thr
);
mem_analyze_corruption
(
thr
);
ut_error
;
}
...
...
row/row0mysql.c
View file @
52d2051e
...
...
@@ -207,7 +207,7 @@ row_mysql_store_blob_ref(
mach_write_to_n_little_endian
(
dest
,
col_len
-
8
,
len
);
ut_memcpy
(
dest
+
col_len
-
8
,
(
byte
*
)
&
data
,
sizeof
(
byte
*
));
ut_memcpy
(
dest
+
col_len
-
8
,
&
data
,
sizeof
(
byte
*
));
}
/***********************************************************************
...
...
@@ -226,7 +226,7 @@ row_mysql_read_blob_ref(
*
len
=
mach_read_from_n_little_endian
(
ref
,
col_len
-
8
);
ut_memcpy
(
(
byte
*
)
&
data
,
ref
+
col_len
-
8
,
sizeof
(
byte
*
));
ut_memcpy
(
&
data
,
ref
+
col_len
-
8
,
sizeof
(
byte
*
));
return
(
data
);
}
...
...
@@ -681,7 +681,7 @@ row_prebuilt_free(
ut_print_name
(
stderr
,
NULL
,
prebuilt
->
table
->
name
);
putc
(
'\n'
,
stderr
);
mem_analyze_corruption
(
(
byte
*
)
prebuilt
);
mem_analyze_corruption
(
prebuilt
);
ut_error
;
}
...
...
@@ -761,7 +761,7 @@ row_update_prebuilt_trx(
"InnoDB: trx handle. Magic n %lu
\n
"
,
(
ulong
)
trx
->
magic_n
);
mem_analyze_corruption
(
(
byte
*
)
trx
);
mem_analyze_corruption
(
trx
);
ut_error
;
}
...
...
@@ -774,7 +774,7 @@ row_update_prebuilt_trx(
ut_print_name
(
stderr
,
NULL
,
prebuilt
->
table
->
name
);
putc
(
'\n'
,
stderr
);
mem_analyze_corruption
(
(
byte
*
)
prebuilt
);
mem_analyze_corruption
(
prebuilt
);
ut_error
;
}
...
...
@@ -1095,7 +1095,7 @@ row_insert_for_mysql(
ut_print_name
(
stderr
,
prebuilt
->
trx
,
prebuilt
->
table
->
name
);
putc
(
'\n'
,
stderr
);
mem_analyze_corruption
(
(
byte
*
)
prebuilt
);
mem_analyze_corruption
(
prebuilt
);
ut_error
;
}
...
...
@@ -1330,7 +1330,7 @@ row_update_for_mysql(
ut_print_name
(
stderr
,
prebuilt
->
trx
,
prebuilt
->
table
->
name
);
putc
(
'\n'
,
stderr
);
mem_analyze_corruption
(
(
byte
*
)
prebuilt
);
mem_analyze_corruption
(
prebuilt
);
ut_error
;
}
...
...
row/row0sel.c
View file @
52d2051e
...
...
@@ -3161,7 +3161,7 @@ row_search_for_mysql(
ut_print_name
(
stderr
,
trx
,
prebuilt
->
table
->
name
);
putc
(
'\n'
,
stderr
);
mem_analyze_corruption
(
(
byte
*
)
prebuilt
);
mem_analyze_corruption
(
prebuilt
);
ut_error
;
}
...
...
trx/trx0trx.c
View file @
52d2051e
...
...
@@ -307,7 +307,7 @@ trx_free(
trx_print
(
stderr
,
trx
,
600
);
ut_print_buf
(
stderr
,
(
byte
*
)
trx
,
sizeof
(
trx_t
));
ut_print_buf
(
stderr
,
trx
,
sizeof
(
trx_t
));
}
ut_a
(
trx
->
magic_n
==
TRX_MAGIC_N
);
...
...
trx/trx0undo.c
View file @
52d2051e
...
...
@@ -1443,7 +1443,7 @@ trx_undo_mem_init_for_reuse(
fprintf
(
stderr
,
"InnoDB: Error: undo->id is %lu
\n
"
,
(
ulong
)
undo
->
id
);
mem_analyze_corruption
(
(
byte
*
)
undo
);
mem_analyze_corruption
(
undo
);
ut_error
;
}
...
...
@@ -1589,7 +1589,7 @@ trx_undo_reuse_cached(
if
(
undo
->
id
>=
TRX_RSEG_N_SLOTS
)
{
fprintf
(
stderr
,
"InnoDB: Error: undo->id is %lu
\n
"
,
(
ulong
)
undo
->
id
);
mem_analyze_corruption
(
(
byte
*
)
undo
);
mem_analyze_corruption
(
undo
);
ut_error
;
}
...
...
@@ -1737,7 +1737,7 @@ trx_undo_set_state_at_finish(
if
(
undo
->
id
>=
TRX_RSEG_N_SLOTS
)
{
fprintf
(
stderr
,
"InnoDB: Error: undo->id is %lu
\n
"
,
(
ulong
)
undo
->
id
);
mem_analyze_corruption
(
(
byte
*
)
undo
);
mem_analyze_corruption
(
undo
);
ut_error
;
}
...
...
@@ -1787,7 +1787,7 @@ trx_undo_set_state_at_prepare(
if
(
undo
->
id
>=
TRX_RSEG_N_SLOTS
)
{
fprintf
(
stderr
,
"InnoDB: Error: undo->id is %lu
\n
"
,
(
ulong
)
undo
->
id
);
mem_analyze_corruption
(
(
byte
*
)
undo
);
mem_analyze_corruption
(
undo
);
ut_error
;
}
...
...
ut/ut0ut.c
View file @
52d2051e
...
...
@@ -307,7 +307,7 @@ void
ut_print_buf
(
/*=========*/
FILE
*
file
,
/* in: file where to print */
const
byte
*
buf
,
/* in: memory buffer */
const
void
*
buf
,
/* in: memory buffer */
ulint
len
)
/* in: length of the buffer */
{
const
byte
*
data
;
...
...
@@ -315,13 +315,13 @@ ut_print_buf(
fprintf
(
file
,
" len %lu; hex "
,
len
);
for
(
data
=
buf
,
i
=
0
;
i
<
len
;
i
++
)
{
for
(
data
=
(
const
byte
*
)
buf
,
i
=
0
;
i
<
len
;
i
++
)
{
fprintf
(
file
,
"%02lx"
,
(
ulong
)
*
data
++
);
}
fputs
(
"; asc "
,
file
);
data
=
buf
;
data
=
(
const
byte
*
)
buf
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
int
c
=
(
int
)
*
data
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment