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
abd31b57
Commit
abd31b57
authored
Dec 19, 2000
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for backtracing, still will not push, just a local commit
parent
eccd463b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
sql/mysqld.cc
sql/mysqld.cc
+24
-7
No files found.
sql/mysqld.cc
View file @
abd31b57
...
@@ -159,6 +159,7 @@ static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl,
...
@@ -159,6 +159,7 @@ static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl,
opt_ansi_mode
=
0
,
opt_myisam_log
=
0
,
opt_large_files
=
sizeof
(
my_off_t
)
>
4
;
opt_ansi_mode
=
0
,
opt_myisam_log
=
0
,
opt_large_files
=
sizeof
(
my_off_t
)
>
4
;
bool
opt_sql_bin_update
=
0
,
opt_log_slave_updates
=
0
;
bool
opt_sql_bin_update
=
0
,
opt_log_slave_updates
=
0
;
FILE
*
bootstrap_file
=
0
;
FILE
*
bootstrap_file
=
0
;
int
segfaulted
=
0
;
// ensure we do not enter SIGSEGV handler twice
extern
MASTER_INFO
glob_mi
;
extern
MASTER_INFO
glob_mi
;
extern
int
init_master_info
(
MASTER_INFO
*
mi
);
extern
int
init_master_info
(
MASTER_INFO
*
mi
);
...
@@ -1039,6 +1040,7 @@ static void init_signals(void)
...
@@ -1039,6 +1040,7 @@ static void init_signals(void)
#ifdef HAVE_LINUXTHREADS
#ifdef HAVE_LINUXTHREADS
static
sig_handler
write_core
(
int
sig
);
static
sig_handler
write_core
(
int
sig
);
#ifdef __i386__
#define SIGRETURN_FRAME_COUNT 1
#define SIGRETURN_FRAME_COUNT 1
inline
static
void
trace_stack
()
inline
static
void
trace_stack
()
{
{
...
@@ -1046,23 +1048,30 @@ inline static void trace_stack()
...
@@ -1046,23 +1048,30 @@ inline static void trace_stack()
uchar
**
ebp
;
uchar
**
ebp
;
LINT_INIT
(
ebp
);
LINT_INIT
(
ebp
);
fprintf
(
stderr
,
"Attemping backtrace, please send the info below to\
fprintf
(
stderr
,
"Attemping backtrace, please send the info below to\
bugs@lists.mysql.com. If you see no messages after this, something is
\
bugs@lists.mysql.com. If you see no messages after this, something
\
went terribly wrong - report this anyway
\n
"
);
went terribly wrong - report this anyway
\n
"
);
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
uint
frame_count
=
0
;
uint
frame_count
=
0
;
__asm
__volatile__
(
"movl %%ebp,%0"
__asm
__volatile__
(
"movl %%ebp,%0"
:
"=r"
(
ebp
)
:
"=r"
(
ebp
)
:
"r"
(
ebp
));
:
"r"
(
ebp
));
if
(
!
ebp
)
{
fprintf
(
stderr
,
"Stack is a mess, frame pointer (ebp) is NULL,\
aborting backtrace
\n
"
);
return
;
}
if
(
!
thd
)
if
(
!
thd
)
{
{
fprintf
(
stderr
,
"Cannot determin
g thread while backtraing, ebp=%p
"
,
fprintf
(
stderr
,
"Cannot determin
e thread, ebp=%p, aborting backtrace
\n
"
,
ebp
);
ebp
);
return
;
return
;
}
}
stack_bottom
=
(
uchar
**
)
thd
->
thread_stack
;
stack_bottom
=
(
uchar
**
)
thd
->
thread_stack
;
if
(
ebp
>
stack_bottom
)
if
(
ebp
>
stack_bottom
||
ebp
<
stack_bottom
-
thread_stack
)
{
{
fprintf
(
stderr
,
"Bogus stack limit, will not backtrace"
);
fprintf
(
stderr
,
"Bogus stack limit or frame pointer, aborting backtrace
\n
"
);
return
;
return
;
}
}
...
@@ -1073,10 +1082,10 @@ went terribly wrong - report this anyway\n");
...
@@ -1073,10 +1082,10 @@ went terribly wrong - report this anyway\n");
uchar
**
new_ebp
=
(
uchar
**
)
*
ebp
;
uchar
**
new_ebp
=
(
uchar
**
)
*
ebp
;
fprintf
(
stderr
,
"%p
\n
"
,
frame_count
==
SIGRETURN_FRAME_COUNT
?
fprintf
(
stderr
,
"%p
\n
"
,
frame_count
==
SIGRETURN_FRAME_COUNT
?
*
(
ebp
+
17
)
:
*
(
ebp
+
1
));
*
(
ebp
+
17
)
:
*
(
ebp
+
1
));
if
(
new_ebp
<=
ebp
)
if
(
new_ebp
<=
ebp
)
{
{
fprintf
(
stderr
,
"New value of ebp failed sanity check\
fprintf
(
stderr
,
"New value of ebp failed sanity check\
terminating backtrace"
);
terminating backtrace
\n
"
);
return
;
return
;
}
}
ebp
=
new_ebp
;
ebp
=
new_ebp
;
...
@@ -1086,9 +1095,17 @@ terminating backtrace");
...
@@ -1086,9 +1095,17 @@ terminating backtrace");
fprintf
(
stderr
,
"stack trace successful
\n
"
);
fprintf
(
stderr
,
"stack trace successful
\n
"
);
}
}
#endif
#endif
#endif
static
sig_handler
handle_segfault
(
int
sig
)
static
sig_handler
handle_segfault
(
int
sig
)
{
{
// strictly speaking, one needs a mutex here
// but since we have got SIGSEGV already, things are a mess
// so not having the mutex is not as bad as possibly using a buggy
// mutex - so we keep things simple
if
(
segfaulted
)
return
;
segfaulted
=
1
;
fprintf
(
stderr
,
"\
fprintf
(
stderr
,
"\
mysqld got signal %s in thread %d;
\n
\
mysqld got signal %s in thread %d;
\n
\
The manual section 'Debugging a MySQL server' tells you how to use a
\n
\
The manual section 'Debugging a MySQL server' tells you how to use a
\n
\
...
...
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