b=647469 continue after crashes in addr2line r=dbaron

--HG--
extra : transplant_source : %3B%3D%1AX%09%D6N%5D%A2%3D%1F%23%2C%408%F7P%B46S
This commit is contained in:
Karl Tomlinson 2011-05-02 08:33:16 +12:00
parent 8b87c69da8
commit eb1243ff38
2 changed files with 7 additions and 2 deletions

0
config/preprocessor.pl Normal file → Executable file
View File

View File

@ -243,6 +243,9 @@ sub addr2line_pipe($) {
return $pipe;
}
# Ignore SIGPIPE as a workaround for addr2line crashes in some situations.
$SIG{PIPE} = 'IGNORE';
select STDOUT; $| = 1; # make STDOUT unbuffered
while (<>) {
my $line = $_;
@ -262,8 +265,10 @@ while (<>) {
printf {$out} "0x%X\n", $address;
chomp(my $symbol = <$in>);
chomp(my $fileandline = <$in>);
if ($symbol eq '??') { $symbol = $badsymbol; }
if ($fileandline eq '??:0') { $fileandline = $file; }
if (!$symbol || $symbol eq '??') { $symbol = $badsymbol; }
if (!$fileandline || $fileandline eq '??:0') {
$fileandline = $file;
}
print "$before$symbol ($fileandline)$after\n";
} else {
print STDERR "Warning: File \"$file\" does not exist.\n";