Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQYiZ-0004yh-ER for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2017 12:38:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dQYiY-0002Gy-Vm for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2017 12:38:43 +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 1dQVKH-0005FU-0U for pgsql-hackers@postgresql.org; Thu, 29 Jun 2017 09:01:25 +0000 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dQVKD-0003Ud-9c for pgsql-hackers@postgresql.org; Thu, 29 Jun 2017 09:01:23 +0000 Received: by mail-wr0-x22e.google.com with SMTP id c11so186084546wrc.3 for ; Thu, 29 Jun 2017 02:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greycortex-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=3eTKy1jHWSCPAZ+ev415bmqXvMbpTAimMqRnxOXCVbc=; b=lNheycueGenarQJe+J9lDl2jVVcqkGHpwUnDcn1MicYWVEABOdG28nxJChpaqWfeU4 FmvxTzp4sxYu055PitGRn0baOQ4+vvxtP3wO7wlupNd2iQfhrpDJHbDOgC0ifA0Qhov0 Z7uK6akFnP3eLCdXF3dz0iauCUVA9sTjy5cqlejjfAGtIp+CjvblWWNxl8YLxVSwj0Uo ggxVQSZqSDAsr8+mfzmouX2fk2A5OEOi4fTzM19NgAA7G+2BgoLkGaltXP0oIXrgLpwp PQiCJ88tPG3sjOwxNAB7gkzvONPMnt25SBL62zTQiIhx25eTwujkSxipI7/WFtCuZy8F dNrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=3eTKy1jHWSCPAZ+ev415bmqXvMbpTAimMqRnxOXCVbc=; b=pDJsZEPeA8KEjk7yvqdkKOp0S/qWErVtG2RAchDa31YljCYTNmEjuwyphitaFsvnvT 6gYE9BD7zoBwwSG92+u1cOfK0MllAk/IhUGyFGZg5Ue2u+lROZ9MjH1LQTx91RVQPe2e /i0vfVMpQOeO0b/WTPukoaVCCGp0pRVzjAoKjkbDkYz4Djx4JYQyhhhV1LeaCwigj+Jz 0xMekCxaoN/htM9zZqC+6TkVEuGl6InD7Av5xhNdFVOLh/ZsVTqT6yZByciVrKDgtyUB bSZ55hp5ZOMcvTgdmcDSegTHsfQXu0KpYwlMLboLZPy0rvZ08ApOMd1wdEuaNnO1EgFq 0WLg== X-Gm-Message-State: AKS2vOy3VBQx+s0qvyQNq5chQB2LLoa3K7s0ndJGPHzU8I0fVhUweurW PFkh9NYxF0KI7YxHp1XvOg== X-Received: by 10.223.172.67 with SMTP id v61mr24467970wrc.112.1498726878578; Thu, 29 Jun 2017 02:01:18 -0700 (PDT) Received: from [172.16.9.180] ([195.113.243.75]) by smtp.gmail.com with ESMTPSA id r187sm9306877wmg.15.2017.06.29.02.01.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 02:01:18 -0700 (PDT) To: pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org From: Michal Novotny Subject: Segmentation fault in libpq Message-ID: Date: Thu, 29 Jun 2017 11:01:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------994DC38FFDCDFF03ABE3C612" 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 This is a multi-part message in MIME format. --------------994DC38FFDCDFF03ABE3C612 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi all, we've developed an application using libpq to access a table in the PgSQL database but we're sometimes experiencing segmentation fault on resetPQExpBuffer() function of libpq called from PQexecParams() with prepared query. PostgreSQL version is 9.6.3 and the backtrace is: Core was generated by `/usr/ti/bin/status-monitor2 -m /usr/lib64/status-monitor2/modules'. Program terminated with signal 11, Segmentation fault. #0 resetPQExpBuffer (str=str@entry=0x9f4a28) at pqexpbuffer.c:152 152 str->data[0] = '\0'; Thread 1 (Thread 0x7fdf68de3840 (LWP 3525)): #0 resetPQExpBuffer (str=str@entry=0x9f4a28) at pqexpbuffer.c:152 No locals. #1 0x00007fdf66e0333d in PQsendQueryStart (conn=conn@entry=0x9f46d0) at fe-exec.c:1371 No locals. #2 0x00007fdf66e044b9 in PQsendQueryParams (conn=conn@entry=0x9f46d0, command=command@entry=0x409a98"SELECT min, hour, day, month, dow, sensor, module, params, priority, rt_due FROM sm.cron WHERE sensor = $1 ORDER BY priority DESC", nParams=nParams@entry=1, paramTypes=paramTypes@entry=0x0, paramValues=paramValues@entry=0xa2b7b0, paramLengths=paramLengths@entry=0x0, paramFormats=paramFormats@entry=0x0, resultFormat=resultFormat@entry=0) at fe-exec.c:1192 No locals. #3 0x00007fdf66e0552b in PQexecParams (conn=0x9f46d0, command=0x409a98"SELECT min, hour, day, month, dow, sensor, module, params, priority, rt_due FROM sm.cron WHERE sensor = $1 ORDER BY priority DESC", nParams=1, paramTypes=0x0, paramValues=0xa2b7b0, paramLengths=0x0, paramFormats=0x0, resultFormat=0) at fe-exec.c:1871 No locals. Unfortunately we didn't have more information from the crash, at least for now. Is this a known issue and can you help me with this one? Thanks, Michal -- Michal Novotny System Development Lead michal.novotny@greycortex.com GREYCORTEX s.r.o. Purkynova 127, 61200 Brno Czech Republic www.greycortex.com --------------994DC38FFDCDFF03ABE3C612 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hi all,

