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

From: Dhiraj Chawla <dhiraj(dot)chawla(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
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-09 05:44:47
Message-ID: CAJgtxT4A4h7cK0Cc6D3vKiD9ksjA8ih4reX91HpEshodxTYr-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks Dave.

On Thu, Nov 8, 2012 at 9:08 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:

> 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
>

--
regards,

*Dhiraj Chawla*
Software Engineer
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Phone: +91-20-30589522

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2012-11-09 09:29:23 Re: pg_scanner - patch no.1
Previous Message Dhiraj Chawla 2012-11-09 05:44:27 Re: Reduce delay in keypress (input) in Query Tool