CREATE FUNCTION hang on test machine polecat on HEAD - Mailing list pgsql-hackers

From Robert Creager
Subject CREATE FUNCTION hang on test machine polecat on HEAD
Date
Msg-id E7579E89-73EC-48D0-A13D-29F8AB5E64BA@Oracle.com
Whole thread Raw
List pgsql-hackers

This is the second time I've had this happen in the last week or so.  I have a 'regular' postgresql server running, and then test test setup (both llvm ang gcc).  It's chewing up 1 core on my MBP, never completing.

  502   229     1   0   0:00.50 ??         0:00.60 /Library/PostgreSQL/8.3/bin/postgres -D /Library/PostgreSQL/8.3/data
  502   266   229   0   0:08.32 ??         0:11.86 postgres: logger process                                                                                                                                                                                                                                                                                               
  502   268   229   0   0:24.49 ??         0:55.88 postgres: writer process                                                                                                                                                                                                                                                                                               
  502   269   229   0   0:23.02 ??         0:36.82 postgres: wal writer process                                                                                                                                                                                                                                                                                           
  502   270   229   0   0:06.40 ??         0:09.12 postgres: autovacuum launcher process                                                                                                                                                                                                                                                                                  
  502   271   229   0   0:06.87 ??         0:07.78 postgres: stats collector process                                                                                                                                                                                                                                                                                      
  501 24638     1   0   0:06.74 ??         0:07.63 /Volumes/High Usage/usr/local/src/build-farm-4.4/builds/HEAD/inst/bin/postgres -D data-C
  501 24640 24638   0   0:18.91 ??         0:43.89 postgres: writer process     
  501 24641 24638   0   0:17.83 ??         0:27.99 postgres: wal writer process     
  501 24642 24638   0   0:09.80 ??         0:21.99 postgres: autovacuum launcher process     
  501 24643 24638   0   0:48.59 ??         0:59.91 postgres: stats collector process     
  501 24698 24638   0 2116:52.81 ??       2456:38.81 postgres: Robert pl_regression [local] CREATE FUNCTION  

Robert@dhcp-brm-bl5-204-2e-east-10-135-77-175:/Volumes/High Usage/usr/local/src/build-farm-4.4/builds/HEAD
% ls -altr
total 24
drwxr-xr-x   9 Robert  staff   306B Dec 10 22:31 ../
-rw-r--r--   1 Robert  staff    11B May 31 13:05 polecat.last.success.snap
-rw-r--r--   1 Robert  staff     0B Jun  1 09:18 builder.LCK
-rw-r--r--   1 Robert  staff    11B Jun  1 09:19 polecat.last.status
-rw-r--r--   1 Robert  staff    11B Jun  1 09:19 polecat.last.run.snap
drwxr-xr-x  16 Robert  staff   544B Jun  1 09:19 pgsql/
drwxr-xr-x  18 Robert  staff   612B Jun  1 09:20 pgsql.2569/
drwxr-xr-x  10 Robert  staff   340B Jun  1 09:27 ./
drwxr-xr-x  10 Robert  staff   340B Jun  1 09:28 inst/
drwxr-xr-x  16 Robert  staff   544B Jun  1 09:28 polecat.lastrun-logs/

