Direct debug dialog hangs in OnSize()

Lists: pgadmin-hackers
From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Direct debug dialog hangs in OnSize()
Date: 2012-04-19 20:42:17
Message-ID: 4F9078A9.6000801@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

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

Attachment Content-Type Size
remove-useless-panels-from-dlgDirectDbg.patch text/x-diff 957 bytes

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Direct debug dialog hangs in OnSize()
Date: 2012-04-19 20:43:40
Message-ID: 4F9078FC.5010800@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

Sorry, attached wrong patch in previous mail. Here's the correct one.

On 19.04.2012 23:42, Heikki Linnakangas wrote:
> 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

Attachment Content-Type Size
remove-useless-panels-from-dlgDirectDbg.patch text/x-diff 3.7 KB

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Direct debug dialog hangs in OnSize()
Date: 2012-04-19 20:59:50
Message-ID: 4F907CC6.20100@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

And now that I've updated my local repository, here's a third version
that actually applies. (just my working copy didn't fix the issue)

On 19.04.2012 23:43, Heikki Linnakangas wrote:
> Sorry, attached wrong patch in previous mail. Here's the correct one.
>
> On 19.04.2012 23:42, Heikki Linnakangas wrote:
>> 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

Attachment Content-Type Size
remove-useless-panels-from-dlgDirectDbg-2.patch text/x-diff 3.6 KB

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Direct debug dialog hangs in OnSize()
Date: 2012-04-20 08:21:35
Message-ID: CA+OCxozL8HVVqZVjc-ZoxiTyyZRHMAYCd4U9mQ-HaBrJ_6RKXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

Hi

On Thu, Apr 19, 2012 at 9:59 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> And now that I've updated my local repository, here's a third version that
> actually applies. (just my working copy didn't fix the issue)

With this change, the dialogue no longer meets our design standard.

Please see http://wiki.postgresql.org/wiki/PgAdmin_Internals#Property_page_dialogue_layout,
which should be the standard for all new/updated dialogues, except in
exceptional circumstances (with justification).

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

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


From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Direct debug dialog hangs in OnSize()
Date: 2012-04-20 08:47:03
Message-ID: 1334911623.4142.10.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

On Fri, 2012-04-20 at 09:21 +0100, Dave Page wrote:
> Hi
>
> On Thu, Apr 19, 2012 at 9:59 PM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> > And now that I've updated my local repository, here's a third version that
> > actually applies. (just my working copy didn't fix the issue)
>
> With this change, the dialogue no longer meets our design standard.
>
> Please see http://wiki.postgresql.org/wiki/PgAdmin_Internals#Property_page_dialogue_layout,
> which should be the standard for all new/updated dialogues, except in
> exceptional circumstances (with justification).
>

I worked a bit on Heikki's patch yesterday evening and this morning. It
seems pgAdmin hangs when I want to debug functions with parameters. If
my function doesn't have any parameter, it works well.

IOW, it hangs when we call Show on the dlgDirectDeg dialog.

I don't understand why though. The XRC file seems good to me.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Direct debug dialog hangs in OnSize()
Date: 2012-04-20 08:52:11
Message-ID: 1334911931.4142.13.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

On Fri, 2012-04-20 at 10:47 +0200, Guillaume Lelarge wrote:
> On Fri, 2012-04-20 at 09:21 +0100, Dave Page wrote:
> > Hi
> >
> > On Thu, Apr 19, 2012 at 9:59 PM, Heikki Linnakangas
> > <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> > > And now that I've updated my local repository, here's a third version that
> > > actually applies. (just my working copy didn't fix the issue)
> >
> > With this change, the dialogue no longer meets our design standard.
> >
> > Please see http://wiki.postgresql.org/wiki/PgAdmin_Internals#Property_page_dialogue_layout,
> > which should be the standard for all new/updated dialogues, except in
> > exceptional circumstances (with justification).
> >
>
> I worked a bit on Heikki's patch yesterday evening and this morning. It
> seems pgAdmin hangs when I want to debug functions with parameters. If
> my function doesn't have any parameter, it works well.
>
> IOW, it hangs when we call Show on the dlgDirectDeg dialog.
>
> I don't understand why though. The XRC file seems good to me.
>

I took a look at the thread Heikki mentionned in his first mail. One of
the issue he had was fixed by setting the size of the COL_NAME column.
We don't do that if we have to show the dialog. So I added the same
statement, and it works now. Kinda puzzling, but it works. And we still
meet our design standard. See attached patch.

Heikki, is this patch working for you?

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

Attachment Content-Type Size
dbg.patch text/x-patch 446 bytes

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Direct debug dialog hangs in OnSize()
Date: 2012-04-20 10:26:53
Message-ID: 4F9139ED.3080502@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

On 20.04.2012 11:52, Guillaume Lelarge wrote:
> On Fri, 2012-04-20 at 10:47 +0200, Guillaume Lelarge wrote:
>> On Fri, 2012-04-20 at 09:21 +0100, Dave Page wrote:
>>> On Thu, Apr 19, 2012 at 9:59 PM, Heikki Linnakangas
>>> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>>> And now that I've updated my local repository, here's a third version that
>>>> actually applies. (just my working copy didn't fix the issue)
>>>
>>> With this change, the dialogue no longer meets our design standard.
>>>
>>> Please see http://wiki.postgresql.org/wiki/PgAdmin_Internals#Property_page_dialogue_layout,
>>> which should be the standard for all new/updated dialogues, except in
>>> exceptional circumstances (with justification).

Ah, thanks for pointing that out.

> I took a look at the thread Heikki mentionned in his first mail. One of
> the issue he had was fixed by setting the size of the COL_NAME column.
> We don't do that if we have to show the dialog. So I added the same
> statement, and it works now. Kinda puzzling, but it works. And we still
> meet our design standard. See attached patch.
>
> Heikki, is this patch working for you?

Yes, that fixes it. Thanks!

While we're at it, can we make the 'value' column wider? It start really
small, and there's plenty of space in the grid.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Direct debug dialog hangs in OnSize()
Date: 2012-04-20 15:08:19
Message-ID: 1334934499.4142.40.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgadmin-hackers

On Fri, 2012-04-20 at 13:26 +0300, Heikki Linnakangas wrote:
> On 20.04.2012 11:52, Guillaume Lelarge wrote:
> > On Fri, 2012-04-20 at 10:47 +0200, Guillaume Lelarge wrote:
> >> On Fri, 2012-04-20 at 09:21 +0100, Dave Page wrote:
> >>> On Thu, Apr 19, 2012 at 9:59 PM, Heikki Linnakangas
> >>> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> >>>> And now that I've updated my local repository, here's a third version that
> >>>> actually applies. (just my working copy didn't fix the issue)
> >>>
> >>> With this change, the dialogue no longer meets our design standard.
> >>>
> >>> Please see http://wiki.postgresql.org/wiki/PgAdmin_Internals#Property_page_dialogue_layout,
> >>> which should be the standard for all new/updated dialogues, except in
> >>> exceptional circumstances (with justification).
>
> Ah, thanks for pointing that out.
>
> > I took a look at the thread Heikki mentionned in his first mail. One of
> > the issue he had was fixed by setting the size of the COL_NAME column.
> > We don't do that if we have to show the dialog. So I added the same
> > statement, and it works now. Kinda puzzling, but it works. And we still
> > meet our design standard. See attached patch.
> >
> > Heikki, is this patch working for you?
>
> Yes, that fixes it. Thanks!
>
> While we're at it, can we make the 'value' column wider? It start really
> small, and there's plenty of space in the grid.
>

We now set the width of each column. The Type column and the Value
column are wider.

Commited and pushed.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com