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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5d6fe277
Commit
5d6fe277
authored
May 17, 2006
by
joerg@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/M51/merge-5.1
parents
f253fd30
bf153b66
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
247 additions
and
38 deletions
+247
-38
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+4
-2
dbug/dbug.c
dbug/dbug.c
+71
-13
include/my_dbug.h
include/my_dbug.h
+3
-0
include/my_sys.h
include/my_sys.h
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+1
-1
mysql-test/valgrind.supp
mysql-test/valgrind.supp
+160
-21
mysys/my_init.c
mysys/my_init.c
+3
-1
sql/mysqld.cc
sql/mysqld.cc
+4
-0
No files found.
client/mysqlbinlog.cc
View file @
5d6fe277
...
...
@@ -815,7 +815,8 @@ static void die(const char* fmt, ...)
fprintf
(
stderr
,
"
\n
"
);
va_end
(
args
);
cleanup
();
my_end
(
0
);
/* We cannot free DBUG, it is used in global destructors after exit(). */
my_end
(
MY_DONT_FREE_DBUG
);
exit
(
1
);
}
...
...
@@ -1487,7 +1488,8 @@ int main(int argc, char** argv)
cleanup
();
free_defaults
(
defaults_argv
);
my_free_open_file_info
();
my_end
(
0
);
/* We cannot free DBUG, it is used in global destructors after exit(). */
my_end
(
MY_DONT_FREE_DBUG
);
exit
(
exit_value
);
DBUG_RETURN
(
exit_value
);
// Keep compilers happy
}
...
...
dbug/dbug.c
View file @
5d6fe277
...
...
@@ -255,6 +255,8 @@ static void DBUGOpenFile(CODE_STATE *,const char *, const char *, int);
static
void
DBUGCloseFile
(
CODE_STATE
*
cs
,
FILE
*
fp
);
/* Push current debug settings */
static
void
PushState
(
CODE_STATE
*
cs
);
/* Free memory associated with debug state. */
static
void
FreeState
(
CODE_STATE
*
cs
,
struct
settings
*
state
);
/* Test for tracing enabled */
static
BOOLEAN
DoTrace
(
CODE_STATE
*
cs
);
...
...
@@ -742,19 +744,7 @@ void _db_pop_()
if
(
discard
->
next
!=
NULL
)
{
cs
->
stack
=
discard
->
next
;
if
(
!
is_shared
(
discard
,
keywords
))
FreeList
(
discard
->
keywords
);
if
(
!
is_shared
(
discard
,
functions
))
FreeList
(
discard
->
functions
);
if
(
!
is_shared
(
discard
,
processes
))
FreeList
(
discard
->
processes
);
if
(
!
is_shared
(
discard
,
p_functions
))
FreeList
(
discard
->
p_functions
);
if
(
!
is_shared
(
discard
,
out_file
))
DBUGCloseFile
(
cs
,
discard
->
out_file
);
if
(
discard
->
prof_file
)
DBUGCloseFile
(
cs
,
discard
->
prof_file
);
free
((
char
*
)
discard
);
FreeState
(
cs
,
discard
);
}
}
...
...
@@ -1425,6 +1415,74 @@ static void PushState(CODE_STATE *cs)
cs
->
stack
=
new_malloc
;
}
/*
* FUNCTION
*
* FreeState Free memory associated with a struct state.
*
* SYNOPSIS
*
* static void FreeState (state)
* struct state *state;
*
* DESCRIPTION
*
* Deallocates the memory allocated for various information in a
* state.
*
*/
static
void
FreeState
(
CODE_STATE
*
cs
,
struct
settings
*
state
)
{
if
(
!
is_shared
(
state
,
keywords
))
FreeList
(
state
->
keywords
);
if
(
!
is_shared
(
state
,
functions
))
FreeList
(
state
->
functions
);
if
(
!
is_shared
(
state
,
processes
))
FreeList
(
state
->
processes
);
if
(
!
is_shared
(
state
,
p_functions
))
FreeList
(
state
->
p_functions
);
if
(
!
is_shared
(
state
,
out_file
))
DBUGCloseFile
(
cs
,
state
->
out_file
);
if
(
state
->
prof_file
)
DBUGCloseFile
(
cs
,
state
->
prof_file
);
free
((
char
*
)
state
);
}
/*
* FUNCTION
*
* _db_end_ End debugging, freeing state stack memory.
*
* SYNOPSIS
*
* static VOID _db_end_ ()
*
* DESCRIPTION
*
* Ends debugging, de-allocating the memory allocated to the
* state stack.
*
* To be called at the very end of the program.
*
*/
void
_db_end_
()
{
struct
settings
*
discard
;
CODE_STATE
*
cs
=
0
;
get_code_state_or_return
;
while
((
discard
=
cs
->
stack
)
!=
NULL
)
{
if
(
discard
==
&
init_settings
)
break
;
cs
->
stack
=
discard
->
next
;
FreeState
(
cs
,
discard
);
}
}
/*
* FUNCTION
...
...
include/my_dbug.h
View file @
5d6fe277
...
...
@@ -42,6 +42,7 @@ extern void _db_pargs_(uint _line_,const char *keyword);
extern
void
_db_doprnt_
_VARARGS
((
const
char
*
format
,...));
extern
void
_db_dump_
(
uint
_line_
,
const
char
*
keyword
,
const
char
*
memory
,
uint
length
);
extern
void
_db_end_
(
void
);
extern
void
_db_lock_file_
(
void
);
extern
void
_db_unlock_file_
(
void
);
extern
FILE
*
_db_fp_
(
void
);
...
...
@@ -73,6 +74,7 @@ extern FILE *_db_fp_(void);
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
#define DBUG_END() _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_()
#define DBUG_ASSERT(A) assert(A)
...
...
@@ -97,6 +99,7 @@ extern FILE *_db_fp_(void);
#define DBUG_SETJMP(a1) setjmp(a1)
#define DBUG_LONGJMP(a1) longjmp(a1)
#define DBUG_DUMP(keyword,a1,a2)
#define DBUG_END()
#define DBUG_ASSERT(A)
#define DBUG_LOCK_FILE
#define DBUG_FILE (stderr)
...
...
include/my_sys.h
View file @
5d6fe277
...
...
@@ -75,6 +75,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_CHECK_ERROR 1
/* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2
/* Give time info about process*/
#define MY_DONT_FREE_DBUG 4
/* Do not call DBUG_END() in my_end() */
#define ME_HIGHBYTE 8
/* Shift for colours */
#define ME_NOCUR 1
/* Don't use curses message */
...
...
libmysql/libmysql.c
View file @
5d6fe277
...
...
@@ -178,7 +178,7 @@ void STDCALL mysql_server_end()
/* If library called my_init(), free memory allocated by it */
if
(
!
org_my_init_done
)
{
my_end
(
0
);
my_end
(
MY_DONT_FREE_DBUG
);
/* Remove TRACING, if enabled by mysql_debug() */
DBUG_POP
();
}
...
...
mysql-test/valgrind.supp
View file @
5d6fe277
...
...
@@ -11,7 +11,7 @@
fun:calloc
fun:_dl_allocate_tls
fun:allocate_stack
fun:pthread_create
@@GLIBC_2.1
fun:pthread_create
*
}
{
...
...
@@ -81,15 +81,6 @@
fun:pthread_create*
}
{
pthread allocate_dtv memory loss second
Memcheck:Leak
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls
fun:pthread_create*
}
{
pthread memalign memory loss
Memcheck:Leak
...
...
@@ -120,17 +111,6 @@
obj:/lib/ld-*.so
}
{
pthread strstr uninit
Memcheck:Cond
fun:strstr
obj:/lib/tls/libpthread.so.*
obj:/lib/tls/libpthread.so.*
fun:call_init
fun:_dl_init
obj:/lib/ld-*.so
}
{
pthread errno
Memcheck:Leak
...
...
@@ -246,3 +226,162 @@
Memcheck:Cond
fun:_dl_relocate_object
}
#
# Leaks reported in _dl_* internal functions on Linux amd64 / glibc2.3.2.
#
{
_dl_start invalid write8
Memcheck:Addr8
fun:_dl_start
}
{
_dl_start invalid write4
Memcheck:Addr4
fun:_dl_start
}
{
_dl_start/_dl_setup_hash invalid read8
Memcheck:Addr8
fun:_dl_setup_hash
fun:_dl_start
}
{
_dl_sysdep_start invalid write8
Memcheck:Addr8
fun:_dl_sysdep_start
}
{
_dl_init invalid write8
Memcheck:Addr8
fun:_dl_init
}
{
_dl_init invalid write4
Memcheck:Addr4
fun:_dl_init
}
{
_dl_init/_dl_init invalid read8
Memcheck:Addr8
fun:_dl_debug_initialize
fun:_dl_init
}
{
_dl_init/_dl_debug_state invalid read8
Memcheck:Addr8
fun:_dl_debug_state
fun:_dl_init
}
{
init invalid write8
Memcheck:Addr8
fun:init
}
{
fixup invalid write8
Memcheck:Addr8
fun:fixup
}
{
fixup/_dl_lookup_versioned_symbol invalid read8
Memcheck:Addr8
fun:_dl_lookup_versioned_symbol
fun:fixup
}
{
_dl_runtime_resolve invalid read8
Memcheck:Addr8
fun:_dl_runtime_resolve
}
{
__libc_start_main invalid write8
Memcheck:Addr8
fun:__libc_start_main
}
{
__libc_start_main/__sigjmp_save invalid write4
Memcheck:Addr4
fun:__sigjmp_save
fun:__libc_start_main
}
#
# These seem to be libc threading stuff, not related to MySQL code (allocations
# during pthread_exit()). Googling shows other projects also using these
# suppressions.
#
# Note that these all stem from pthread_exit() deeper in the call stack, but
# Valgrind only allows the top four calls in the suppressions.
#
{
libc pthread_exit 1
Memcheck:Leak
fun:malloc
fun:_dl_new_object
fun:_dl_map_object_from_fd
fun:_dl_map_object
}
{
libc pthread_exit 2
Memcheck:Leak
fun:malloc
fun:_dl_map_object
fun:dl_open_worker
fun:_dl_catch_error
}
{
libc pthread_exit 3
Memcheck:Leak
fun:malloc
fun:_dl_map_object_deps
fun:dl_open_worker
fun:_dl_catch_error
}
{
libc pthread_exit 4
Memcheck:Leak
fun:calloc
fun:_dl_check_map_versions
fun:dl_open_worker
fun:_dl_catch_error
}
{
libc pthread_exit 5
Memcheck:Leak
fun:calloc
fun:_dl_new_object
fun:_dl_map_object_from_fd
fun:_dl_map_object
}
#
# This is seen internally in the system libraries on 64-bit RHAS3.
#
{
__lll_mutex_unlock_wake uninitialized
Memcheck:Param
futex(utime)
fun:__lll_mutex_unlock_wake
}
mysys/my_init.c
View file @
5d6fe277
...
...
@@ -197,8 +197,10 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
_CrtDumpMemoryLeaks
();
#endif
}
if
(
!
(
infoflag
&
MY_DONT_FREE_DBUG
))
DBUG_END
();
/* Must be done before my_thread_end */
#ifdef THREAD
DBUG_POP
();
/* Must be done before my_thread_end */
my_thread_end
();
my_thread_global_end
();
#if defined(SAFE_MUTEX)
...
...
sql/mysqld.cc
View file @
5d6fe277
...
...
@@ -1075,6 +1075,10 @@ static void __cdecl kill_server(int sig_ptr)
pthread_join
(
select_thread
,
NULL
);
// wait for main thread
#endif
/* __NETWARE__ */
#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2))
my_thread_end
();
#endif
pthread_exit
(
0
);
/* purecov: deadcode */
#endif
/* EMBEDDED_LIBRARY */
...
...
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