pgAdmin forum post - leaving wxWidgets usage?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
scottfurry
Knows some wx things
Knows some wx things
Posts: 48
Joined: Mon May 28, 2007 1:51 pm
Location: Calgary, Alberta, Canada

pgAdmin forum post - leaving wxWidgets usage?

Post by scottfurry » Fri Sep 05, 2014 2:14 pm

I subscribe to a few mailing lists to keep up with projects development.
This morning I read a follow-up about pgAdmin3 and how the application is crashing with the current branch of wx3.0.
The follow up from one of the pgAdmin dev's bothers me a bit...
Unfortunately there are a number of such bugs that are not actually in
pgAdmin and we've been unable to get fixed. That's one of the reasons
why we're starting work on pgAdmin 4 which won't use wxWidgets. It
might be worth trying a debug build, but I'm not going to hold my
breath.
Suffice to say the whole senario is disconcerting.
For reference - pgAdmin Support mailing list discussion thread
Re: [pgadmin-support] PgAdmin Crash Dialog

User avatar
doublemax
Moderator
Moderator
Posts: 14314
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: pgAdmin forum post - leaving wxWidgets usage?

Post by doublemax » Fri Sep 05, 2014 2:54 pm

It's hard to judge from afar, but i don't think they've made enough effort to hunt down these crashes. Saying "it's wxWidgets fault", just because the last line of the call stack is inside wxWidgets is pretty bold.

Just for fun, i downloaded their source and looked into one of the methods that crashed:

Code: Select all

void frmMain::OnSelRightClick(wxTreeEvent &event)
{
	wxTreeItemId item = event.GetItem();
	if (item != browser->GetSelection())
	{
		browser->SelectItem(item);

		// Prevent changes to "currentObject" by "execSelchange" function by another thread.
		// Will hold the lock until we do popup on the respective object.
		//
		s_currentObjectMutex.Lock();
		currentObject = browser->GetObject(item);
	}

	if (currentObject)
		doPopup(browser, event.GetPoint(), currentObject);
	s_currentObjectMutex.Unlock();
}
The fact that the s_currentObjectMutex.Lock() call is inside the if() clause, but the s_currentObjectMutex.Unlock() is outside, is not good. Because if the if() clause it false, they will call Unlock() on an already unlocked mutex. Which is the cause of the crash.

Just the fact that they (think they) have to use mutexes in this code, is already suspicious in itself, but without knowing the "bigger picture", i can't say anything more about it.

There is no doubt that there are many bugs in wxWidgets, but nevertheless i'm using it since wx 2.6.1 (>10 years) on a professional level. And if you find a bug and are able to present a way to reproduce it, it will be usually fixed pretty fast. Probably faster than in any comparable toolkit. But as the wxWidgets team is pretty small, it depends on the cooperation of its users. Just saying "It crashes all the time" won't get anything fixed.
Use the source, Luke!

scottfurry
Knows some wx things
Knows some wx things
Posts: 48
Joined: Mon May 28, 2007 1:51 pm
Location: Calgary, Alberta, Canada

Re: pgAdmin forum post - leaving wxWidgets usage?

Post by scottfurry » Fri Sep 05, 2014 3:02 pm

doublemax! wow...awesome, in-depth answer! I had not gone that far in-depth in the code.
I have no insight or idea about the crashes as I had not explored the notion too much.

I very much appreciate that these are two projects staffed with volunteers (all of whom have limited resources). But I wonder if some directed communication between the two project would help matters?

I was concerned about a "notable" project leaving the wxWidgets fold that I had to open my mouth (famous last words...).

User avatar
doublemax
Moderator
Moderator
Posts: 14314
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: pgAdmin forum post - leaving wxWidgets usage?

Post by doublemax » Fri Sep 05, 2014 3:16 pm

I very much appreciate that these are two projects staffed with volunteers (all of whom have limited resources). But I wonder if some directed communication between the two project would help matters?
Changing the toolkit is a big decision, so any developer will put a lot of thought into it. I'd assume that their decision is final. But if they want to continue with wxWidgets, getting in touch with the wxWIdgets developers is easy through the wx-users mailing list or through the bug tracker. All they have to do is confirm that it's a wxWidgets bug and preferable present a way to reproduce the problem.
I was concerned about a "notable" project leaving the wxWidgets fold that I had to open my mouth (famous last words...).
Quite frankly, i don't think anyone cares. wxWidgets is an open source project, nobody gains or loses if one developer decides to use another framework. That happens all the time, e.g. VLC used to use wxWidgets before they switched to Qt.
Use the source, Luke!

scottfurry
Knows some wx things
Knows some wx things
Posts: 48
Joined: Mon May 28, 2007 1:51 pm
Location: Calgary, Alberta, Canada

Re: pgAdmin forum post - leaving wxWidgets usage?

Post by scottfurry » Fri Sep 05, 2014 3:31 pm

doublemax wrote:Changing the toolkit is a big decision, so any developer will put a lot of thought into it.
I understand the notion of "big decision". Not something one undertakes on a whim. The replies from the pgAdmin mailing list mentioned consideration of python and javascript. I wonder if the re-write will mask and/or make disappear the problems that led to this point?
doublemax wrote:Quite frankly, i don't think anyone cares. wxWidgets is an open source project, nobody gains or loses if one developer decides to use another framework. That happens all the time, e.g. VLC used to use wxWidgets before they switched to Qt.
I had forgotten about VLC changing its interface. Don't mean to sound "alarmist", but seems like a waste of effort to "re-write" when tweaking would suffice.

However, I see your point. Thanks for "clueing me in". :D

Post Reply