Robert@dhcp-brm-bl5-204-2e-east-10-135-77-175:/Volumes/High Usage/usr/local/src/build-farm-4.4/builds/HEAD/polecat.lastrun-logs
% ls -altr
total 8760
-rw-r--r--   1 Robert  staff    40B Jun  1 09:19 githead.log
-rw-r--r--   1 Robert  staff   918B Jun  1 09:19 SCM-checkout.log
-rw-r--r--   1 Robert  staff    16K Jun  1 09:20 configure.log
-rw-r--r--   1 Robert  staff   324K Jun  1 09:20 config.log
-rw-r--r--   1 Robert  staff   257K Jun  1 09:25 make.log
-rw-r--r--   1 Robert  staff   1.8M Jun  1 09:26 check.log
-rw-r--r--   1 Robert  staff    50K Jun  1 09:27 make-contrib.log
drwxr-xr-x  10 Robert  staff   340B Jun  1 09:27 ../
-rw-r--r--   1 Robert  staff    40K Jun  1 09:27 make-install.log
-rw-r--r--   1 Robert  staff    26K Jun  1 09:27 install-contrib.log
-rw-r--r--   1 Robert  staff   1.3K Jun  1 09:27 initdb-C.log
-rw-r--r--   1 Robert  staff   534B Jun  1 09:27 startdb-C-1.log
-rw-r--r--   1 Robert  staff   1.7M Jun  1 09:27 install-check-C.log
-rw-r--r--   1 Robert  staff   299B Jun  1 09:28 stopdb-C-1.log
-rw-r--r--   1 Robert  staff   534B Jun  1 09:28 startdb-C-2.log

cat startdb-C-2.log
waiting for server to start.... done
server started
=========== db log file ==========
[4de65a8c.603f:1] LOG:  database system was shut down at 2011-06-01 09:28:01 MDT
[4de65a8c.6042:1] LOG:  autovacuum launcher started
[4de65a8c.603e:1] LOG:  database system is ready to accept connections
[4de65a8d.6044:1] LOG:  connection received: host=[local]
[4de65a8d.6044:2] LOG:  connection authorized: user=Robert database=postgres
[4de65a8d.6044:3] LOG:  disconnection: session time: 0:00:00.009 user=Robert database=postgres host=[local]

