pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Michal Novotný <michal.novotny@greycortex.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Segmentation fault in libpq
Date: Sun, 2 Jul 2017 12:12:22 -0700
Message-ID: <20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de> (raw)
In-Reply-To: <CACSGxCNfmqBXKoK6MqZvofsrcX0ZpTc-Cx+mCZWxhHL=RzZabw@mail.gmail.com>
References: <b58db7a6-a80a-8db2-9ef2-5ae0fd3ca545@greycortex.com>
	<CAHyXU0zPsUz5qWDPpzYZ3LYOgDRdiB45RJ91pi32NvcN9xPEWQ@mail.gmail.com>
	<2a0f743f-4d96-30b1-8b5d-86541e8bcb34@greycortex.com>
	<CAHyXU0x29T3QWFDwUT6jvVhdp6dhoJC2B20XR52AR=54Em=Vpw@mail.gmail.com>
	<14445.1498745576@sss.pgh.pa.us>
	<CAHyXU0yjj49MzD5Sei3g4ihL_gzVDxFhJt2Qs9NfgYkaJEw4hA@mail.gmail.com>
	<CACSGxCNfmqBXKoK6MqZvofsrcX0ZpTc-Cx+mCZWxhHL=RzZabw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hi,

On 2017-07-02 20:58:52 +0200, Michal Novotný wrote:
> thank you all for your advice. I've been investigating this a little more
> and finally it turned out it's not a bug in libpq although I got confused
> by going deep as several libpq functions. The bug was really on our side
> after trying to use connection pointer after calling PQfinish(). The code
> is pretty complex so it took some time to investigate however I would like
> to apologize for "blaming" libpq instead of our code.

Usually using a tool like valgrind is quite helpful to find issues like
that, because it'll show you the call-stack accessing the memory and
*also* the call-stack that lead to the memory being freed.

- Andres


-- 
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 (11+ messages)  latest in thread

Message-ID: <20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de>
Permalink:  ../20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de

 · 

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: andres@anarazel.de, michal.novotny@greycortex.com, mmoncure@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Segmentation fault in libpq
  In-Reply-To: <20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de>
  References: <b58db7a6-a80a-8db2-9ef2-5ae0fd3ca545@greycortex.com> <CAHyXU0zPsUz5qWDPpzYZ3LYOgDRdiB45RJ91pi32NvcN9xPEWQ@mail.gmail.com> <2a0f743f-4d96-30b1-8b5d-86541e8bcb34@greycortex.com> <CAHyXU0x29T3QWFDwUT6jvVhdp6dhoJC2B20XR52AR=54Em=Vpw@mail.gmail.com> <14445.1498745576@sss.pgh.pa.us> <CAHyXU0yjj49MzD5Sei3g4ihL_gzVDxFhJt2Qs9NfgYkaJEw4hA@mail.gmail.com> <CACSGxCNfmqBXKoK6MqZvofsrcX0ZpTc-Cx+mCZWxhHL=RzZabw@mail.gmail.com> <20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de>

* 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