Re: [HACKERS] Segmentation fault in libpq

From: Michal Novotný <michal(dot)novotny(at)greycortex(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Segmentation fault in libpq
Date: 2017-07-02 18:58:52
Message-ID: CACSGxCNfmqBXKoK6MqZvofsrcX0ZpTc-Cx+mCZWxhHL=RzZabw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hi all,
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.

Anyway, thank you all for valuable advice.
Have a great time,
Michal

2017-06-29 16:30 GMT+02:00 Merlin Moncure <mmoncure(at)gmail(dot)com>:

> On Thu, Jun 29, 2017 at 9:12 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> >> On Thu, Jun 29, 2017 at 8:23 AM, Michal Novotny
> >> <michal(dot)novotny(at)greycortex(dot)com> wrote:
> >>> Could you please help me based on information provided above?
> >
> >> You might want to run your code through some analysis tools (for
> >> example, valgrind).
> >
> > valgrind is not a perfect tool for finding that kind of problem,
> > especially if you can't reproduce the crash reliably; but at least
> > valgrind is readily available and easy to use, so you might as
> > well start there and see if it finds anything. If you have access
> > to any sort of static analysis tool (eg, Coverity), that might be
> > more likely to help. Or you could fall back on manual code
> > auditing, if the program isn't very big.
>
> clang static analyzer is another good tool to check out
>
> https://clang-analyzer.llvm.org/
>
> merlin
>

--
Michal Novotny
System Development Lead
michal(dot)novotny(at)greycortex(dot)com

*GREYCORTEX s.r.o.*
Purkynova 127, 61200 Brno
Czech Republic
www.greycortex.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2017-07-02 19:12:22 Re: [HACKERS] Segmentation fault in libpq
Previous Message rthomques 2017-07-02 18:47:08 BUG #14727: Inicial running of Postgres.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-07-02 19:12:22 Re: [HACKERS] Segmentation fault in libpq
Previous Message Tom Lane 2017-07-02 17:55:29 Re: Race-like failure in recovery/t/009_twophase.pl