SEGFAULT on SELECT * FROM view

From: "chris r(dot)" <chricki(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: SEGFAULT on SELECT * FROM view
Date: 2011-12-29 22:42:42
Message-ID: 4EFCECE2.6050707@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

When SELECTing from one particular view, I get reproducible SEGFAULTs in
my pg 9.1.2 production database. To test for hardware errors, I ran
memtest, which succeeded. I then asked for help in #postgres and got
advice to create stacktraces, but I couldn't find the problem yet.

Scenario: VIEW 'vwa' on TABLE 'tba' and some subselects and aggregates.
I've no idea what's wrong with this view, but a

SELECT * FROM vwa WHERE myid = 1000010 LIMIT 100 OFFSET 0;

and even EXPLAINing this statement SEGFAULTs the server.

gdb trace: http://pgsql.privatepaste.com/eacd1b6c5d
gdb "ec" output: http://pgsql.privatepaste.com/a61db5b564
smaps: http://pgsql.privatepaste.com/3c4f494015

Then I used the definition of vwa, and created vwb, and the very same
SELECT (just with vwb) works perfectly fine. I've a pastebin link
comparing the two view definitions, which I'm willing to share privately
if that helps. The views actually differ, although the look identical
with \d+ in the psql console, in that the newer view names more columns
that were added to the referenced tables lately.

So, you tell me, what's wrong with the old view?

Thanks a lot,
Chris

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-12-29 22:46:54 Re: SEGFAULT on SELECT * FROM view
Previous Message Tom Lane 2011-12-29 22:26:16 Re: spinlocks on HP-UX