pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Wed, 31 Mar 2021 21:45:08 +0000
Message-ID: <5d848bddbb3b6421af5a742e36ede542e719c492.camel@ed.ac.uk> (raw)
In-Reply-To: <3331060.1617226031@sss.pgh.pa.us>
References: <16951-a4dd68cf0de23048@postgresql.org>
	<3331060.1617226031@sss.pgh.pa.us>


On Wed, 2021-03-31 at 17:27 -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.
>
> PG Bug reporting form <noreply@postgresql.org> writes:
> > I have a reproducible case of segfaulting pg_restore when trying to restore
> > from pg_dump of a different version. Specifically at least pg_restore from
> > 10 crashes from pg_dump 12.
>
> When I try that I get
>
> pg_restore: [archiver] unsupported version (1.14) in file header
>
> and that test is done first thing in ReadHead(), before the place
> you identify.  I suspect you are dealing with a corrupt archive
> file, not a version mismatch.


I am pretty sure that is not the case.

I've just done that now
skoposov_remote@wsdb:~/postgresql-10.16$ ssh -o Compression=no koposov@HOSTNAME '/opt/pgsql/bin/pg_dump -n SCHEMA -Fc  -U dbadmin wsdb'  | head -c 32768 >
xx.short
(obviously the crash doesn't happen even if I don't put 'head -n ...')

skoposov_remote@wsdb:~/postgresql-10.16$ cat xx.short | pg_restore -U dbadmin -h localhost -d wsdb
Segmentation fault (core dumped)

I attach the file (1 kb of it)

I also noticed when I tried to run pg_restore in the debugger the crash doesn't happen.

gdb --args pg_restore -U dbadmin -h localhost -d wsdb
(gdb) run < /tmp/xx.short
Starting program: /usr0/home/skoposov_remote/postgresql-10.16/src/bin/pg_dump/pg_restore < /tmp/xx.short
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
pg_restore: [archiver] unsupported version (1.14) in file header
[Inferior 1 (process 14109) exited with code 01]

but it does if I pipe it...

      Sergey

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.


Attachments:

  xx1.short (model/x.stl-binary, 1000B) download

view thread (9+ messages)  latest in thread

Message-ID: <5d848bddbb3b6421af5a742e36ede542e719c492.camel@ed.ac.uk>
Permalink:  ../5d848bddbb3b6421af5a742e36ede542e719c492.camel@ed.ac.uk/
Also on:    postgresql.org/message-id/5d848bddbb3b6421af5a742e36ede542e719c492.camel@ed.ac.uk

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: Sergey.Koposov@ed.ac.uk, tgl@sss.pgh.pa.us, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16951: pg_restore segfaults on custom format piped from a different version of PG
  In-Reply-To: <5d848bddbb3b6421af5a742e36ede542e719c492.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