> From: Stuart Henderson <[email protected]>
> Date: Mon, Oct 20, 2014 at 7:08 PM
> Subject: Re: databases/pgadmin3 is crashing on amd64
> To: David Coppa <[email protected]>
> Cc: janis <[email protected]>, OpenBSD Ports <[email protected]>
>
>
> On 2014/10/20 17:25, David Coppa wrote:
> > On Mon, Oct 20, 2014 at 3:27 PM, janis <[email protected]> wrote:
> > > Hello,
> > >
> > > databases/pgadmin3 is still broken. Here is a backtrace:
> >
> > Somewhere, it's trying to unlock an unlocked mutex...
>
> I didn't see this before (I am able to make a new connection, connect, and
> browse around the db, without hitting it) but I can reproduce it by
> right-clicking
> on a server name. 1.16.1 does work so it seems it was introduced in 1.18.x.
>
> Diffing the source...(oh great...not relevant to this, but they have their
> own embedded copy of libssh2...) it looks like it may be in the connection
> cancelling code in pgConn.cpp. I'm clearly missing something with how this
> works with wxWidgets though as I only see locks not unlocks in the pgadmin
> code.
>
> Running with RTHREAD_DEBUG=5 I see lock/unlock/lock/unlock/unlock for the
> relevant mutex but not sure how to lookup which mutex is involved, at least
> "info symbol <addr>" doesn't help.
Can you try the diff below?
Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/pgadmin3/Makefile,v
retrieving revision 1.29
diff -u -p -u -p -r1.29 Makefile
--- Makefile 30 Apr 2014 14:20:08 -0000 1.29
+++ Makefile 21 Oct 2014 12:26:35 -0000
@@ -3,7 +3,7 @@
COMMENT= administration and development platform for PostgreSQL
V= 1.18.1
-REVISION= 0
+REVISION= 1
DISTNAME= pgadmin3-$V
CATEGORIES= databases devel
Index: patches/patch-pgadmin_frm_events_cpp
===================================================================
RCS file: patches/patch-pgadmin_frm_events_cpp
diff -N patches/patch-pgadmin_frm_events_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-pgadmin_frm_events_cpp 21 Oct 2014 12:26:35 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+If the if() clause is false, Unlock() will be called on an already
+unlocked mutex
+
+--- pgadmin/frm/events.cpp.orig Fri Sep 27 16:51:46 2013
++++ pgadmin/frm/events.cpp Tue Oct 21 14:26:04 2014
+@@ -746,9 +746,10 @@ void frmMain::OnSelRightClick(wxTreeEvent &event)
+ currentObject = browser->GetObject(item);
+ }
+
+- if (currentObject)
++ if (currentObject) {
+ doPopup(browser, event.GetPoint(), currentObject);
+- s_currentObjectMutex.Unlock();
++ s_currentObjectMutex.Unlock();
++ }
+ }
+
+