Thread: pgAdmin crashes when checking "Security of definer"

pgAdmin crashes when checking "Security of definer"

From
Evan Martin
Date:
This crash happens to me every time both on 1.16.0 running on Windows 7 
x64 and on latest trunk version running on 32-bit Linux.

To reproduce:

1) Open the properties dialog for a function.
2) On the options tab check "Security of definer".
3) Click Apply.
4) Uncheck "Security of definer again". pgAdmin immediately crashes with 
an access violation.




Re: pgAdmin crashes when checking "Security of definer"

From
Michal Kozusznik
Date:
Check if Apply button is active just after opening function properties.
If true - it is known issues. It's not related to setting an option but 
to apply changes while window is not initialized with correct state 
(button should be disabled just after opening properties window)

BTW I'm curious why devs still didn't managed this issue. I know it is 
hard to reproduce because some for the behaviour is correct for some 
functions but incorrect for other. However it should be quite clear 
which condition makes the button active at begining.

On 22.11.2012 13:55, Evan Martin wrote:
> This crash happens to me every time both on 1.16.0 running on Windows 
> 7 x64 and on latest trunk version running on 32-bit Linux.
>
> To reproduce:
>
> 1) Open the properties dialog for a function.
> 2) On the options tab check "Security of definer".
> 3) Click Apply.
> 4) Uncheck "Security of definer again". pgAdmin immediately crashes 
> with an access violation.
>
>
>




Re: pgAdmin crashes when checking "Security of definer"

From
Evan Martin
Date:
The Apply button is disabled when I open function properties. It only 
becomes enabled when I make a change. You're right, this is not 
exclusive to "Security of definer" - any change will do. For example, I 
can change the function cost, click Apply (the button becomes disabled 
again), then as soon as I press a digit key with the cursor in the 
function cost textbox pgAdmin crashes.

For me this is reproducible every time.

On 23/11/2012 12:05 AM, Michal Kozusznik wrote:
> Check if Apply button is active just after opening function properties.
> If true - it is known issues. It's not related to setting an option 
> but to apply changes while window is not initialized with correct 
> state (button should be disabled just after opening properties window)
>
> BTW I'm curious why devs still didn't managed this issue. I know it is 
> hard to reproduce because some for the behaviour is correct for some 
> functions but incorrect for other. However it should be quite clear 
> which condition makes the button active at begining.
>
> On 22.11.2012 13:55, Evan Martin wrote:
>> This crash happens to me every time both on 1.16.0 running on Windows 
>> 7 x64 and on latest trunk version running on 32-bit Linux.
>>
>> To reproduce:
>>
>> 1) Open the properties dialog for a function.
>> 2) On the options tab check "Security of definer".
>> 3) Click Apply.
>> 4) Uncheck "Security of definer again". pgAdmin immediately crashes 
>> with an access violation.
>>
>>
>>
>
>
>




Re: pgAdmin crashes when checking "Security of definer"

From
Guillaume Lelarge
Date:
On Thu, 2012-11-22 at 14:05 +0100, Michal Kozusznik wrote:
> Check if Apply button is active just after opening function properties.
> If true - it is known issues

Known issue, yet to be confirmed by a developer :)

> . It's not related to setting an option but 
> to apply changes while window is not initialized with correct state 
> (button should be disabled just after opening properties window)
> 
> BTW I'm curious why devs still didn't managed this issue. I know it is 
> hard to reproduce because some for the behaviour is correct for some 
> functions but incorrect for other. However it should be quite clear 
> which condition makes the button active at begining.
> 

Actually, it's not. I still don't have a reproduction test case, that
would help me to fix the issue. I've never been able to reproduce this
issue. So, yeah, we didn't managed to fix your issue as you and I aren't
able to find a suitable test case for my laptop.


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




Re: pgAdmin crashes when checking "Security of definer"

From
Guillaume Lelarge
Date:
On Fri, 2012-11-23 at 00:22 +1100, Evan Martin wrote:
> The Apply button is disabled when I open function properties. It only 
> becomes enabled when I make a change. You're right, this is not 
> exclusive to "Security of definer" - any change will do. For example, I 
> can change the function cost, click Apply (the button becomes disabled 
> again), then as soon as I press a digit key with the cursor in the 
> function cost textbox pgAdmin crashes.
> 
> For me this is reproducible every time.
> 

I reproduce it too. Working on it.


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




Re: pgAdmin crashes when checking "Security of definer"

From
Dave Page
Date:


On Sunday, November 25, 2012, Guillaume Lelarge wrote:
On Fri, 2012-11-23 at 00:22 +1100, Evan Martin wrote:
> The Apply button is disabled when I open function properties. It only
> becomes enabled when I make a change. You're right, this is not
> exclusive to "Security of definer" - any change will do. For example, I
> can change the function cost, click Apply (the button becomes disabled
> again), then as soon as I press a digit key with the cursor in the
> function cost textbox pgAdmin crashes.
>
> For me this is reproducible every time.
>

I reproduce it too. Working on it.

I was looking at this earlier too, and could also reproduce it. It looks like the pointer to the pgFunction object that the dialogue holds becomes invalid, presumably when the tree item is refeshed. I'm guessing this applies to all dialogues with Apply buttons - not sure when or how it got broken though.


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

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

Re: pgAdmin crashes when checking "Security of definer"

From
Guillaume Lelarge
Date:
On Sun, 2012-11-25 at 14:47 +0000, Dave Page wrote:
> On Sunday, November 25, 2012, Guillaume Lelarge wrote:
> 
> > On Fri, 2012-11-23 at 00:22 +1100, Evan Martin wrote:
> > > The Apply button is disabled when I open function properties. It only
> > > becomes enabled when I make a change. You're right, this is not
> > > exclusive to "Security of definer" - any change will do. For example, I
> > > can change the function cost, click Apply (the button becomes disabled
> > > again), then as soon as I press a digit key with the cursor in the
> > > function cost textbox pgAdmin crashes.
> > >
> > > For me this is reproducible every time.
> > >
> >
> > I reproduce it too. Working on it.
> >
> 
> I was looking at this earlier too, and could also reproduce it. It looks
> like the pointer to the pgFunction object that the dialogue holds becomes
> invalid, presumably when the tree item is refeshed. I'm guessing this
> applies to all dialogues with Apply buttons - not sure when or how it got
> broken though.
> 

My guess would be when we added the automatic refresh of the tree. But I
didn't get any further. I also have some erratic messages on an
unavailable OID when it tries to launch the query "SELECT xmin FROM
pg_proc WHERE oid=some_huge_number" (the huge number being more than an
int4 can handle).


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




Re: pgAdmin crashes when checking "Security of definer"

From
Dave Page
Date:
On Mon, Nov 26, 2012 at 8:08 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> On Sun, 2012-11-25 at 14:47 +0000, Dave Page wrote:
>> On Sunday, November 25, 2012, Guillaume Lelarge wrote:
>>
>> > On Fri, 2012-11-23 at 00:22 +1100, Evan Martin wrote:
>> > > The Apply button is disabled when I open function properties. It only
>> > > becomes enabled when I make a change. You're right, this is not
>> > > exclusive to "Security of definer" - any change will do. For example, I
>> > > can change the function cost, click Apply (the button becomes disabled
>> > > again), then as soon as I press a digit key with the cursor in the
>> > > function cost textbox pgAdmin crashes.
>> > >
>> > > For me this is reproducible every time.
>> > >
>> >
>> > I reproduce it too. Working on it.
>> >
>>
>> I was looking at this earlier too, and could also reproduce it. It looks
>> like the pointer to the pgFunction object that the dialogue holds becomes
>> invalid, presumably when the tree item is refeshed. I'm guessing this
>> applies to all dialogues with Apply buttons - not sure when or how it got
>> broken though.
>>
>
> My guess would be when we added the automatic refresh of the tree. But I
> didn't get any further.

Nope - it was the code to prevent an object being dropped if the
properties dialogue for it is open. Akshay figured out a fix, and I've
pushed it to master and REL-1_16_0_PATCHES.

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

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



Re: pgAdmin crashes when checking "Security of definer"

From
Evan Martin
Date:
Thanks, confirmed fixed on trunk.

On 4/12/2012 12:24 AM, Dave Page wrote:
> On Mon, Nov 26, 2012 at 8:08 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> On Sun, 2012-11-25 at 14:47 +0000, Dave Page wrote:
>>> On Sunday, November 25, 2012, Guillaume Lelarge wrote:
>>>
>>>> On Fri, 2012-11-23 at 00:22 +1100, Evan Martin wrote:
>>>>> The Apply button is disabled when I open function properties. It only
>>>>> becomes enabled when I make a change. You're right, this is not
>>>>> exclusive to "Security of definer" - any change will do. For example, I
>>>>> can change the function cost, click Apply (the button becomes disabled
>>>>> again), then as soon as I press a digit key with the cursor in the
>>>>> function cost textbox pgAdmin crashes.
>>>>>
>>>>> For me this is reproducible every time.
>>>>>
>>>> I reproduce it too. Working on it.
>>>>
>>> I was looking at this earlier too, and could also reproduce it. It looks
>>> like the pointer to the pgFunction object that the dialogue holds becomes
>>> invalid, presumably when the tree item is refeshed. I'm guessing this
>>> applies to all dialogues with Apply buttons - not sure when or how it got
>>> broken though.
>>>
>> My guess would be when we added the automatic refresh of the tree. But I
>> didn't get any further.
> Nope - it was the code to prevent an object being dropped if the
> properties dialogue for it is open. Akshay figured out a fix, and I've
> pushed it to master and REL-1_16_0_PATCHES.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>




Re: pgAdmin crashes when checking "Security of definer"

From
Guillaume Lelarge
Date:
On Mon, 2012-12-03 at 13:24 +0000, Dave Page wrote:
> On Mon, Nov 26, 2012 at 8:08 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
> > On Sun, 2012-11-25 at 14:47 +0000, Dave Page wrote:
> >> On Sunday, November 25, 2012, Guillaume Lelarge wrote:
> >>
> >> > On Fri, 2012-11-23 at 00:22 +1100, Evan Martin wrote:
> >> > > The Apply button is disabled when I open function properties. It only
> >> > > becomes enabled when I make a change. You're right, this is not
> >> > > exclusive to "Security of definer" - any change will do. For example, I
> >> > > can change the function cost, click Apply (the button becomes disabled
> >> > > again), then as soon as I press a digit key with the cursor in the
> >> > > function cost textbox pgAdmin crashes.
> >> > >
> >> > > For me this is reproducible every time.
> >> > >
> >> >
> >> > I reproduce it too. Working on it.
> >> >
> >>
> >> I was looking at this earlier too, and could also reproduce it. It looks
> >> like the pointer to the pgFunction object that the dialogue holds becomes
> >> invalid, presumably when the tree item is refeshed. I'm guessing this
> >> applies to all dialogues with Apply buttons - not sure when or how it got
> >> broken though.
> >>
> >
> > My guess would be when we added the automatic refresh of the tree. But I
> > didn't get any further.
> 
> Nope - it was the code to prevent an object being dropped if the
> properties dialogue for it is open. Akshay figured out a fix, and I've
> pushed it to master and REL-1_16_0_PATCHES.
> 

Crap. That was my faulty code, then. Sorry, guys.


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