From: Sergey KOPOSOV <Sergey.Koposov@ed.ac.uk>
To: tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG
Date: Thu, 1 Apr 2021 13:05:44 +0000
Message-ID: <51cec7215378e9beccb9b58831f6e0a2be30bd06.camel@ed.ac.uk> (raw)
In-Reply-To: <d8930bce790cbe14f5efed8d5d42f296a1fe54fe.camel@ed.ac.uk>
References: <16951-a4dd68cf0de23048@postgresql.org>
<3331060.1617226031@sss.pgh.pa.us>
<5d848bddbb3b6421af5a742e36ede542e719c492.camel@ed.ac.uk>
<3338139.1617230824@sss.pgh.pa.us>
<d8930bce790cbe14f5efed8d5d42f296a1fe54fe.camel@ed.ac.uk>
On Wed, 2021-03-31 at 23:52 +0100, Sergey Koposov wrote:
> On Wed, 2021-03-31 at 18:47 -0400, Tom Lane wrote:
> > This email was sent to you by someone outside the University.
> > You should only click on links or attachments if you are certain that the email is genuine and the content is safe.
> >
> > Sergey KOPOSOV <Sergey.Koposov@ed.ac.uk> writes:
> > > I also noticed when I tried to run pg_restore in the debugger the crash doesn't happen.
> > > but it does if I pipe it...
> >
> > I wonder if your platform is helpfully inserting Windows newlines,
> > or perhaps removing them, when the data goes through a pipe.
>
> The platform doing the pg_dump (PG12) is debian
> And the one doing pg_restore (PG10) is ubuntu.
>
> Also I know for sure when I use pg_restore from postgresql 12 it works fine in the same configuration.
> (And I've regularly transferred tables this way from one system to another, it's just I've recently
> migrated the debian system from PG11 to PG12 which lead to this segfault.)
I've just verified that on a different machine ubuntu 18.04 I can crash pg_restore with the file that I've sent to the list.
Importantly This requires running pg_restore without '-Fc' flag, i.e. to let it autodetect.
$ cat /tmp/xx1.short | ./src/bin/pg_dump/pg_restore
Segmentation fault (core dumped)
$ cat /tmp/xx1.short | ./src/bin/pg_dump/pg_restore -Fc
pg_restore: [archiver] unsupported version (1.14) in file header
S
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
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-bugs@postgresql.org
Cc: Sergey.Koposov@ed.ac.uk, tgl@sss.pgh.pa.us
Subject: Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG
In-Reply-To: <51cec7215378e9beccb9b58831f6e0a2be30bd06.camel@ed.ac.uk>
References: <16951-a4dd68cf0de23048@postgresql.org> <3331060.1617226031@sss.pgh.pa.us> <5d848bddbb3b6421af5a742e36ede542e719c492.camel@ed.ac.uk> <3338139.1617230824@sss.pgh.pa.us> <d8930bce790cbe14f5efed8d5d42f296a1fe54fe.camel@ed.ac.uk> <51cec7215378e9beccb9b58831f6e0a2be30bd06.camel@ed.ac.uk>
* 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