From 7f80cffa52d20aad308ccf2b2791dde477d5ec22 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Tue, 28 Sep 2010 11:07:58 +0200 Subject: Bug #46165 server crash in dbug This crash occured if the same debug trace file was closed twice, leading to the same memory being free'd twice. This could occur if the "debug" server system variable refered to the same trace file in both global and session scope. Example of an order of events that would lead to a crash: 1) Enable debug tracing to a trace file (global scope) 2) Enable debug tracing to the same trace file (session scope) 3) Reset debug settings (global scope) 4) Reset debug settings (session scope) This caused a crash because the trace file was, by mistake, closed in 3), leading to the same memory being free'd twice when the file was closed again in 4). Internally, the debug settings are stored in a stack, with session settings (if any) on top and the global settings below. Each connection has its own stack. When a set of settings is changed, it must be determined if its debug trace file is to be closed. Before, this was done by only checking below on the settings stack. So if the global settings were changed, an existing debug trace file reference in session settings would be missed. This caused the file to be closed even if it was in use, leading to a crash later when it was closed again. This patch fixes the problem by preventing the trace file from being shared between global and session settings. If session debug settings are set without specifying a new trace file, stderr is used for output. This is a change in behaviour and should be reflected in the documentation. Test case added to variables.test. --- dbug/dbug.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'dbug') diff --git a/dbug/dbug.c b/dbug/dbug.c index 4968d9e0568..5029bbb8d61 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -515,11 +515,16 @@ int DbugParse(CODE_STATE *cs, const char *control) stack->maxdepth= stack->next->maxdepth; stack->sub_level= stack->next->sub_level; strcpy(stack->name, stack->next->name); - stack->out_file= stack->next->out_file; stack->prof_file= stack->next->prof_file; if (stack->next == &init_settings) { - /* never share with the global parent - it can change under your feet */ + /* + Never share with the global parent - it can change under your feet. + + Reset out_file to stderr to prevent sharing of trace files between + global and session settings. + */ + stack->out_file= stderr; stack->functions= ListCopy(init_settings.functions); stack->p_functions= ListCopy(init_settings.p_functions); stack->keywords= ListCopy(init_settings.keywords); @@ -527,6 +532,7 @@ int DbugParse(CODE_STATE *cs, const char *control) } else { + stack->out_file= stack->next->out_file; stack->functions= stack->next->functions; stack->p_functions= stack->next->p_functions; stack->keywords= stack->next->keywords; -- cgit v1.2.1 From 9074307102644d43b934ce52cc0661890098698b Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 18 Oct 2010 13:24:34 +0200 Subject: Bug#52172 test binlog.binlog_index needs --skip-core-file to avoid leaving core files For crash testing: kill the server without generating core file. include/my_dbug.h Use kill(getpid(), SIGKILL) which cannot be caught by signal handlers. All DBUG_XXX macros should be no-ops in optimized mode, do that for DBUG_ABORT as well. sql/handler.cc Kill server without generating core. sql/log.cc Kill server without generating core. --- dbug/dbug.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dbug') diff --git a/dbug/dbug.c b/dbug/dbug.c index 76723fa8767..7278acca2a9 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -2267,6 +2267,14 @@ static void dbug_flush(CODE_STATE *cs) } /* dbug_flush */ +void _db_flush_() +{ + CODE_STATE *cs; + get_code_state_or_return; + (void) fflush(cs->stack->out_file); +} + + void _db_lock_file_() { CODE_STATE *cs=0; -- cgit v1.2.1 From af665ea977698676080f0e175363dc0c83755938 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Tue, 19 Oct 2010 09:06:48 +0200 Subject: Bug#52172 post-push fix: init auto-variable to NULL --- dbug/dbug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dbug') diff --git a/dbug/dbug.c b/dbug/dbug.c index 7278acca2a9..e5e11d5be00 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -2269,7 +2269,7 @@ static void dbug_flush(CODE_STATE *cs) void _db_flush_() { - CODE_STATE *cs; + CODE_STATE *cs= NULL; get_code_state_or_return; (void) fflush(cs->stack->out_file); } -- cgit v1.2.1 From 4776282bede4da8cceeee1ce450310b281e34af9 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Tue, 19 Oct 2010 10:19:57 +0200 Subject: Bug #57274 SET GLOBAL debug crashes on Solaris in embedded server mode (variables_debug fails) The problem was that "SET GLOBAL debug" could cause a crash on Solaris. The crash happened if the server failed to open the trace file given in the "SET GLOBAL debug" statement. This caused an error message to be printed to stderr containing the process name. However, printing to stderr crashed the server since the pointer to the process name had not been initialized. This patch fixes the problem by initializing the process name properly when doing "SET GLOBAL debug". No test case added as this bug was repeatable with existing test coverage in variables_debug.test. --- dbug/dbug.c | 1 + 1 file changed, 1 insertion(+) (limited to 'dbug') diff --git a/dbug/dbug.c b/dbug/dbug.c index e5e11d5be00..fecdd4f8a6c 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -744,6 +744,7 @@ void _db_set_init_(const char *control) CODE_STATE tmp_cs; bzero((uchar*) &tmp_cs, sizeof(tmp_cs)); tmp_cs.stack= &init_settings; + tmp_cs.process= db_process ? db_process : "dbug"; DbugParse(&tmp_cs, control); } -- cgit v1.2.1 From 8664de2230300967537d75a9ec51d15c400ca36d Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 20 Nov 2010 12:47:50 -0200 Subject: WL#5665: Removal of the autotools-based build system The autotools-based build system has been superseded and is being removed in order to ease the maintenance burden on developers tweaking and maintaining the build system. In order to support tools that need to extract the server version, a new file that (only) contains the server version, called VERSION, is introduced. The file contents are human and machine-readable. The format is: MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 MYSQL_VERSION_PATCH=8 MYSQL_VERSION_EXTRA=-rc The CMake based version extraction in cmake/mysql_version.cmake is changed to extract the version from this file. The configure to CMake wrapper is retained for backwards compatibility and to support the BUILD/ scripts. Also, a new a makefile target show-dist-name that prints the server version is introduced. VERSION: Add top-level version file. cmake/mysql_version.cmake: Get version information from the top-level VERSION file. Do not cache the version components (MAJOR_VERSION, etc). Add MYSQL_RPM_VERSION as a replacement for MYSQL_U_SCORE_VERSION. --- dbug/Makefile.am | 68 -------------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 dbug/Makefile.am (limited to 'dbug') diff --git a/dbug/Makefile.am b/dbug/Makefile.am deleted file mode 100644 index 3581b3597ee..00000000000 --- a/dbug/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (C) 2000, 2002, 2004-2006 MySQL AB -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; version 2 -# of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA - -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a -pkglib_LIBRARIES = libdbug.a -noinst_HEADERS = dbug_long.h -libdbug_a_SOURCES = dbug.c -EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \ - user.r monty.doc dbug_add_tags.pl \ - my_main.c main.c factorial.c dbug_analyze.c \ - CMakeLists.txt tests.c tests-t.pl -NROFF_INC = example1.r example2.r example3.r main.r \ - factorial.r output1.r output2.r output3.r \ - output4.r output5.r -CLEANFILES = $(NROFF_INC) user.t user.ps tests-t - - -# Must be linked with libs that are not compiled yet -noinst_PROGRAMS = factorial dbug_analyze tests -factorial_SOURCES = my_main.c factorial.c -tests_SOURCES = tests.c -dbug_analyze_SOURCES = dbug_analyze.c - -all: user.t user.ps tests-t - -user.t: user.r $(NROFF_INC) - -nroff -mm user.r > $@ - -user.ps: user.r $(NROFF_INC) - -groff -mm user.r > $@ - -output1.r: factorial - ./factorial 1 2 3 4 5 | cat > $@ - -output2.r: factorial - ./factorial -\#t:o 2 3 | cat >$@ - -output3.r: factorial - ./factorial -\#d:t:o 3 | cat >$@ - -output4.r: factorial - ./factorial -\#d,result:o 4 | cat >$@ - -output5.r: factorial - ./factorial -\#d:f,factorial:F:L:o 3 | cat >$@ -.c.r: - @RM@ -f $@ - @SED@ -e 's!\\!\\\\!g' $< > $@ - -# a hack to have executable in builddir, not in srcdir -tests-t: tests-t.pl - cp -f $(srcdir)/tests-t.pl ./tests-t - -- cgit v1.2.1 From 0611bf22031283a6b459223eec199f0c0c7ae606 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 13 Dec 2010 12:19:30 +0100 Subject: Bug #58426 Crashing tests not failing as they are supposed to on Solaris 10 debug On this platform we seem to get lots of other signals while waiting for SIGKILL to be delivered. Solution: use sigsuspend() dbug/dbug.c: New function _db_suicide_() which does kill(myself, -9) and then waits forever. include/my_dbug.h: Let DBUG_SUICE wait forever until the KILL signal is delivered, and process dies. --- dbug/dbug.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'dbug') diff --git a/dbug/dbug.c b/dbug/dbug.c index fecdd4f8a6c..06a9f7b4bac 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -2276,6 +2276,25 @@ void _db_flush_() } +#ifndef __WIN__ +void _db_suicide_() +{ + int retval; + sigset_t new_mask; + sigfillset(&new_mask); + + fprintf(stderr, "SIGKILL myself\n"); + fflush(stderr); + + retval= kill(getpid(), SIGKILL); + assert(retval == 0); + retval= sigsuspend(&new_mask); + fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno); + assert(FALSE); /* With full signal mask, we should never return here. */ +} +#endif /* ! __WIN__ */ + + void _db_lock_file_() { CODE_STATE *cs=0; -- cgit v1.2.1 From fda629004112411c0bda78d1bb0ab9fe6d894a26 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 13 Dec 2010 17:13:01 +0100 Subject: Bug #58426 Crashing tests not failing as they are supposed to on Solaris 10 debug On this platform we seem to get lots of other signals while waiting for SIGKILL to be delivered. Solution: use sigsuspend() dbug/dbug.c: New function _db_suicide_() which does kill(myself, -9) and then waits forever. include/my_dbug.h: Let DBUG_SUICE wait forever until the KILL signal is delivered, and process dies. --- dbug/dbug.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'dbug') diff --git a/dbug/dbug.c b/dbug/dbug.c index fecdd4f8a6c..06a9f7b4bac 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -2276,6 +2276,25 @@ void _db_flush_() } +#ifndef __WIN__ +void _db_suicide_() +{ + int retval; + sigset_t new_mask; + sigfillset(&new_mask); + + fprintf(stderr, "SIGKILL myself\n"); + fflush(stderr); + + retval= kill(getpid(), SIGKILL); + assert(retval == 0); + retval= sigsuspend(&new_mask); + fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno); + assert(FALSE); /* With full signal mask, we should never return here. */ +} +#endif /* ! __WIN__ */ + + void _db_lock_file_() { CODE_STATE *cs=0; -- cgit v1.2.1 From 85323eda8a5823e4db1fa34dc998684b67e710b5 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 28 Dec 2010 19:57:23 +0100 Subject: - Added/updated copyright headers - Removed files specific to compiling on OS/2 - Removed files specific to SCO Unix packaging - Removed "libmysqld/copyright", text is included in documentation - Removed LaTeX headers for NDB Doxygen documentation - Removed obsolete NDB files - Removed "mkisofs" binaries - Removed the "cvs2cl.pl" script - Changed a few GPL texts to use "program" instead of "library" --- dbug/dbug_add_tags.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dbug') diff --git a/dbug/dbug_add_tags.pl b/dbug/dbug_add_tags.pl index 141a2ed85f1..df913e650cb 100755 --- a/dbug/dbug_add_tags.pl +++ b/dbug/dbug_add_tags.pl @@ -1,5 +1,20 @@ #!/usr/bin/perl +# Copyright (C) 2002 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + die "No files specified\n" unless $ARGV[0]; $ctags="exctags -x -f - --c-types=f -u"; -- cgit v1.2.1 From 8ede0759c30bb49025b466a69951d5f36d2b6b92 Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Tue, 11 Jan 2011 10:07:37 +0100 Subject: Remove configuration preprocessor symbols 'THREAD' and 'THREAD_SAFE_CLIENT'. As of MySQL 5.5, we no longer support non-threaded builds. This patch removes all references to the obsolete THREAD and THREAD_SAFE_CLIENT preprocessor symbols. These were used to distinguish between threaded and non-threaded builds. --- dbug/dbug.c | 231 +--------------------------------------------------- dbug/dbug_analyze.c | 4 +- dbug/my_main.c | 5 +- dbug/tests.c | 5 +- 4 files changed, 7 insertions(+), 238 deletions(-) (limited to 'dbug') diff --git a/dbug/dbug.c b/dbug/dbug.c index 74568f55fe0..2c06eeff95a 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -319,15 +319,6 @@ static void DbugExit(const char *why); static const char *DbugStrTok(const char *s); static void DbugVfprintf(FILE *stream, const char* format, va_list args); -#ifndef THREAD - /* Open profile output stream */ -static FILE *OpenProfile(CODE_STATE *cs, const char *name); - /* Profile if asked for it */ -static BOOLEAN DoProfile(CODE_STATE *); - /* Return current user time (ms) */ -static unsigned long Clock(void); -#endif - /* * Miscellaneous printf format strings. */ @@ -355,7 +346,6 @@ static unsigned long Clock(void); ** Macros to allow dbugging with threads */ -#ifdef THREAD #include static pthread_mutex_t THR_LOCK_dbug; @@ -394,30 +384,6 @@ static CODE_STATE *code_state(void) return cs; } -#else /* !THREAD */ - -static CODE_STATE static_code_state= -{ - "dbug", "?func", "?file", NULL, &init_settings, - NullS, NullS, 0,0,0,0,0,NullS -}; - -static CODE_STATE *code_state(void) -{ - if (!init_done) - { - bzero(&init_settings, sizeof(init_settings)); - init_settings.out_file=stderr; - init_settings.flags=OPEN_APPEND; - init_done=TRUE; - } - return &static_code_state; -} - -#define pthread_mutex_lock(A) {} -#define pthread_mutex_unlock(A) {} -#endif - /* * Translate some calls among different systems. */ @@ -601,15 +567,6 @@ int DbugParse(CODE_STATE *cs, const char *control) else stack->flags |= PID_ON; break; -#ifndef THREAD - case 'g': - if (OpenProfile(cs, PROF_FILE)) - { - stack->flags |= PROFILE_ON; - stack->p_functions= ListAdd(stack->p_functions, control, end); - } - break; -#endif case 'L': if (sign < 0) stack->flags &= ~LINE_ON; @@ -1154,23 +1111,7 @@ void _db_enter_(const char *_func_, const char *_file_, _stack_frame_->prev= cs->framep; _stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep); cs->framep= _stack_frame_; -#ifndef THREAD - if (DoProfile(cs)) - { - long stackused; - if (cs->framep->prev == NULL) - stackused= 0; - else - { - stackused= (char*)(cs->framep->prev) - (char*)(cs->framep); - stackused= stackused > 0 ? stackused : -stackused; - } - (void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func); - (void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused, - AUTOS_REVERSE ? _stack_frame_->func : cs->func); - (void) fflush(cs->stack->prof_file); - } -#endif + switch (DoTrace(cs)) { case ENABLE_TRACE: cs->framep->level|= TRACE_ON; @@ -1229,10 +1170,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func); DbugExit(buf); } -#ifndef THREAD - if (DoProfile(cs)) - (void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func); -#endif + if (DoTrace(cs) & DO_TRACE) { if (TRACING) @@ -1744,36 +1682,6 @@ static int DoTrace(CODE_STATE *cs) return DONT_TRACE; } - -/* - * FUNCTION - * - * DoProfile check to see if profiling is current enabled - * - * SYNOPSIS - * - * static BOOLEAN DoProfile() - * - * DESCRIPTION - * - * Checks to see if profiling is enabled based on whether the - * user has specified profiling, the maximum trace depth has - * not yet been reached, the current function is selected, - * and the current process is selected. Returns TRUE if - * profiling is enabled, FALSE otherwise. - * - */ - -#ifndef THREAD -static BOOLEAN DoProfile(CODE_STATE *cs) -{ - return PROFILING && - cs->level <= cs->stack->maxdepth && - InList(cs->stack->p_functions, cs->func) & (INCLUDE|MATCHED) && - InList(cs->stack->processes, cs->process) & (INCLUDE|MATCHED); -} -#endif - FILE *_db_fp_(void) { CODE_STATE *cs; @@ -1900,11 +1808,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_) cs->lineno++; if (cs->stack->flags & PID_ON) { -#ifdef THREAD (void) fprintf(cs->stack->out_file, "%-7s: ", my_thread_name()); -#else - (void) fprintf(cs->stack->out_file, "%5d: ", (int) getpid()); -#endif } if (cs->stack->flags & NUMBER_ON) (void) fprintf(cs->stack->out_file, "%5d: ", cs->lineno); @@ -2014,63 +1918,6 @@ static void DBUGOpenFile(CODE_STATE *cs, } } - -/* - * FUNCTION - * - * OpenProfile open new output stream for profiler output - * - * SYNOPSIS - * - * static FILE *OpenProfile(name) - * char *name; - * - * DESCRIPTION - * - * Given name of a new file, opens the file - * and sets the profiler output stream to the new file. - * - * It is currently unclear whether the prefered behavior is - * to truncate any existing file, or simply append to it. - * The latter behavior would be desirable for collecting - * accumulated runtime history over a number of separate - * runs. It might take some changes to the analyzer program - * though, and the notes that Binayak sent with the profiling - * diffs indicated that append was the normal mode, but this - * does not appear to agree with the actual code. I haven't - * investigated at this time [fnf; 24-Jul-87]. - */ - -#ifndef THREAD -static FILE *OpenProfile(CODE_STATE *cs, const char *name) -{ - REGISTER FILE *fp; - REGISTER BOOLEAN newfile; - - fp=0; - if (!Writable(name)) - { - (void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name); - perror(""); - (void) Delay(cs->stack->delay); - } - else - { - newfile= !EXISTS(name); - if (!(fp= fopen(name, "w"))) - { - (void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name); - perror(""); - } - else - { - cs->stack->prof_file= fp; - } - } - return fp; -} -#endif - /* * FUNCTION * @@ -2419,80 +2266,6 @@ const char* _db_get_func_(void) return cs->func; } -/* - * Here we need the definitions of the clock routine. Add your - * own for whatever system that you have. - */ - -#ifndef THREAD -#if defined(HAVE_GETRUSAGE) - -#include -#include - -/* extern int getrusage(int, struct rusage *); */ - -/* - * Returns the user time in milliseconds used by this process so - * far. - */ - -static unsigned long Clock() -{ - struct rusage ru; - - (void) getrusage(RUSAGE_SELF, &ru); - return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000; -} - -#elif defined(__WIN__) - -static ulong Clock() -{ - return clock()*(1000/CLOCKS_PER_SEC); -} -#elif defined(amiga) - -struct DateStamp { /* Yes, this is a hack, but doing it right */ - long ds_Days; /* is incredibly ugly without splitting this */ - long ds_Minute; /* off into a separate file */ - long ds_Tick; -}; - -static int first_clock= TRUE; -static struct DateStamp begin; -static struct DateStamp elapsed; - -static unsigned long Clock() -{ - register struct DateStamp *now; - register unsigned long millisec= 0; - extern VOID *AllocMem(); - - now= (struct DateStamp *) AllocMem((long) sizeof(struct DateStamp), 0L); - if (now != NULL) - { - if (first_clock == TRUE) - { - first_clock= FALSE; - (void) DateStamp(now); - begin= *now; - } - (void) DateStamp(now); - millisec= 24 * 3600 * (1000 / HZ) * (now->ds_Days - begin.ds_Days); - millisec += 60 * (1000 / HZ) * (now->ds_Minute - begin.ds_Minute); - millisec += (1000 / HZ) * (now->ds_Tick - begin.ds_Tick); - (void) FreeMem(now, (long) sizeof(struct DateStamp)); - } - return millisec; -} -#else -static unsigned long Clock() -{ - return 0; -} -#endif /* RUSAGE */ -#endif /* THREADS */ #else diff --git a/dbug/dbug_analyze.c b/dbug/dbug_analyze.c index 1ebe8bfd77e..3d5713758ae 100644 --- a/dbug/dbug_analyze.c +++ b/dbug/dbug_analyze.c @@ -571,12 +571,10 @@ int main (int argc, char **argv) FILE *infile; FILE *outfile = {stdout}; -#ifdef THREAD #if defined(HAVE_PTHREAD_INIT) pthread_init(); /* Must be called before DBUG_ENTER */ #endif - my_thread_global_init(); -#endif /* THREAD */ + my_thread_global_init(); { DBUG_ENTER ("main"); DBUG_PROCESS (argv[0]); diff --git a/dbug/my_main.c b/dbug/my_main.c index 31c15aa67aa..48d092ca10a 100644 --- a/dbug/my_main.c +++ b/dbug/my_main.c @@ -16,12 +16,11 @@ char *argv[]; { register int result, ix; extern int factorial(int); -#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) +#if defined(HAVE_PTHREAD_INIT) pthread_init(); /* Must be called before DBUG_ENTER */ #endif -#ifdef THREAD my_thread_global_init(); -#endif + { DBUG_ENTER ("main"); DBUG_PROCESS (argv[0]); diff --git a/dbug/tests.c b/dbug/tests.c index d76266d34a3..837a477aef3 100644 --- a/dbug/tests.c +++ b/dbug/tests.c @@ -44,12 +44,11 @@ int main (int argc, char *argv[]) if (argc == 1) return 0; -#if defined(HAVE_PTHREAD_INIT) && defined(THREAD) +#if defined(HAVE_PTHREAD_INIT) pthread_init(); /* Must be called before DBUG_ENTER */ #endif -#ifdef THREAD my_thread_global_init(); -#endif + dup2(1, 2); for (i = 1; i < argc; i++) { -- cgit v1.2.1