pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: me@jandrabek.cz
To: pgsql-bugs@postgresql.org
Subject: BUG #12146: Crash when using UNION ALL
Date: Thu, 04 Dec 2014 16:03:38 +0000
Message-ID: <20141204160338.2565.93893@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      12146
Logged by:          Jan Drabek
Email address:      me@jandrabek.cz
PostgreSQL version: 9.3.5
Operating system:   OS X 10.10 (via Macports)
Description:        

Since 9.3.5 my PostgreSQL crashes when certain pattern in queries appears.
(Version 9.3.4 is not affected.)

After cutting all dependencies and columns from table foo it is only having
one column with BIGINT type.

The query is:
SELECT *
FROM (
       SELECT id
       FROM (
              SELECT id FROM foo
              UNION ALL
              SELECT id FROM foo

            ) t
       UNION ALL

       SELECT id FROM foo
     ) AS eop
  JOIN foo p ON p.id = eop.id

After execution of this query I get this in PostgreSQL log:
LOG:  server process (PID 11935) was terminated by signal 11: Segmentation
fault

However it is reproducible only on my machine (dumping database is of no
good).

Interesting observations:
 - After executing ANALYZE foo; problems disappear (corrupted statistics?)
 - Using UNION instead of UNION ALL makes it work.
 - Duplicating database on my machine (via pgadmin dump and load) doesn't
change this behaviour (i.e. it still crashes even on the newly loaded
database).

However I wasn't able to reproduce problem on different machine.
Any ideas what to do next in order to find the cause? (I tried to use
DEBUG5, but there were nothing interesting in the log).

Thanks
jan Drábek


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)  latest in thread

Message-ID: <20141204160338.2565.93893@wrigleys.postgresql.org>
Permalink:  ../20141204160338.2565.93893@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20141204160338.2565.93893@wrigleys.postgresql.org

 · 

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 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: me@jandrabek.cz
  Subject: Re: BUG #12146: Crash when using UNION ALL
  In-Reply-To: <20141204160338.2565.93893@wrigleys.postgresql.org>
  References: <20141204160338.2565.93893@wrigleys.postgresql.org>

* 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