[Patch] Crash in pgAdmin when Refresh object on click is enabled - Mailing list pgadmin-hackers

From Dhiraj Chawla
Subject [Patch] Crash in pgAdmin when Refresh object on click is enabled
Date
Msg-id CAJgtxT5bT7o-t26W9zo0fEa-0XJMeqXJ3_q9QZTARMAyBh8ByQ@mail.gmail.com
Whole thread Raw
Responses Re: [Patch] Crash in pgAdmin when Refresh object on click is enabled  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
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

Attachment

pgadmin-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: pgAdmin III commit: Fix dropping of constraints
Next
From: Dave Page
Date:
Subject: pgAdmin III commit: Avoid updating the GQB model on every key press in