#At file:///home/bm136801/my/upmerge-tr/ based on revid:bjorn.munch@stripped
2899 Bjorn Munch 2009-11-12 [merge]
merge 43418
modified:
mysql-test/include/mtr_warnings.sql
mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/include/mtr_warnings.sql'
--- a/mysql-test/include/mtr_warnings.sql 2009-10-22 07:28:39 +0000
+++ b/mysql-test/include/mtr_warnings.sql 2009-11-12 10:14:56 +0000
@@ -186,6 +186,14 @@ INSERT INTO global_suppressions VALUES
(": The MySQL server is running with the --secure-backup-file-priv option so it cannot execute this statement"),
("Slave: Unknown table 't1' Error_code: 1051"),
+ /* Messages from valgrind */
+ ("==[0-9]*== Memcheck,"),
+ ("==[0-9]*== Copyright"),
+ ("==[0-9]*== Using"),
+ ("==[0-9]*== For more details"),
+ /* This comes with innodb plugin tests */
+ ("==[0-9]*== Warning: set address range perms: large range .* .defined."),
+
("THE_LAST_SUPPRESSION")||
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2009-11-04 13:57:16 +0000
+++ b/mysql-test/mysql-test-run.pl 2009-11-12 10:14:56 +0000
@@ -226,6 +226,7 @@ my @default_valgrind_args= ("--show-reac
my @valgrind_args;
my $opt_valgrind_path;
my $opt_callgrind;
+my %mysqld_logs;
my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
our $opt_warnings= 1;
@@ -741,6 +742,9 @@ sub run_worker ($) {
elsif ($line eq 'BYE'){
mtr_report("Server said BYE");
stop_all_servers($opt_shutdown_timeout);
+ if ($opt_valgrind_mysqld) {
+ valgrind_exit_reports();
+ }
exit(0);
}
else {
@@ -1340,8 +1344,7 @@ sub command_line_setup {
push(@valgrind_args, @default_valgrind_args)
unless @valgrind_args;
- # Make valgrind run in quiet mode so it only print errors
- push(@valgrind_args, "--quiet" );
+ # Don't add --quiet; you will loose the summary reports.
mtr_report("Running valgrind with options \"",
join(" ", @valgrind_args), "\"");
@@ -3698,7 +3701,7 @@ sub extract_warning_lines ($$) {
(
qr/^Warning:|mysqld: Warning|\[Warning\]/,
qr/^Error:|\[ERROR\]/,
- qr/^==\d*==/, # valgrind errors
+ qr/^==\d+==\s+\S/, # valgrind errors
qr/InnoDB: Warning|InnoDB: Error/,
qr/^safe_mutex:|allocated at line/,
qr/missing DBUG_RETURN/,
@@ -4304,6 +4307,8 @@ sub mysqld_start ($$) {
# see the exact location where valgrind complains
$output= "$opt_vardir/log/".$mysqld->name().".trace";
}
+ # Remember this log file for valgrind error report search
+ $mysqld_logs{$output}= 1 if $opt_valgrind;
if ( defined $exe )
{
@@ -5156,6 +5161,66 @@ sub valgrind_arguments {
}
}
+#
+# Search server logs for valgrind reports printed at mysqld termination
+#
+
+sub valgrind_exit_reports() {
+ foreach my $log_file (keys %mysqld_logs)
+ {
+ my @culprits= ();
+ my $valgrind_rep= "";
+ my $found_report= 0;
+ my $err_in_report= 0;
+
+ my $LOGF = IO::File->new($log_file)
+ or mtr_error("Could not open file '$log_file' for reading: $!");
+
+ while ( my $line = <$LOGF> )
+ {
+ if ($line =~ /^CURRENT_TEST: (.+)$/)
+ {
+ my $testname= $1;
+ # If we have a report, report it if needed and start new list of tests
+ if ($found_report)
+ {
+ if ($err_in_report)
+ {
+ mtr_print ("Valgrind report from $log_file after tests:\n",
+ @culprits);
+ mtr_print_line();
+ print ("$valgrind_rep\n");
+ $err_in_report= 0;
+ }
+ # Make ready to collect new report
+ @culprits= ();
+ $found_report= 0;
+ $valgrind_rep= "";
+ }
+ push (@culprits, $testname);
+ next;
+ }
+ # This line marks the start of a valgrind report
+ $found_report= 1 if $line =~ /ERROR SUMMARY:/;
+
+ if ($found_report) {
+ $line=~ s/^==\d+== //;
+ $valgrind_rep .= $line;
+ $err_in_report= 1 if $line =~ /ERROR SUMMARY: [1-9]/;
+ $err_in_report= 1 if $line =~ /definitely lost: [1-9]/;
+ $err_in_report= 1 if $line =~ /possibly lost: [1-9]/;
+ }
+ }
+
+ $LOGF= undef;
+
+ if ($err_in_report) {
+ mtr_print ("Valgrind report from $log_file after tests:\n", @culprits);
+ mtr_print_line();
+ print ("$valgrind_rep\n");
+ }
+ }
+}
#
# Usage
Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20091112101456-2piurunq3z0x2u5r.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk-mtr branch (Bjorn.Munch:2899) | Bjorn Munch | 12 Nov |