Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 281729 - =app-crypt/seahorse-2.22.3 crashed with SIGSEGV if built with USE=ldap against libldap-2 on 64bit arches
Summary: =app-crypt/seahorse-2.22.3 crashed with SIGSEGV if built with USE=ldap agains...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords:
: 284750 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-17 03:31 UTC by Alexander Bezrukov
Modified: 2010-04-26 13:49 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,3.79 KB, text/plain)
2009-08-17 03:34 UTC, Alexander Bezrukov
Details
Call gpgme_check_version() before gpgme_new() (seahorse-2.22.3-gpgme-1.2.0.patch,450 bytes, patch)
2009-09-14 15:20 UTC, Patrick Beckmann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bezrukov 2009-08-17 03:31:14 UTC
seahorse-agent, seahorse-preferences (installed from =app-crypt/seahorse-2.22.3, which is latest stable) crash with

** (seahorse-preferences:26967): CRITICAL **: init_gpgme: assertion `GPG_IS_OK (err)' failed

** (seahorse-preferences:26967): CRITICAL **: seahorse_pgp_source_init: assertion `GPG_IS_OK (err)' failed

Program received signal SIGSEGV, Segmentation fault.

So far I can see, this happens because <ldap.h> in =net-nds/openldap-2.3.43 (also the latest stable) declares ldap_init() and ldap_simple_bind() functions only if LDAP_DEPRECATED preprocessor variable is defined (which is not the case by default).

From the end user perspective, this means that
1. Seahorse is completely unusable (for some this means Gnome is unusable)
2. /var/log/auth.log is poisoned with strangely looking authentication failures because of malformed requests to ldap. This may trigger unnecessary security investigation.

This problem seems to be known, see http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg638316.html

I haven't spent enough time debugging the problem (mostly because USE=debug is broken for seahorse), maybe later. What I see for sure is that pointers passed to these functions being truncated.


Reproducible: Always

Steps to Reproduce:
1. Setup ldap, start slapd
2. Start a gnome session
3. echo run | gdb `which seahorse-preferences`
or
4. echo run | gdb `which seahorse-agent`
Actual Results:  
** (seahorse-preferences:26967): CRITICAL **: init_gpgme: assertion `GPG_IS_OK (err)' failed

** (seahorse-preferences:26967): CRITICAL **: seahorse_pgp_source_init: assertion `GPG_IS_OK (err)' failed
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f4d62c88740 (LWP 26967)]
0x000000000042796d in ?? ()



Expected Results:  
Application is started
Comment 1 Alexander Bezrukov 2009-08-17 03:34:09 UTC
Created attachment 201491 [details]
emerge --info
Comment 2 Alexander Bezrukov 2009-08-17 05:04:37 UTC
I am sorry, problem persists but my diagnosis was wrong. Re-compiling with -DLDAP_DEPRECATED didn't solve the problem as well as downgrading to openldap-2.3.41. Even worse, building with --disable-ldap doesn't help either so these problems (with absent prototypes and this one) are perhaps completely distinct.

Some techical details:
#0  0x0000000000431cd8 in cancel_scheduled_refresh (psrc=0x26a0660) at seahorse-pgp-source.c:559
#1  0x000000000043284a in seahorse_pgp_source_load (src=0x26a0660, keyid=0) at seahorse-pgp-source.c:882
#2  0x000000000042dd2e in seahorse_key_source_load (sksrc=0x26a0660, keyid=0) at seahorse-key-source.c:94
#3  0x000000000041276b in seahorse_context_load_local_keys (sctx=0x26a0630) at seahorse-context.c:737
#4  0x0000000000410747 in main (argc=1, argv=0x7fffbdbad548) at seahorse-pgp-preferences.c:82

The access violation happens because at seahorse-pgp-source.c:559:
if (psrc->pv->scheduled_refresh != 0) // ...
pv happens to be NULL.

