diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2016-04-14 14:30:27 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-04-14 18:58:18 +0100 |
commit | 349e2a5a49eb4ebb0d5e542bf07a4aaf7a3aa1b6 (patch) | |
tree | 5b9464cfd93d9fe4762bf093881a3bb18ec586f7 /scripts | |
parent | 1f7da1f5a223776f67663a79b282f2f4344829c1 (diff) |
Add SEGV and trace hunter, and update log parser a little.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/logparse.pl | 9 | ||||
-rwxr-xr-x | scripts/segv-catch.pl | 22 |
2 files changed, 29 insertions, 2 deletions
diff --git a/scripts/logparse.pl b/scripts/logparse.pl index 72676ac85..75444effa 100755 --- a/scripts/logparse.pl +++ b/scripts/logparse.pl @@ -98,7 +98,12 @@ while (my $line = shift @input) { } } - if ($line =~/Initializing wsd/) { + # systemd[1]: loolwsd.service: main process exited, code=killed, status=11/SEGV + if ($line =~m/loolwsd.service: main process exited.*status=(.*)$/) { + print "loolwsd exit: $1\n"; + } + + if ($line =~m/Initializing wsd/) { print "Re-started\n"; clear_state(\%sessions, \%lok_starting, \%lok_running); } @@ -109,7 +114,7 @@ while (my $line = shift @input) { # [loolkit ] loolkit [1689] is ready. # [loolbroker ] Child 1536 terminated. # [loolbroker ] Child process [1689] exited with code: 0. - if ($line =~ m/loolbroker.*Spawned kit \[(\d+)\]./) { + if ($line =~ m/loolbroker.*Forked kit \[(\d+)\]./) { my $pid = $1; $lok_starting{$pid} = 1; $pevent = "newkit\t\"$pid\""; diff --git a/scripts/segv-catch.pl b/scripts/segv-catch.pl new file mode 100755 index 000000000..dc8bd8e37 --- /dev/null +++ b/scripts/segv-catch.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl -w + +use strict; + +while (<STDIN>) { + my $line = $_; + $line =~ s/\r*\n*//g; + + $line =~ m/Fatal signal received: (.*)$/ || next; + my $signal = $1; + + # 2016-04-12T20:06:49.626770+00:00 ip-172-31-34-231 loolwsd[5918]: kit-02721 Fatal signal received: SIGSEGV + + $line =~ m/(\d+-\d+-\d+)T(\d+:\d+:\d+\.)\S+\s+\S+\s+(\S+)\s+(.*)$/ || die "bad line: '$line'"; + my ($day, $time, $process, $msg) = ($1, $2, $3, $4); + + print "$day $time $process $signal\n"; +} +# 2016-04-12T20:06:49.627111+00:00 ip-172-31-34-231 loolwsd[5918]: Backtrace: +# 2016-04-12T20:06:49.627455+00:00 ip-172-31-34-231 loolwsd[5918]: /usr/bin/loolforkit() [0x43e86d] +# 2016-04-12T20:06:49.627795+00:00 ip-172-31-34-231 loolwsd[5918]: /lib64/libpthread.so.0(+0xf890) [0x7f9389f97890] + |