Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4bu5-0008PJ-HW for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Dec 2015 21:59:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4bu5-00087C-45 for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Dec 2015 21:59:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4bsk-0005be-6i for pgsql-hackers@postgresql.org; Thu, 03 Dec 2015 21:57:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4bsh-00086S-Rg for pgsql-hackers@postgresql.org; Thu, 03 Dec 2015 21:57:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tB3LvX9b000937; Thu, 3 Dec 2015 16:57:33 -0500 From: Tom Lane To: Alvaro Herrera cc: Michael Paquier , PostgreSQL mailing lists Subject: Re: [COMMITTERS] pgsql: Refactor Perl test code In-reply-to: <20151203202808.GR2763@alvherre.pgsql> References: <20342.1449099495@sss.pgh.pa.us> <7609.1449112789@sss.pgh.pa.us> <8790.1449114624@sss.pgh.pa.us> <20151203202808.GR2763@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 03 Dec 2015 17:28:08 -0300" Date: Thu, 03 Dec 2015 16:57:33 -0500 Message-ID: <936.1449179853@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera writes: > Tom Lane wrote: >> Michael Paquier writes: >>> Well, it showed up on my terminal... >> Not on mine, as per the extract I showed. Probably a Perl version >> difference, but I don't think we can exactly write off RHEL6 as an >> uninteresting obsolete distribution. (The Perl here is 5.10.1.) > Hmm, maybe a selinux policy or something like that is preventing some > system call from working, Good thought, but overcomplicated. After some quality time with strace, I find that the Undefined subroutine &TestLib::run called at /home/postgres/pgsql/src/bin/initdb /../../../src/test/perl/TestLib.pm line 146. error message does indeed appear, but it's printed only into src/bin/initdb/tmp_check/log/regress_log_001_initdb It appears that the reason this happens is that the child perl process (of the two that are active in this area of the trace) decides at one point along the line to redirect its own stdout and stderr into that file, disconnecting them from the pipes leading to the parent process. So when that process prints "Undefined subroutine" to its stderr, that is where it goes. I suppose that the redirection is a result of this bit in TestLib.pm: # Hijack STDOUT and STDERR to the log file open(ORIG_STDOUT, ">&STDOUT"); open(ORIG_STDERR, ">&STDERR"); open(STDOUT, ">&TESTLOG"); open(STDERR, ">&TESTLOG"); so the question from my end is not so much why it doesn't work for me as how it could possibly work for you. Could the newer Perl version be detecting the undefined-subroutine error before it executes the file's INIT stanza, rather than after? Or maybe the "tie" stuff happening just below this acts differently in more modern Perls? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers