Re: Segmentation fault with core dump

From: "Inoue, Hiroshi" <inoue(at)tpf(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joshua Berry <yoberi(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL - General <pgsql-general(at)postgresql(dot)org>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Subject: Re: Segmentation fault with core dump
Date: 2013-06-12 03:25:53
Message-ID: 51B7EA41.3040706@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

(2013/06/12 0:03), Tom Lane wrote:
> Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp> writes:
>> It's also better to fix the crash at backend side.
>
> Yeah, definitely. Do we have a self-contained test case for this?

Unfortunately no. I'm testing with a modified psqlodbc driver.
The simplest way may be as follows.

1. Implement an API function like PQexecPortal(portal name, count)
which sends only an execute message.

2. Call the APIs as follows.

// Connect to a database.
conn = PQxxxx(....);

//
// Not begin a transaction for simplicity.
//
// The following operation defines a holdable portal whose
// portal name = cursor_name.
PQexec(conn, "declare cursor_name cursor with hold for select ....");

// At this point the holdable cursor becomes a held portal whose
// resowner is reset to NULL. The following function call would
// crash the backend.
PQexecPortal(conn, cursor_name, 1);

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Tipton 2013-06-12 14:02:57 Determining the type (array, object, or scalar) of a JSON value
Previous Message Sergey Konoplev 2013-06-12 02:13:59 Re: Really poor gist index performance with tstzrange types