I didn't try to debug further.
Comment 3 Gilles Dartiguelongue gentoo-dev 2009-08-26 20:33:48 UTC
please try with seahorse-2.26. 2.22 is over one year old and it is unlikely that we or upstream will spend time fixing it. Gnome 2.26 stabilization is coming, see bug #281427.
Comment 4 Alexander Bezrukov 2009-08-29 20:08:26 UTC
(In reply to comment #3)
> please try with seahorse-2.26. 2.22 is over one year old and it is unlikely

Yes, this is what I actually tried to do first of all. Seahorse-2.26 has different executables so instead of editing scripts I upgraded to Gnome-2.26-3. It mostly works, thank you. Please note that the problem with LDAP_DEPRECATED didn't gone away so one need either build seahorse with this variable defined or with -ldap use flag (and store keys elsewhere).

There are many new problems with Gnome-2.26.3 but I hope things will gradually settle out.
Comment 5 Pacho Ramos gentoo-dev 2009-09-02 10:17:31 UTC
I am also seeing these in /var/log/messages after updating my systems (after one month), even being built with -ldap:
Sep  2 12:15:38 belkin2 seahorse-agent[19253]: init_gpgme: assertion `GPG_IS_OK (err)' failed
Sep  2 12:15:38 belkin2 seahorse-agent[19253]: seahorse_pgp_source_init: assertion `GPG_IS_OK (err)' failed
Sep  2 12:15:38 belkin2 seahorse-agent[19253]: unsupported key server uri scheme: ldap
Sep  2 12:15:38 belkin2 seahorse-agent[19253]: segfault at 0 ip 0000000000432fcf sp 00007fffd17c5fc0 error 4 in seahorse-agent[400000+4e000]
Comment 6 Marcello Magaldi 2009-09-02 12:35:35 UTC
(In reply to comment #5)
> I am also seeing these in /var/log/messages after updating my systems (after
> one month), even being built with -ldap:
> Sep  2 12:15:38 belkin2 seahorse-agent[19253]: init_gpgme: assertion `GPG_IS_OK
> (err)' failed
> Sep  2 12:15:38 belkin2 seahorse-agent[19253]: seahorse_pgp_source_init:
> assertion `GPG_IS_OK (err)' failed
> Sep  2 12:15:38 belkin2 seahorse-agent[19253]: unsupported key server uri
> scheme: ldap
> Sep  2 12:15:38 belkin2 seahorse-agent[19253]: segfault at 0 ip
> 0000000000432fcf sp 00007fffd17c5fc0 error 4 in seahorse-agent[400000+4e000]
> 

same issue here also if seahorse built with -ldap

Comment 7 Gilles Dartiguelongue gentoo-dev 2009-09-06 11:48:56 UTC
Are you guys actually reproducing this bug with searhose 2.26.3 or not ?
Comment 8 Leandro Melo de Sales 2009-09-08 02:34:08 UTC
(In reply to comment #7)
> Are you guys actually reproducing this bug with searhose 2.26.3 or not ?
> 

Hi. How it is possible to install seahorse version 2.26.3? there is only version 2.26.3 available.
Comment 9 Nirbheek Chauhan (RETIRED) gentoo-dev 2009-09-08 04:35:54 UTC
Use package.keywords to keyword seahorse-2.26.2 and try it out. You might have to keyword other dependencies as well.
Comment 10 Pacho Ramos gentoo-dev 2009-09-10 17:40:23 UTC
This is caused by gpgme-1.2.0 stabilization in some arches (that haven't waited for gnome-2.26 stabilization)

Downgrading to 1.1.8 fixes the problem
Comment 11 Alexander Bezrukov 2009-09-10 18:47:35 UTC
(In reply to comment #7)

It does but implies upgrading to gnome-2.26.3 (or editing some scripts) because executables searhose-2.26.3 installs are different from those installed by seahorse-2.22.3. I also didn't try to compile without LDAP_DEPRECATED defined because this is not expected to work.

(In reply to comment #7)
Thank you for noting this!
Comment 12 Alexander Bezrukov 2009-09-10 18:48:42 UTC
(In reply to comment #10), I meant.
Thank you for noting this!
Comment 13 Patrick Beckmann 2009-09-14 15:20:17 UTC
Created attachment 204069 [details, diff]
Call gpgme_check_version() before gpgme_new()

Call gpgme_check_version() before gpgme_new(), as mentioned in http://bugs.gentoo.org/show_bug.cgi?id=275000

With this change it works for me...
Comment 14 Gilles Dartiguelongue gentoo-dev 2009-09-18 14:32:28 UTC
*** Bug 284750 has been marked as a duplicate of this bug. ***
Comment 15 Andreas Proschofsky (RETIRED) gentoo-dev 2010-02-26 19:47:34 UTC
Is there some progress here? Still seeing this bug and gpgme 1.2.0 is even marked stable now...
Comment 16 Pacho Ramos gentoo-dev 2010-03-20 09:29:34 UTC
Could this be related with https://bugzilla.gnome.org/show_bug.cgi?id=607423 ?
Comment 17 Pacho Ramos gentoo-dev 2010-04-26 13:49:24 UTC
Just fixed in seahorse-plugins-2.28.1-r1. Thanks for your patience.