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
df8befc0
Commit
df8befc0
authored
Feb 20, 2012
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
038b739c
e7fef1df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
mysys/stacktrace.c
mysys/stacktrace.c
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+0
-1
sql/signal_handler.cc
sql/signal_handler.cc
+14
-8
No files found.
mysys/stacktrace.c
View file @
df8befc0
...
@@ -173,7 +173,7 @@ void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)),
...
@@ -173,7 +173,7 @@ void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)),
my_safe_printf_stderr
(
"%s"
,
my_safe_printf_stderr
(
"%s"
,
"Error when traversing the stack, stack appears corrupt.
\n
"
);
"Error when traversing the stack, stack appears corrupt.
\n
"
);
else
else
my_safe_printf_stderr
(
"%s"
my_safe_printf_stderr
(
"%s"
,
"Please read "
"Please read "
"http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html
\n
"
"http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html
\n
"
"and follow instructions on how to resolve the stack trace.
\n
"
"and follow instructions on how to resolve the stack trace.
\n
"
...
...
sql/mysqld.cc
View file @
df8befc0
...
@@ -761,7 +761,6 @@ char *opt_logname, *opt_slow_logname;
...
@@ -761,7 +761,6 @@ char *opt_logname, *opt_slow_logname;
static
volatile
sig_atomic_t
kill_in_progress
;
static
volatile
sig_atomic_t
kill_in_progress
;
#ifdef HAVE_STACKTRACE
#ifdef HAVE_STACKTRACE
static
my_bool
opt_do_pstack
;
my_bool
opt_stack_trace
;
my_bool
opt_stack_trace
;
#endif
/* HAVE_STACKTRACE */
#endif
/* HAVE_STACKTRACE */
my_bool
opt_expect_abort
=
0
;
my_bool
opt_expect_abort
=
0
;
...
...
sql/signal_handler.cc
View file @
df8befc0
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#endif
#endif
/*
/*
We are handling signals in this file.
We are handling signals
/exceptions
in this file.
Any global variables we read should be 'volatile sig_atomic_t'
Any global variables we read should be 'volatile sig_atomic_t'
to guarantee that we read some consistent value.
to guarantee that we read some consistent value.
*/
*/
...
@@ -40,20 +40,18 @@ extern volatile sig_atomic_t ld_assume_kernel_is_set;
...
@@ -40,20 +40,18 @@ extern volatile sig_atomic_t ld_assume_kernel_is_set;
#endif
#endif
/**
/**
* Handler for fatal signals
* Handler for fatal signals
on POSIX, exception handler on Windows.
*
*
* Fatal events (seg.fault, bus error etc.) will trigger
* Fatal events (seg.fault, bus error etc.) will trigger
* this signal handler. The handler will try to dump relevant
* this signal handler. The handler will try to dump relevant
* debugging information to stderr and dump a core image.
* debugging information to stderr and dump a core image.
*
*
*
Signal handlers can only use a set of 'safe' system calls
*
POSIX : Signal handlers should, if possible, only use a set of 'safe' system
* and library functions. A list of safe calls in POSIX systems
*
calls
and library functions. A list of safe calls in POSIX systems
* are available at:
* are available at:
* http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html
* http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html
* For MS Windows, guidelines are available at:
* http://msdn.microsoft.com/en-us/library/xdkz3x12(v=vs.71).aspx
*
*
* @param sig Signal number
* @param sig Signal number
/Exception code
*/
*/
extern
"C"
sig_handler
handle_fatal_signal
(
int
sig
)
extern
"C"
sig_handler
handle_fatal_signal
(
int
sig
)
{
{
...
@@ -77,7 +75,13 @@ extern "C" sig_handler handle_fatal_signal(int sig)
...
@@ -77,7 +75,13 @@ extern "C" sig_handler handle_fatal_signal(int sig)
my_safe_printf_stderr
(
"%02d%02d%02d %2d:%02d:%02d "
,
my_safe_printf_stderr
(
"%02d%02d%02d %2d:%02d:%02d "
,
tm
.
tm_year
%
100
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_year
%
100
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
if
(
opt_expect_abort
&&
sig
==
SIGABRT
)
if
(
opt_expect_abort
#ifdef _WIN32
&&
sig
==
EXCEPTION_BREAKPOINT
/* __debugbreak in my_sigabrt_hander() */
#else
&&
sig
==
SIGABRT
#endif
)
{
{
fprintf
(
stderr
,
"[Note] mysqld did an expected abort
\n
"
);
fprintf
(
stderr
,
"[Note] mysqld did an expected abort
\n
"
);
goto
end
;
goto
end
;
...
@@ -252,5 +256,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
...
@@ -252,5 +256,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
On Windows, do not terminate, but pass control to exception filter.
On Windows, do not terminate, but pass control to exception filter.
*/
*/
_exit
(
1
);
// Using _exit(), since exit() is not async signal safe
_exit
(
1
);
// Using _exit(), since exit() is not async signal safe
#else
return
;
#endif
#endif
}
}
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