Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fSPSj-0004pj-Ii for pgadmin-hackers@arkaria.postgresql.org; Mon, 11 Jun 2018 16:14:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fSPSi-0005zn-6p for pgadmin-hackers@arkaria.postgresql.org; Mon, 11 Jun 2018 16:14:32 +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.89) (envelope-from ) id 1fSPSh-0005zW-O7 for pgadmin-hackers@lists.postgresql.org; Mon, 11 Jun 2018 16:14:32 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fSPSe-0005eL-F7 for pgadmin-hackers@postgresql.org; Mon, 11 Jun 2018 16:14:30 +0000 Received: by mail-wm0-x242.google.com with SMTP id x6-v6so15636680wmc.3 for ; Mon, 11 Jun 2018 09:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yA8SPEztnEIE2qbXFEOC451cvXYMW98a6zOklaRZg9U=; b=OXSIMk6YPOV/EfaFAcGlWdpqjokU+x9NF6D/g8O83P6x+pkneU5xP2uSOdXs4O+iMR Kct2hZLhQg4QX7avAbWEqyc5jW5yfmXEkTwKW4r4b4UqTTZNuZXZczi9wnUh+DR1WC7m HjXBi4JBt6AcLamcHgle/nZGfgk+C2DUm1DX8mCfTFcAGbS4J5yNJCRIznyjIi7DS4Yb VQWq7Zp1FhoOT0aSUu67xd1rei9OJ3urjEx4L2+z+ZRPvDl0p6VRVxF4ap7Pvx96pEYS +Qr5SFZbzyd2IviIQB6/bFClFA6XbqmHyYaklnU+/eNM31N3iasWgiE5o5ETl6DekjQR 7u8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yA8SPEztnEIE2qbXFEOC451cvXYMW98a6zOklaRZg9U=; b=JwbV5IeHkgH+otD0vIZjMgWIMu1RgB1GbraVGX/fIuNrKIVX8vrs6FMl322ClS6+Ql h1AAfhbxs+GdKn0MU3wd3BQf6S70gR512DiG2+mwecT/B9/Ae4Hixwj+s/vs7fO+L92B 2CtD7j1EV9qLDGeN4IRIdmX65ru0BvO8H4/DHCDwtpFjB3BrckIMBAoNV9krClbjCxmi BV6otztG2ouIXtQaMptm6D45tbuLr9AGOPuO/gq5DfS2pGG4gY112I0x3zf/Mf/6pYJo l1HHJLtmCRABoPaDpbiRnbu79dJhZi0OZZsjxomrbsbONdIIhp01sUPFypY1HsVH0T6t 14cA== X-Gm-Message-State: APt69E0P6UH2neeMNwGSJqUC3NyJvnGn37fu5mFQ1cWe6Rz3udcetRm7 aHdemgetMmTn4g6P8AaNyU81KAOjYjGa8yfTVH4qKu45E0El3x+f2nLaTOqM3HgzpKAPcdqNCK0 360RUmEmUJG3RL+rHaU2HXhLNe5PqALrUpuVKwtZC3jL6QK701jexi3fQBVPuE7S4zLWrQy9pTO pgcFqQ6w== X-Google-Smtp-Source: ADUXVKLleqYTZF9pAskVhbuD3yeec0owsA8FEsX96mQQfk3ihpjCb/cWs57ltBufPq0Pe+DDHD8LQA== X-Received: by 2002:a50:aec8:: with SMTP id f8-v6mr19372025edd.72.1528733666653; Mon, 11 Jun 2018 09:14:26 -0700 (PDT) Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com. [209.85.128.171]) by smtp.gmail.com with ESMTPSA id d13-v6sm21922515edb.18.2018.06.11.09.14.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 09:14:25 -0700 (PDT) Received: by mail-wr0-f171.google.com with SMTP id x4-v6so12877025wro.11 for ; Mon, 11 Jun 2018 09:14:25 -0700 (PDT) X-Received: by 2002:adf:8211:: with SMTP id 17-v6mr13345949wrb.144.1528733665165; Mon, 11 Jun 2018 09:14:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:2907:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 09:14:24 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Mon, 11 Jun 2018 17:14:24 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] pgAgent segfault To: Ashesh Vashi Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000119917056e600b21" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000119917056e600b21 Content-Type: text/plain; charset="UTF-8" Thanks, patch applied. On Mon, Jun 11, 2018 at 5:25 AM, Ashesh Vashi wrote: > Hi Dave, > > While debugging the issue > > reported by Rob, I found one segfault. > Please find the attached patch to find that fix along with another one. > > 1. Connection object was being accessed, which was already released. > > 2. Changed the logic for checking the connection object existence. > > We're using "if (!ms_primaryCon)", which should convert the logic as > boolean operator explicitly, which we defined for the 'DBconn' class. > > I suspect some compilers (specifically windows one) may not behave that > way, and instead of using the boolean operator, it checks for the pointer > is NULL or not. > > -- > > Thanks & Regards, > > Ashesh Vashi > EnterpriseDB INDIA: Enterprise PostgreSQL Company > > > > *http://www.linkedin.com/in/asheshvashi* > > -- Dave Page VP, Chief Architect, Tools & Installers EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company Blog: http://pgsnake.blogspot.com Twitter: @pgsnake --000000000000119917056e600b21 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, patch applied.
On Mon, Jun 11, 2018 at 5:25 AM, Ashesh Vashi <= span dir=3D"ltr"><ashesh.vashi@enterprisedb.com> wrote:
Hi Dave,

While = debugging the issue reported by Rob, I found one segfault.
Please find the= attached patch to find that fix along with another one.

1. Connection object was being accessed, which was already released.=

2. Changed the logic for checking the connection = object existence.

We're using "if (!ms_pr= imaryCon)", which should convert the logic as boolean operator explici= tly, which we defined for the 'DBconn' class.

<= div>I suspect some compilers (specifically windows one) may not=C2=A0behave= that way, and instead of using the boolean operator, it checks for the poi= nter is NULL or not.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company

<= br>

<= a href=3D"http://www.linkedin.com/in/asheshvashi" target=3D"_blank">http= ://www.linkedin.com/in/asheshvashi




--
Dave Page
VP, Ch= ief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
Th= e Enterprise PostgreSQL Company

Blog: http://pgsnake.blogspot.com
Twitter: @pg= snake
--000000000000119917056e600b21--