Re: [Patch] Crash in pgAdmin when Refresh object on click is enabled

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Dhiraj Chawla <dhiraj(dot)chawla(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [Patch] Crash in pgAdmin when Refresh object on click is enabled
Date: 2012-11-08 15:38:40
Message-ID: CA+OCxowZzvdxLo2OZgLeWq00P4uzjr6Q3CJEUgbKpsMWuzOsUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks, patch applied.

On Thu, Nov 8, 2012 at 1:12 PM, Dhiraj Chawla
<dhiraj(dot)chawla(at)enterprisedb(dot)com> wrote:
> Hi Dave,
>
> This patch fixes a crash in pgAdmin||| which happens when user enables
> Refresh object on click in the options dialog in the UI Miscellaneous tab
> and the opens the property dialog of Job, step or Schedule.
>
> The reproduction step is as follows:
>
> 1. Enable Refresh object on click in Options dialog
> 2. Expand the Jobs node and open it's property dialog
> 3. Now click on Steps node or Schedules node or select a Step or Schedule
> node which causes click refresh of the node.
> 4. Now again click on the Job node.
> 5. Now change some properties in the dialog and click ok.
> 6. pgAdmin crashes.
>
> Similarly if you open a property dialog of a Step and then click on job node
> and then change some properties in the dialog and then click Ok button.
> Again the pgAdmin crashes.
>
> The main reason found for the crash is, that when we select a Job, Step or
> Schedule node, the node is refreshed in which case we delete object
> associated with the node. Now this same object is passed to the dialog. Thus
> when a dialog is invoked this object gets passed to the object which is
> valid. But when we re-select this node, the node gets refreshed and the
> object is deleted and a new object is created. Thus now the dialog has a
> dereferenced object. Similarly if a parent node is selected the all the
> child nodes are deleted.
>
> This fix that I have done here in this patch, whenever we go to refresh a
> node on single click we check if dialog of the currently selected node or
> the nodes children to the current node are already opened or not. If no
> dialogs are open we go ahead with the refresh or else we bail out.
>
> Kindly review the patch and let me know if my approach is correct or not.
>
> Thanks,
>
> --
> regards,
>
> Dhiraj Chawla
> Software Engineer
> EnterpriseDB Corporation
> The Enterprise PostgreSQL Company
>
> Phone: +91-20-30589522
>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2012-11-08 16:39:45 Re: pg_scanner - patch no.1
Previous Message Dave Page 2012-11-08 15:38:31 pgAdmin III commit: Prevent a crash when refreshing a node which has a