From owner-freebsd-gnome@FreeBSD.ORG Fri Apr 11 14:14:24 2008 Return-Path: Delivered-To: gnome@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA6F61065672 for ; Fri, 11 Apr 2008 14:14:24 +0000 (UTC) (envelope-from cokane@freebsd.org) Received: from QMTA04.westchester.pa.mail.comcast.net (qmta04.westchester.pa.mail.comcast.net [76.96.62.40]) by mx1.freebsd.org (Postfix) with ESMTP id 402218FC13 for ; Fri, 11 Apr 2008 14:14:19 +0000 (UTC) (envelope-from cokane@freebsd.org) Received: from OMTA14.westchester.pa.mail.comcast.net ([76.96.62.60]) by QMTA04.westchester.pa.mail.comcast.net with comcast id CB081Z0081HzFnQ540EE00; Fri, 11 Apr 2008 14:12:37 +0000 Received: from discordia ([24.60.135.75]) by OMTA14.westchester.pa.mail.comcast.net with comcast id CEEF1Z00D1dmTCQ3a00000; Fri, 11 Apr 2008 14:14:15 +0000 X-Authority-Analysis: v=1.0 c=1 a=c5sTgUsrrxMA:10 a=aiIX5UjjAAAA:8 a=NyZaRCvvG4pcDEhT-R0A:9 a=62V8sK0HyAA-6_aoPHsA:7 a=NgxQxij1vgWD2n2upxE4LNvEQHsA:4 a=6bqG61NMjcsA:10 Received: by discordia (Postfix, from userid 103) id 69D3B1636F8; Fri, 11 Apr 2008 10:14:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8-gr1 Received: from [172.20.1.3] (erwin.int.cokane.org [172.20.1.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by discordia (Postfix) with ESMTP id 0AA5E1636F8; Fri, 11 Apr 2008 10:13:58 -0400 (EDT) Message-ID: <47FF722B.109@FreeBSD.org> Date: Fri, 11 Apr 2008 10:14:03 -0400 From: Coleman Kane Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.12 (X11/20080312) MIME-Version: 1.0 To: Joe Marcus Clarke References: <47FD09AC.2020907@FreeBSD.org> <1207776230.61729.28.camel@shumai.marcuscom.com> <47FD34E8.2000005@FreeBSD.org> <1207872846.87478.38.camel@shumai.marcuscom.com> <47FF66E3.8000304@FreeBSD.org> In-Reply-To: <47FF66E3.8000304@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: gnome@freebsd.org Subject: Re: Seahorse issues X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: cokane@FreeBSD.org List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2008 14:14:24 -0000 Coleman Kane wrote: > Joe Marcus Clarke wrote: >> On Wed, 2008-04-09 at 17:28 -0400, Coleman Kane wrote: >> >>> Joe Marcus Clarke wrote: >>> >>>> On Wed, 2008-04-09 at 14:23 -0400, Coleman Kane wrote: >>>> >>>>> I recently updated to GNOME 2.22, and ever since I have not been >>>>> able to have seahorse work, breaking application integration with >>>>> GPG, etc.... >>>>> >>>>> I filed a bug with the GNOME project, but perhaps someone else is >>>>> running into this: >>>>> http://bugzilla.gnome.org/show_bug.cgi?id=527193 >>>>> >>>> They will most likely come back and tell you to get a backtrace with >>>> symbols. It looks like a problem with either missing headers or a >>>> missing cast, though. If I'm right, this would only affect 64-bit >>>> platforms. >>>> >>>> Joe >>>> >>> Thanks, I pre-empted that by rigging the seahorse build so that it >>> built with -g -O0, and copied the non-stripped seahorse-agent binary >>> into /usr/local/bin for my submitted backtrace. Amazingly enough, it >>> turns out that even if you specify --enable-debug on the configure >>> line, the installation step still decided to strip the binaries >>> after installation. nice. >>> >>> Anyhow, there is hopefully enough info in there for them to figure >>> out what's up (my guess is that the missing cast is the likely >>> culprit, as it caused similar misbehavior in evolution some time back). >>> >> >> Undo all your seahorse changes, then try this patch to gnome-keyring. >> >> Joe >> >> > I now get a crash with the following backtrace: > (gdb) bt > #0 0x0000000806c047ee in pthread_mutex_getyieldloops_np () from > /lib/libthr.so.3 > #1 0x0000000803198b06 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #2 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #3 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #4 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #5 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #6 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #7 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #8 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #9 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #10 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #11 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #12 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #13 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #14 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #15 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #16 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #17 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #18 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #19 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #20 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #21 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #22 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #23 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #24 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #25 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #26 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #27 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #28 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #29 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #30 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #31 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #32 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #33 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #34 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #35 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #36 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #37 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #38 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #39 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #40 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #41 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #42 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #43 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #44 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #45 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #46 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #47 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #48 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #49 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #50 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #51 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #52 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #53 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #54 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > #55 0x0000000803198d12 in gnome_keyring_found_free () from > /usr/local/lib/libgnome-keyring.so.0 > #56 0x0000000000427bd3 in switch_calloc (num=1, size=17) at > seahorse-secure-memory.c:58 > #57 0x00000008063ff2b3 in g_malloc0 () from > /usr/local/lib/libglib-2.0.so.0 > ... > > The alternatic g_malloc->switch_calloc->gnome_keyring_found_free calls > repeat ad infinum, leading me to believe that seahorse has managed to > plug it's "secure g_malloc" into glib so that other linked code also > attempts to use the g_malloc implementation provided by seahorse. > Somehow, I suppose that gnome_keyring_found_free is going to have to > not use the seahorse-provided g_malloc...or it is going to need to > tell seahorse to disable that feature. > > Maybe we can have seahorse-agent attempt a test at startup, and > populate some "gboolean has_secure_mem" with TRUE or FALSE. Then, in > the seahorse WITH_SECURE_MEM, it performs: > seahorse_use_secure_mem = has_secure_mem; > > ??? > > I believe that seahorse_secure_memory_init in seahorse-secure-memory.c > is where the glib malloc functions get overridden. Of course, is a > secured environment this is the ideal operation.... > > If we could hook it such that seahorse detects the lack of secured > memory prior to calling seahorse_secure_memory_init, then we can > conditionally call that _init function in the cases where we have > secure memory. > > -- > Coleman Kane I removed your earleir patch, which has the side effect of causing gnome_keyring_memory_try_alloc(size) to act in a manner that violates its documentation, as well as causing the above bug. I then added the three patches to security/seahorse which I posted into http://bugzilla.gnome.org/show_bug.cgi?id=527193 today: * http://bugzilla.gnome.org/attachment.cgi?id=109055 * http://bugzilla.gnome.org/attachment.cgi?id=109056 * http://bugzilla.gnome.org/attachment.cgi?id=109057 These three alter the behavior of Seahorse in the manner I described above, and don't touch gnome-keyring. For all purposes, I *think* gnome-keyring is acting properly here. The consumer of gnome-keyring (seahorse) should first be testing if the features that it wants to use are actually provided by the library before it blindingly attempts to use them. This is, IMHO, why gnome-keyring provides the *_try(...) versions of its securemem alloc functions. Additionally, you'll get a seahorse g_warning about unavailable secure memory now too. -- Coleman Kane