Re: Recent SIGSEGV failures in buildfarm HEAD

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Recent SIGSEGV failures in buildfarm HEAD
Дата
Msg-id 45944CAF.5070401@dunslane.net
обсуждение исходный текст
Ответ на Re: Recent SIGSEGV failures in buildfarm HEAD  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Recent SIGSEGV failures in buildfarm HEAD  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera wrote:
> Tom Lane wrote:
>
>
>>
>> I wonder whether there's any way to get the buildfarm script to report a
>> stack trace automatically if it finds a core file left behind in the
>> $PGDATA directory after running the tests.  Would something like this
>> be adequately portable?
>>
>>     if [ -f $PGDATA/core* ]
>>     then
>>         echo bt | gdb $installdir/bin/postgres $PGDATA/core*
>>     fi
>>
>
> gdb has a "batch mode" which can be useful:
>
>      if [ -f $PGDATA/core* ]
>      then
>          gdb -ex "bt" --batch $installdir/bin/postgres $PGDATA/core*
>      fi
>
>

here's a quick untested patch for buildfarm that Stefan might like to try.

cheers

andrew

--- run_build.pl.orig    2006-12-28 17:32:14.000000000 -0500
+++ run_build.pl.new    2006-12-28 17:58:51.000000000 -0500
@@ -795,6 +795,29 @@
     $dbstarted=undef;
 }

+
+sub get_stack_trace
+{
+    my $bindir = shift;
+    my $pgdata = shift;
+
+    # no core = no result
+    return () unless -f "$pgdata/core";
+
+    # no gdb = no result
+    system "gdb --version > /dev/null 2>&1";
+    my $status = $? >>8;
+    return () if $status;
+
+    my @trace = `gdb -ex bt --batch $bindir/postgres $pgdata/core 2>&1`;
+
+    unshift(@trace,
+            "\n\n================== stack trace ==================\n");
+
+    return @trace;
+
+}
+
 sub make_install_check
 {
     my @checkout = `cd $pgsql/src/test/regress && $make installcheck 2>&1`;
@@ -814,6 +837,11 @@
         }
         close($handle);
     }
+    if ($status)
+    {
+        my @trace = get_stack_trace("$installdir/bin","$installdir/data");
+        push(@checkout,@trace);
+    }
     writelog('install-check',\@checkout);
     print "======== make installcheck log ===========\n",@checkout
         if ($verbose > 1);
@@ -839,6 +867,11 @@
         }
         close($handle);
     }
+    if ($status)
+    {
+        my @trace = get_stack_trace("$installdir/bin","$installdir/data");
+        push(@checkout,@trace);
+    }
     writelog('contrib-install-check',\@checkout);
     print "======== make contrib installcheck log ===========\n",@checkout
         if ($verbose > 1);
@@ -864,6 +897,11 @@
         }
         close($handle);
     }
+    if ($status)
+    {
+        my @trace = get_stack_trace("$installdir/bin","$installdir/data");
+        push(@checkout,@trace);
+    }
     writelog('pl-install-check',\@checkout);
     print "======== make pl installcheck log ===========\n",@checkout
         if ($verbose > 1);
@@ -892,6 +930,13 @@
         }
         close($handle);
     }
+    if ($status)
+    {
+        my @trace =
+            get_stack_trace("$pgsql/src/test/regress/install$installdir/bin",
+                            "$pgsql/src/test/regress/tmp_check/data");
+        push(@makeout,@trace);
+    }
     writelog('check',\@makeout);
     print "======== make check logs ===========\n",@makeout
         if ($verbose > 1);

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: TODO: GNU TLS
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: TODO: GNU TLS