Skip to content

Commit

Permalink
fix(annotate): print with newline
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed May 12, 2024
1 parent 47cd3dd commit fed0362
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions annotate.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@
if ($line =~ /runtime error:/) {
$line =~ /(?<file>[^:]+):(?<line>[0-9]+):(?<col>[0-9]+): runtime error: (?<msg>.+)/;
my $file = abs2rel(abs_path($+{file}), $ENV{GITHUB_WORKSPACE});
print "::notice file=$file,line=$+{line},col=$+{col},title=Sanitizer::$+{msg}";
print "::notice file=$file,line=$+{line},col=$+{col},title=Sanitizer::$+{msg}\n";
} elsif ($line =~ /SUMMARY: AddressSanitizer: [^0-9]/) {
$line =~ /AddressSanitizer: (?<id>[A-Za-z-]+) (?<file>[^:]+):(?<line>[0-9]+):(?<col>[0-9]+) (?<msg>.+)/;
my $msg = join(' ', split('-', $+{id}), $+{msg});
my $file = abs2rel(abs_path($+{file}), $ENV{GITHUB_WORKSPACE});
print "::error file=$file,line=$+{line},col=$+{col},title=Sanitizer::$msg";
print "::error file=$file,line=$+{line},col=$+{col},title=Sanitizer::$msg\n";
} elsif ($line =~ /ERROR: LeakSanitizer:/) {
readline STDIN; readline STDIN;
my $line = readline STDIN;
my $line = readline(STDIN) if $line =~ /in __interceptor/;
$line =~ /#1 0x[a-f0-9]+ (?<msg>in [A-Za-z0-9_]+) (?<file>[^:]+):(?<line>[0-9]+):(?<col>[0-9]+)/;
my $file = abs2rel(abs_path($+{file}), $ENV{GITHUB_WORKSPACE});
print "::error file=$file,line=$+{line},col=$+{col},title=Sanitizer::detected memory leak $+{msg}";
print "::error file=$file,line=$+{line},col=$+{col},title=Sanitizer::detected memory leak $+{msg}\n";
} elsif (/ERROR: libFuzzer: out-of-memory/) {
readline STDIN; readline STDIN; readline STDIN;
while ($line =~ /in (__|fuzzer)/) {
my $line = readline STDIN;
}
if ($line =~ /^Live Heap Allocations/) {
print '::error file=src/scanner.c,title=Sanitizer::out of memory (potential infinite loop)';
print '::error file=src/scanner.c,title=Sanitizer::out of memory (potential infinite loop)\n';
} else {
$line =~ /#[0-9]+ 0x[a-f0-9]+ (?<msg>in [A-Za-z0-9_]+) (?<file>[^:]+):(?<line>[0-9]+):(?<col>[0-9]+)/;
my $file = abs2rel(abs_path($+{file}), $ENV{GITHUB_WORKSPACE});
print "::error file=$file,line=$+{line},col=$+{col},title=Sanitizer::out of memory $+{msg}";
print "::error file=$file,line=$+{line},col=$+{col},title=Sanitizer::out of memory $+{msg}\n";
}
}
}

0 comments on commit fed0362

Please sign in to comment.