Robert@dhcp-brm-bl5-204-2e-east-10-135-77-175:/Volumes/High Usage/usr/local/src/build-farm-4.4/builds/HEAD/inst
% tail -n 100 !$
tail -n 100 logfile
while (@arrays > 0) {
my $el = shift @arrays;
if (is_array_ref($el)) {
push @arrays, @$el;
} else {
$result .= $el;
}
}
return $result.' '.$array_arg;
$$ LANGUAGE plperl;
[4de65a8f.6076:16] LOG:  statement: select plperl_concat('{"NULL","NULL","NULL''"}');
[4de65a8f.6076:17] LOG:  statement: select plperl_concat('{{NULL,NULL,NULL}}');
[4de65a8f.6076:18] LOG:  statement: select plperl_concat('{"hello"," ","world!"}');
[4de65a8f.6076:19] LOG:  statement: CREATE TYPE foo AS (bar INTEGER, baz TEXT);
[4de65a8f.6076:20] LOG:  statement: CREATE OR REPLACE FUNCTION plperl_array_of_rows(foo[]) RETURNS TEXT AS $$
my $array_arg = shift;
my $result = "";
for my $row_ref (@$array_arg) {
die "not a hash reference" unless (ref $row_ref eq "HASH");
$result .= $row_ref->{bar}." items of ".$row_ref->{baz}.";";
}
return $result .' '. $array_arg;
$$ LANGUAGE plperl;
[4de65a8f.6076:21] LOG:  statement: select plperl_array_of_rows(ARRAY[ ROW(2, 'coffee'), ROW(0, 'sugar')]::foo[]);
[4de65a8f.6076:22] LOG:  statement: CREATE TYPE rowfoo AS (bar INTEGER, baz INTEGER[]);
[4de65a8f.6076:23] LOG:  statement: CREATE OR REPLACE FUNCTION plperl_sum_row_elements(rowfoo) RETURNS TEXT AS $$
my $row_ref = shift;
my $result;
if (ref $row_ref ne 'HASH') {
$result = 0;
}
else {
$result = $row_ref->{bar};
die "not an array reference".ref ($row_ref->{baz}) 
unless (is_array_ref($row_ref->{baz}));
# process a single-dimensional array
foreach my $elem (@{$row_ref->{baz}}) {
$result += $elem unless ref $elem;
}
}
return $result;
$$ LANGUAGE plperl;
[4de65a8f.6076:24] LOG:  statement: select plperl_sum_row_elements(ROW(1, ARRAY[2,3,4,5,6,7,8,9,10])::rowfoo);
[4de65a8f.6076:25] LOG:  statement: CREATE TYPE rowbar AS (foo rowfoo[]);
[4de65a8f.6076:26] LOG:  statement: CREATE OR REPLACE FUNCTION plperl_sum_array_of_rows(rowbar) RETURNS TEXT AS $$
my $rowfoo_ref = shift;
my $result = 0;
if (ref $rowfoo_ref eq 'HASH') {
my $row_array_ref = $rowfoo_ref->{foo};
if (is_array_ref($row_array_ref)) {
foreach my $row_ref (@{$row_array_ref}) {
if (ref $row_ref eq 'HASH') {
$result += $row_ref->{bar};
die "not an array reference".ref ($row_ref->{baz}) 
unless (is_array_ref($row_ref->{baz}));
foreach my $elem (@{$row_ref->{baz}}) {
$result += $elem unless ref $elem;
}
}
else {
die "element baz is not a reference to a rowfoo";
}
}
} else {
die "not a reference to an array of rowfoo elements"
}
} else {
die "not a reference to type rowbar";
}
return $result;
$$ LANGUAGE plperl;
[4de65a8f.6076:27] LOG:  statement: select plperl_sum_array_of_rows(ROW(ARRAY[ROW(1, ARRAY[2,3,4,5,6,7,8,9,10])::rowfoo, 
ROW(11, ARRAY[12,13,14,15,16,17,18,19,20])::rowfoo])::rowbar);
[4de65a8f.6076:28] LOG:  statement: CREATE OR REPLACE FUNCTION plperl_arrays_out(OUT INTEGER[]) AS $$
return [[1,2,3],[4,5,6]];
$$ LANGUAGE plperl;
[4de65a8f.6076:29] LOG:  statement: select plperl_arrays_out();
[4de65a8f.6076:30] LOG:  statement: CREATE OR REPLACE FUNCTION plperl_arrays_inout(INTEGER[]) returns INTEGER[] AS $$
return shift;
$$ LANGUAGE plperl;
[4de65a8f.6076:31] LOG:  statement: select plperl_arrays_inout('{{1}, {2}, {3}}');
[4de65a8f.6076:32] LOG:  statement: create or replace function perl_setof_array(integer[]) returns setof integer[] language plperl as $$
my $arr = shift;
for my $r (@$arr) {
return_next $r;
}
return undef;
$$;
[4de65a8f.6076:33] LOG:  statement: select perl_setof_array('{{1}, {2}, {3}}');
[4de65a8f.6076:34] LOG:  disconnection: session time: 0:00:00.076 user=Robert database=pl_regression host=[local]
[4de65a8f.607a:1] LOG:  connection received: host=[local]
[4de65a8f.607a:2] LOG:  connection authorized: user=Robert database=pl_regression
[4de65a8f.607a:3] LOG:  statement: CREATE OR REPLACE FUNCTION bar() RETURNS integer AS $$
   #die 'BANG!'; # causes server process to exit(2)
   # alternative - causes server process to exit(255)
   spi_exec_query("invalid sql statement");
$$ language plperl;

I'll leave it running tonight (going home), so I can poke tomorrow if anyone wants me to.

Later,
Rob

-- 


Robert Creager, Principal Software Engineer

Oracle Server Technologies
500 Eldorado Blvd, Bldg 5
Broomfield, CO, 80021
Phone: 303-272-6830 
Email: Robert.Creager@Oracle.com


Oracle is committed to developing practices and products that help protect the environment

Attachment

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: WALInsertLock tuning
Next
From: Robert Creager
Date:
Subject: Re: [Pgbuildfarm-members] CREATE FUNCTION hang on test machine polecat on HEAD