we've developed an application using libpq to access a table in the PgSQL database but we're sometimes experiencing segmentation fault on resetPQExpBuffer() function of libpq called from PQexecParams() with prepared query.

PostgreSQL version is 9.6.3 and the backtrace is:

Core was generated by `/usr/ti/bin/status-monitor2 -m /usr/lib64/status-monitor2/modules'.
Program terminated with signal 11, Segmentation fault.
#0  resetPQExpBuffer (str=str@entry=0x9f4a28) at pqexpbuffer.c:152
152				str->data[0] = '\0';

Thread 1 (Thread 0x7fdf68de3840 (LWP 3525)):
#0  resetPQExpBuffer (str=str@entry=0x9f4a28) at pqexpbuffer.c:152
No locals.
#1  0x00007fdf66e0333d in PQsendQueryStart (conn=conn@entry=0x9f46d0) at fe-exec.c:1371
No locals.
#2  0x00007fdf66e044b9 in PQsendQueryParams (conn=conn@entry=0x9f46d0, command=command@entry=0x409a98 "SELECT min, hour, day, month, dow, sensor, module, params, priority, rt_due FROM sm.cron WHERE sensor = $1 ORDER BY priority DESC", nParams=nParams@entry=1, paramTypes=paramTypes@entry=0x0, paramValues=paramValues@entry=0xa2b7b0, paramLengths=paramLengths@entry=0x0, paramFormats=paramFormats@entry=0x0, resultFormat=resultFormat@entry=0) at fe-exec.c:1192
No locals.
#3  0x00007fdf66e0552b in PQexecParams (conn=0x9f46d0, command=0x409a98 "SELECT min, hour, day, month, dow, sensor, module, params, priority, rt_due FROM sm.cron WHERE sensor = $1 ORDER BY priority DESC", nParams=1, paramTypes=0x0, paramValues=0xa2b7b0, paramLengths=0x0, paramFormats=0x0, resultFormat=0) at fe-exec.c:1871
No locals.

Unfortunately we didn't have more information from the crash, at least for now.

Is this a known issue and can you help me with this one?

Thanks,
Michal

-- 
Michal Novotny
System Development Lead
michal.novotny@greycortex.com

GREYCORTEX s.r.o.
Purkynova 127, 61200 Brno
Czech Republic
www.greycortex.com
--------------994DC38FFDCDFF03ABE3C612--