Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRzNp-0001Kh-9n for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2017 11:19:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dRzNo-0006ld-Qi for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2017 11:19:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dRvra-0005p1-Ld for pgsql-hackers@postgresql.org; Mon, 03 Jul 2017 07:33:42 +0000 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dRvrT-00071t-4E for pgsql-hackers@postgresql.org; Mon, 03 Jul 2017 07:33:41 +0000 Received: by mail-wr0-x230.google.com with SMTP id k67so228935837wrc.2 for ; Mon, 03 Jul 2017 00:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greycortex-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=25ge683uC9qgW0xnF9+Cb22oQvVUj9ft8TaZTOhonlw=; b=l4lpSgX+ybOjiyFE52IbDGVH/fbLMkCVnFeE1l+Z/ULCRbuMVmrc1yj+msaVNVIYLq GJiKn5qcIfW0+7j6MjJFyBCz+p3d4Zl769AWVnfJpReXw6hXt/W7yzjO5tdU9HVl/bXt KShUNwj8QlrwKAJJwjMH/qxbLEo0Va7V02wzbm6qIHCcqybywmNGzxEiXcW7D4ENtE9m 7t5puqDb9S5e+hNyMjqFzycjkoykdw6OJB7XUxZ2eN1AoU3ijaoJEj8j8hIx7k+7IDjv hSUipUB8uyM2F48Jsbc8hK5WtYUqrM2OPw+PQPMo9Ml5W1Zyna9OcZJEwC11WyBa/Ala 4YMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=25ge683uC9qgW0xnF9+Cb22oQvVUj9ft8TaZTOhonlw=; b=ScpPMM/wbMpxJplAQYIl1dR9AFx5K7JHmDR7o1V7OQxkXO+eSvTPmLNuVJHoiVEMID RlZlPGfUgaTcQkq4JffCvH9ksBGb6wOoosludysBLZgqmOcUhLkhq+ecbPXwdI/7lz2J 6b99oKpg2QXaGEw/nCMom3lylx0FsTSBU7br+fG96d4ZejPOjw6Tvle+8+LDieXTQAX0 iEeTwQPMl+zd8QtXdPX4jGbrBT8lYNnM0+1WqyiuPVZ0TCNgjOOdGUQQ3vX79qp5qhFj 5/vJHujmInFRYYkFp9Lm9KPEQXD3iOQ48oAJU3bBhGFl17i5DgkC4h6rPG1vT+qoH9Zs dYPw== X-Gm-Message-State: AKS2vOwE0NKpUZdRHfX1vWCzhKVUrd7kWpXBCw4N5murENrQT9BbHmAI wpRphhOAhSk8RcSHgjAi6g== X-Received: by 10.223.163.12 with SMTP id c12mr30932935wrb.85.1499067213380; Mon, 03 Jul 2017 00:33:33 -0700 (PDT) Received: from [172.16.9.180] ([195.113.243.75]) by smtp.gmail.com with ESMTPSA id i22sm13040167wrb.30.2017.07.03.00.33.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 00:33:32 -0700 (PDT) Subject: Re: [BUGS] Segmentation fault in libpq To: Andres Freund Cc: Merlin Moncure , Tom Lane , pgsql-bugs , PostgreSQL-development References: <2a0f743f-4d96-30b1-8b5d-86541e8bcb34@greycortex.com> <14445.1498745576@sss.pgh.pa.us> <20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de> From: Michal Novotny Message-ID: Date: Mon, 3 Jul 2017 09:33:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170702191222.uk4hokc2iumzeenh@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 07/02/2017 09:12 PM, Andres Freund wrote: > 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 Well, I've tried but I was unable to locate the issue so I had to investigate the code our little further and finally I've been able to find the issue. Thanks again, Michal -- Michal Novotny System Development Lead michal.novotny@greycortex.com GREYCORTEX s.r.o. Purkynova 127, 61200 Brno Czech Republic www.greycortex.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers