Loading mysql-test/lib/My/CoreDump.pm +19 −19 Original line number Diff line number Diff line Loading @@ -29,33 +29,33 @@ sub _gdb { return unless -f $core_name; my $dir = tempdir( CLEANUP => 1 ); my ($tmp, $tmp_name) = tempfile( DIR => $dir ); # Find out name of binary that generated core `gdb -c '$core_name' --batch 2>&1` =~ /Core was generated by `([^\s\'\`]+)/; my $binary= $1 or return; print "Core generated by '$binary'\n"; # Create tempfile containing gdb commands my ($tmp, $tmp_name) = tempfile(); print $tmp "bt\n", "thread apply all bt\n", "quit\n"; close $tmp or die "Error closing $tmp_name: $!"; # Find out name of binary that generated core my $list= `gdb -c $core_name -x $tmp_name -batch 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 " - core generated by '$binary'\n"; # Run gdb my $gdb_output= `gdb '$binary' -c '$core_name' -x '$tmp_name' --batch 2>&1`; my $list= `gdb $binary -c $core_name -x $tmp_name -batch 2>&1` or return; unlink $tmp_name or die "Error removing $tmp_name: $!"; print $list, "\n"; return unless $gdb_output; print <<EOF, $gdb_output, "\n"; Output from gdb follows. The first stack trace is from the failing thread. The following stack traces are from all threads (so the failing one is duplicated). EOF return 1; } Loading Loading
mysql-test/lib/My/CoreDump.pm +19 −19 Original line number Diff line number Diff line Loading @@ -29,33 +29,33 @@ sub _gdb { return unless -f $core_name; my $dir = tempdir( CLEANUP => 1 ); my ($tmp, $tmp_name) = tempfile( DIR => $dir ); # Find out name of binary that generated core `gdb -c '$core_name' --batch 2>&1` =~ /Core was generated by `([^\s\'\`]+)/; my $binary= $1 or return; print "Core generated by '$binary'\n"; # Create tempfile containing gdb commands my ($tmp, $tmp_name) = tempfile(); print $tmp "bt\n", "thread apply all bt\n", "quit\n"; close $tmp or die "Error closing $tmp_name: $!"; # Find out name of binary that generated core my $list= `gdb -c $core_name -x $tmp_name -batch 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 " - core generated by '$binary'\n"; # Run gdb my $gdb_output= `gdb '$binary' -c '$core_name' -x '$tmp_name' --batch 2>&1`; my $list= `gdb $binary -c $core_name -x $tmp_name -batch 2>&1` or return; unlink $tmp_name or die "Error removing $tmp_name: $!"; print $list, "\n"; return unless $gdb_output; print <<EOF, $gdb_output, "\n"; Output from gdb follows. The first stack trace is from the failing thread. The following stack traces are from all threads (so the failing one is duplicated). EOF return 1; } Loading