When I build pgAdmin from sources on my laptop running Debian, and try to open the Direct Debug dialog by choosing "Debug" on a function, pgAdmin hangs, consuming 100% of CPU. The dialog never opens, and I have no choice but kill pgAdmin forcibly. I only get this problem when I build pgadmin from sources, the binary version from Debian repository works fine.

I complained about this same issue years ago, and it was apparently fixed back then (http://archives.postgresql.org/pgadmin-hackers/2009-04/msg00017.php) but looks like the issue has reappeared. Attaching a debugger to the process when it's hung, I get a stack trace identical to that I posted back in 2009. It's stuck repeatedly getting the OnSize event, and resizing the window or some of the controls in response.

I don't understand much about this stuff, but I started comparing the dlgDirectDbg window with dlgPgpassConfig window, which is very similar but works. Looks to me there's some useless nested panels in the dlgDirectDbg dialog, and removing them fixes the issue for me. After that, the size of the window is wrong, though, so I added some extra code to recalculate the desired window size after adding the arguments to the grid in the dialog. I'm not sure what the original problem was or why this fixes it, but the attached patch fixes it for me.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com
diff --git a/pgadmin/ui/dlgDirectDbg.xrc b/pgadmin/ui/dlgDirectDbg.xrc
index 951a2f0..90cbdfd 100644
--- a/pgadmin/ui/dlgDirectDbg.xrc
+++ b/pgadmin/ui/dlgDirectDbg.xrc
@@ -9,12 +9,6 @@
       <growablerows>0</growablerows>
       <growablecols>0</growablecols>
       <object class="sizeritem">
-        <object class="wxNotebook" name="nbNotebook">
-          <size>296,240d</size>
-          <selected>0</selected>
-          <object class="notebookpage">
-            <label>Properties</label>
-            <object class="wxPanel" name="pnlProperties">
               <object class="wxFlexGridSizer">
                 <cols>1</cols>
                 <rows>3</rows>
@@ -44,9 +38,6 @@
                   <border>4</border>
                 </object>
               </object>
-            </object>
-          </object>
-        </object>
         <flag>wxEXPAND|wxALIGN_CENTRE|wxALL</flag>
         <border>3</border>
       </object>
-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to