Re: Segmentation fault with core dump - Mailing list pgsql-general

From Inoue, Hiroshi
Subject Re: Segmentation fault with core dump
Date
Msg-id 51B7EA41.3040706@tpf.co.jp
Whole thread Raw
In response to Re: Segmentation fault with core dump  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
(2013/06/12 0:03), Tom Lane wrote:
> Hiroshi Inoue <inoue@tpf.co.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);



pgsql-general by date:

Previous
From: Sergey Konoplev
Date:
Subject: Re: Really poor gist index performance with tstzrange types
Next
From: Andrew Tipton
Date:
Subject: Determining the type (array, object, or scalar) of a JSON value