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
258c8847
Commit
258c8847
authored
Sep 06, 2008
by
Magnus Svensson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#38817 please make mtr analyze crashes better
parent
7ef8929b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
6 deletions
+88
-6
mysql-test/Makefile.am
mysql-test/Makefile.am
+1
-0
mysql-test/lib/My/CoreDump.pm
mysql-test/lib/My/CoreDump.pm
+79
-0
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+8
-6
No files found.
mysql-test/Makefile.am
View file @
258c8847
...
...
@@ -43,6 +43,7 @@ nobase_test_DATA = lib/mtr_cases.pm \
lib/My/SafeProcess.pm
\
lib/My/File/Path.pm
\
lib/My/SysInfo.pm
\
lib/My/CoreDump.pm
\
lib/My/SafeProcess/Base.pm
\
lib/My/SafeProcess/safe_process.pl
...
...
mysql-test/lib/My/CoreDump.pm
0 → 100644
View file @
258c8847
# -*- cperl -*-
# Copyright (C) 2004-2006 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
package
My::
CoreDump
;
use
strict
;
use
Carp
;
use
My::
Platform
;
use
File::
Temp
qw/ tempfile tempdir /
;
sub
_gdb
{
my
(
$core_name
)
=
@_
;
return
unless
-
f
$core_name
;
my
$dir
=
tempdir
(
CLEANUP
=>
1
);
my
(
$tmp
,
$tmp_name
)
=
tempfile
(
DIR
=>
$dir
);
print
$tmp
"
thread apply all bt
\n
",
"
quit
\n
";
# Find out name of binary that generated core
my
$list
=
`
gdb -c
$core_name
-x
$tmp_name
-q 2>&1
`
or
return
;
my
$binary
;
foreach
my
$line
(
split
('
\
n
',
$list
))
{
$binary
=
$1
if
(
$line
=~
/Core was generated by `(\S+)/
);
}
return
unless
$binary
;
print
"
Generated by '
$binary
'
\n
";
my
$list
=
`
gdb
$binary
-c
$core_name
-x
$tmp_name
-q 2>&1
`
or
return
;
print
$list
,
"
\n
";
return
1
;
}
sub
show
{
my
(
$class
,
$core_name
)
=
@_
;
my
@debuggers
=
(
\&
_gdb
,
# TODO...
);
foreach
my
$debugger
(
@debuggers
){
if
(
$debugger
->
(
$core_name
)){
return
;
}
}
return
;
}
1
;
mysql-test/mysql-test-run.pl
View file @
258c8847
...
...
@@ -50,6 +50,7 @@ use My::ConfigFactory;
use
My::
Options
;
use
My::
Find
;
use
My::
SysInfo
;
use
My::
CoreDump
;
use
mtr_cases
;
use
mtr_report
;
use
mtr_match
;
...
...
@@ -446,15 +447,16 @@ sub run_test_server ($$$) {
my
$core_name
=
basename
(
$core_file
);
if
(
$core_name
=~
"
core*
"){
if
(
$num_saved_cores
>=
$opt_max_save_core
)
{
mtr_report
("
- deleting '
$core_name
'
",
mtr_report
("
- found '
$core_name
'
",
"
(
$num_saved_cores
/
$opt_max_save_core
)
");
My::
CoreDump
->
show
(
$core_file
);
if
(
$num_saved_cores
>=
$opt_max_save_core
)
{
mtr_report
("
- deleting it, already saved
",
"
$opt_max_save_core
");
unlink
("
$core_file
");
}
else
{
mtr_report
("
- found '
$core_name
'
",
"
(
$num_saved_cores
/
$opt_max_save_core
)
");
}
++
$num_saved_cores
;
}
}
...
...
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