This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | MEM_FIELD_HEADER_SIZE 0 |
| #define | MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT) |
Functions | |
| void | mem_heap_validate_or_print (mem_heap_t *heap, byte *top, ibool print, ibool *error, ulint *us_size, ulint *ph_size, ulint *n_blocks) |
| ibool | mem_heap_check (mem_heap_t *heap) |
| ibool | mem_heap_validate (mem_heap_t *heap) |
| void | mem_analyze_corruption (void *ptr) |
| void | mem_print_info (void) |
| void | mem_print_new_info (void) |
| #define MEM_FIELD_HEADER_SIZE 0 |
Definition at line 18 of file mem0dbg.h.
Referenced by mem_field_erase(), mem_field_init(), and mem_heap_validate_or_print().
Definition at line 30 of file mem0dbg.h.
Referenced by mem_field_erase(), mem_heap_create_block(), and mem_heap_validate_or_print().
| void mem_analyze_corruption | ( | void * | ptr | ) |
Definition at line 733 of file mem0dbg.c.
References MEM_BLOCK_MAGIC_N, MEM_FREED_BLOCK_MAGIC_N, p, and ut_print_buf().
Referenced by mem_area_alloc(), mem_area_free(), mem_heap_block_free(), mem_heap_create_block(), mem_pool_fill_free_list(), que_graph_free_recursive(), que_thr_move_to_run_state_for_mysql(), que_thr_stop_for_mysql_no_error(), row_insert_for_mysql(), row_prebuilt_free(), row_search_for_mysql(), row_update_for_mysql(), row_update_prebuilt_trx(), trx_undo_mem_init_for_reuse(), trx_undo_reuse_cached(), trx_undo_set_state_at_finish(), and trx_undo_set_state_at_prepare().
00735 : pointer to place of possible corruption */ 00736 { 00737 byte* p; 00738 ulint i; 00739 ulint dist; 00740 00741 fputs("InnoDB: Apparent memory corruption: mem dump ", stderr); 00742 ut_print_buf(stderr, (byte*)ptr - 250, 500); 00743 00744 fputs("\nInnoDB: Scanning backward trying to find previous allocated mem blocks\n", stderr); 00745 00746 p = (byte*)ptr; 00747 dist = 0; 00748 00749 for (i = 0; i < 10; i++) { 00750 for (;;) { 00751 if (((ulint)p) % 4 == 0) { 00752 00753 if (*((ulint*)p) == MEM_BLOCK_MAGIC_N) { 00754 fprintf(stderr, 00755 "Mem block at - %lu, file %s, line %lu\n", 00756 (ulong) dist, (p + sizeof(ulint)), 00757 (ulong) (*(ulint*)(p + 8 + sizeof(ulint)))); 00758 00759 break; 00760 } 00761 00762 if (*((ulint*)p) == MEM_FREED_BLOCK_MAGIC_N) { 00763 fprintf(stderr, 00764 "Freed mem block at - %lu, file %s, line %lu\n", 00765 (ulong) dist, (p + sizeof(ulint)), 00766 (ulong) (*(ulint*)(p + 8 + sizeof(ulint)))); 00767 00768 break; 00769 } 00770 } 00771 00772 p--; 00773 dist++; 00774 } 00775 00776 p--; 00777 dist++; 00778 } 00779 00780 fprintf(stderr, 00781 "InnoDB: Scanning forward trying to find next allocated mem blocks\n"); 00782 00783 p = (byte*)ptr; 00784 dist = 0; 00785 00786 for (i = 0; i < 10; i++) { 00787 for (;;) { 00788 if (((ulint)p) % 4 == 0) { 00789 00790 if (*((ulint*)p) == MEM_BLOCK_MAGIC_N) { 00791 fprintf(stderr, 00792 "Mem block at + %lu, file %s, line %lu\n", 00793 (ulong) dist, (p + sizeof(ulint)), 00794 (ulong) (*(ulint*)(p + 8 + sizeof(ulint)))); 00795 00796 break; 00797 } 00798 00799 if (*((ulint*)p) == MEM_FREED_BLOCK_MAGIC_N) { 00800 fprintf(stderr, 00801 "Freed mem block at + %lu, file %s, line %lu\n", 00802 (ulong) dist, (p + sizeof(ulint)), 00803 (ulong) (*(ulint*)(p + 8 + sizeof(ulint)))); 00804 00805 break; 00806 } 00807 } 00808 00809 p++; 00810 dist++; 00811 } 00812 00813 p++; 00814 dist++; 00815 } 00816 }
Here is the call graph for this function:

Here is the caller graph for this function:

| ibool mem_heap_check | ( | mem_heap_t * | heap | ) |
Definition at line 569 of file mem0dbg.c.
References MEM_BLOCK_MAGIC_N, TRUE, and ut_a.
Referenced by mem_heap_add_block(), mem_heap_print(), and mem_heap_validate().
00571 : TRUE if ok */ 00572 mem_heap_t* heap) /* in: memory heap */ 00573 { 00574 ut_a(heap->magic_n == MEM_BLOCK_MAGIC_N); 00575 00576 return(TRUE); 00577 }
Here is the caller graph for this function:

| ibool mem_heap_validate | ( | mem_heap_t * | heap | ) |
Definition at line 583 of file mem0dbg.c.
References mem_heap_check(), mem_heap_print(), mem_heap_validate_or_print(), NULL, TRUE, ut_a, and ut_ad.
Referenced by dict_index_add_to_cache().
00585 : TRUE if ok */ 00586 mem_heap_t* heap) /* in: memory heap */ 00587 { 00588 ibool error; 00589 ulint us_size; 00590 ulint phys_size; 00591 ulint n_blocks; 00592 00593 ut_ad(mem_heap_check(heap)); 00594 00595 mem_heap_validate_or_print(heap, NULL, FALSE, &error, &us_size, 00596 &phys_size, &n_blocks); 00597 if (error) { 00598 mem_heap_print(heap); 00599 } 00600 00601 ut_a(!error); 00602 00603 return(TRUE); 00604 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void mem_heap_validate_or_print | ( | mem_heap_t * | heap, | |
| byte * | top, | |||
| ibool | print, | |||
| ibool * | error, | |||
| ulint * | us_size, | |||
| ulint * | ph_size, | |||
| ulint * | n_blocks | |||
| ) |
Referenced by mem_heap_print(), mem_heap_validate(), and mem_print_info_low().
Here is the caller graph for this function:

| void mem_print_info | ( | void | ) |
Definition at line 926 of file mem0dbg.c.
References mem_print_info_low(), and TRUE.
00928 { 00929 mem_print_info_low(TRUE); 00930 }
Here is the call graph for this function:

| void mem_print_new_info | ( | void | ) |
Definition at line 937 of file mem0dbg.c.
References mem_print_info_low().
00939 { 00940 mem_print_info_low(FALSE); 00941 }
Here is the call graph for this function:

1.4.7

