On Mon, May 20, 2013 at 3:58 PM, Dave Page <dp...@pgadmin.org> wrote:
> On Mon, May 20, 2013 at 11:24 AM, Akshay Joshi > <akshay.jo...@enterprisedb.com> wrote: > > > > > > > > On Fri, May 17, 2013 at 9:55 PM, Dave Page <dp...@pgadmin.org> wrote: > >> > >> Hi > >> > >> On Fri, May 10, 2013 at 11:35 AM, aditsu <adi...@yahoo.com> wrote: > >> > Ever since I started using pgAdmin (in 2006 or so) it has always > crashed > >> > about once an hour of active usage. I finally decided to report this. > >> > > >> > Here's one way to reproduce the problem with the latest pgAdmin > >> > (1.16.1): > >> > - connect to a database, go to the public schema > >> > - right-click "Tables", choose "New Table" > >> > - use the GUI to create a table called "foo" with a single column > called > >> > "bar", of type integer (ignore the no primary keys warning) > >> > - just to double-check, clicking "foo" in the tree now shows the > create > >> > table statement which looks something like this: > >> > -- Table: foo > >> > -- DROP TABLE foo; > >> > CREATE TABLE foo > >> > ( > >> > bar integer > >> > ) > >> > WITH ( > >> > OIDS=FALSE > >> > ); > >> > ALTER TABLE foo > >> > OWNER TO postgres; > >> > - right-click "foo" in the tree, choose "Scripts -> CREATE Script" > >> > - in the query window, uncomment "DROP TABLE foo;", change integer to > >> > serial, then run the query > >> > - close the query window, without saving changes > >> > > >> > At this point, pgAdmin instantly crashes with a segmentation fault. > >> > > >> > Some more information about my environment: > >> > - The operating system and version details -- Gentoo Linux > >> > - The version of pgAdmin you are running. -- pgadmin3-1.16.1-r1 (about > >> > window reports 1.16.1) > >> > - The configure options used (if compiled from source) -- for now I > can > >> > provide the Gentoo USE flags: databasedesigner -debug > >> > - The wxWidgets version and configure options used (if compiled from > >> > source) > >> > -- I believe the answer is wxGTK-2.8.12.1, USE flags: X opengl sdl > tiff > >> > -aqua -debug -doc -gnome -gstreamer -odbc -pch > >> > >> I finally managed to track this down I think. It only seems to go > >> wrong on Linux, only when browser refresh is set to "Refresh on > >> click", and only when an object can't be automatically refreshed > >> (usually because it's OID changed). What I believe happens is that on > >> GTK when the treeview node is removed, the parent node isn't > >> automatically selected, whereas on other platforms it is. Simple fix > >> seems to be to explicitly select the parent node before dropping the > >> original one. > >> > >> Akshay, can you please test and see if you agree the fix is appropriate? > > > > > > I am not able to reproduce the issue on my machine. Is there any > > particular steps to reproduce it? > > The steps above worked for me, though you may need to click "Tables" > and then "foo" again after closing the query tool. I also found that > it needed to be on Linux, and needed to have the "Refresh on click" > option set on the Options dialogue ("None" and "Refresh object and > children" didn't crash). > After performing the above step It is reproducible on my machine as well. I have applied and tested your patch, below is my observation - When I click on "Tables" and then "foo" pgAdmin didn't crash, but "foo" node was not selected for the first time, I have to click on "foo" node again to select that. - I have perform one more test case where I have clicked on "Tables" and then right click on "foo" node instead of left click, pgAdmin crashes with a segmentation fault. I have tried to figure out the problem by debugging the code, but every time when I run the pgAdmin using gdb it didn't crash, so it's being difficult to identify the cause of the crash. > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- *Akshay Joshi Senior Software Engineer EnterpriseDB Corporation The Enterprise PostgreSQL Company Phone: +91 20-3058-9522 Mobile: +91 976-788-8246*