From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Refactor Perl test code
Date: Thu, 03 Dec 2015 16:57:33 -0500
Message-ID: <936.1449179853@sss.pgh.pa.us> (raw)
In-Reply-To: <20151203202808.GR2763@alvherre.pgsql>
References: <E1a4FMd-0004iR-Ow@gemulon.postgresql.org>
<20342.1449099495@sss.pgh.pa.us>
<CAB7nPqSFPhDJTM6B5uxDRK5vFmuK2vzwgG5ONXXkSs8HW3=Htg@mail.gmail.com>
<7609.1449112789@sss.pgh.pa.us>
<CAB7nPqTEgZM9jOfjp-wBLVWJW1f_qFGVrDZOyA3JHqiDH=ZYHw@mail.gmail.com>
<8790.1449114624@sss.pgh.pa.us>
<20151203202808.GR2763@alvherre.pgsql>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Tom Lane wrote:
>> Michael Paquier <michael.paquier@gmail.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Refactor Perl test code
In-Reply-To: <936.1449179853@sss.pgh.pa.us>
References: <E1a4FMd-0004iR-Ow@gemulon.postgresql.org> <20342.1449099495@sss.pgh.pa.us> <CAB7nPqSFPhDJTM6B5uxDRK5vFmuK2vzwgG5ONXXkSs8HW3=Htg@mail.gmail.com> <7609.1449112789@sss.pgh.pa.us> <CAB7nPqTEgZM9jOfjp-wBLVWJW1f_qFGVrDZOyA3JHqiDH=ZYHw@mail.gmail.com> <8790.1449114624@sss.pgh.pa.us> <20151203202808.GR2763@alvherre.pgsql> <936.1449179853@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox