Thread: [PATCH] pgAgent segfault
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.
Attachment
Thanks, patch applied.
On Mon, Jun 11, 2018 at 5:25 AM, Ashesh Vashi <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_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.
Dave Page
VP, Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
VP, Chief Architect, Tools & Installers
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake