Обсуждение: Crash in a specific situation while adding constraints

Поиск
Список
Период
Сортировка

Crash in a specific situation while adding constraints

От
Eric Ongerth
Дата:
Hi, I think this is the first time pgAdmin III has actually crashed for me, so it has a very good record over several
years!<br/><br />I'm running Windows 7 32-bit, and pgAdmin 1.12.0.  This was an unusual situation, not very typical
usage,but I suppose it still should not cause a crash.<br /><br />To replicate: create a table, do not create the
primarykey yet.  Give this table an id column, and a "parent_id" column.  Now open a window to create a new foreign key
forthis table.  Leave that window open but do not complete it yet.  Now open a window to create the primary key for the
table,complete the primary key form and click OK to finish.  Now go back to the remaining open window to finish
creatingthe foreign key, which should be parent_id referencing id.  The point is to make it a self-referential table. 
Anyway,when you complete the foreign key creation window and click OK on it, pgAdminIII crashes.<br /><br />I think
thisis probably related to some data or state that was associated with the Foreign Key window being open before the
primarykey was ever added.  Either a standard error should be shown to the user informing him that Add Foreign Key
cannotbe completed and needs to be closed and started over... or pgAdmin should be changed to make the Add FK window
operatein a stateless manner.  But I am making assumptions here, I don't know for sure why the crash happens.<br /><br
/>Thanks!<br/>--Eric<br /> 

Re: Crash in a specific situation while adding constraints

От
Guillaume Lelarge
Дата:
Le 01/01/2011 19:30, Eric Ongerth a écrit :
> Hi, I think this is the first time pgAdmin III has actually crashed for me,
> so it has a very good record over several years!
> 
> I'm running Windows 7 32-bit, and pgAdmin 1.12.0.  This was an unusual
> situation, not very typical usage, but I suppose it still should not cause a
> crash.
> 
> To replicate: create a table, do not create the primary key yet.  Give this
> table an id column, and a "parent_id" column.  Now open a window to create a
> new foreign key for this table.  Leave that window open but do not complete
> it yet.  Now open a window to create the primary key for the table, complete
> the primary key form and click OK to finish.  Now go back to the remaining
> open window to finish creating the foreign key, which should be parent_id
> referencing id.  The point is to make it a self-referential table.  Anyway,
> when you complete the foreign key creation window and click OK on it,
> pgAdminIII crashes.
> 

OK, I'm able to reproduce it in different ways. I have a strange cold
feeling this won't be easy to fix. Anyway, I'll work on this.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


Re: Crash in a specific situation while adding constraints

От
Guillaume Lelarge
Дата:
Le 02/01/2011 23:29, Guillaume Lelarge a écrit :
> Le 01/01/2011 19:30, Eric Ongerth a écrit :
>> Hi, I think this is the first time pgAdmin III has actually crashed for me,
>> so it has a very good record over several years!
>>
>> I'm running Windows 7 32-bit, and pgAdmin 1.12.0.  This was an unusual
>> situation, not very typical usage, but I suppose it still should not cause a
>> crash.
>>
>> To replicate: create a table, do not create the primary key yet.  Give this
>> table an id column, and a "parent_id" column.  Now open a window to create a
>> new foreign key for this table.  Leave that window open but do not complete
>> it yet.  Now open a window to create the primary key for the table, complete
>> the primary key form and click OK to finish.  Now go back to the remaining
>> open window to finish creating the foreign key, which should be parent_id
>> referencing id.  The point is to make it a self-referential table.  Anyway,
>> when you complete the foreign key creation window and click OK on it,
>> pgAdminIII crashes.
>>
> 
> OK, I'm able to reproduce it in different ways. I have a strange cold
> feeling this won't be easy to fix. Anyway, I'll work on this.
> 

With some sleep, I'm quite sure the issue is related to the fact we
refresh the treeview right after creating the primary key, meaning the
pointers available on the foreign key creation dialog are all screwed,
hence the crash.

That's also why we have so many "creative" way to crash pgAdmin. For
example, open the foreign key creation dialog, refresh the table node,
do something related to the table, and see pgAdmin crash.

I'm afraid we won't be able to do something without a major rewrite of
pgAdmin :-/


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com