After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 375062 - Crash when using gpg2
Crash when using gpg2
Status: RESOLVED FIXED
Product: seahorse
Classification: Applications
Component: Daemon
unspecified
Other other
: High critical
: 1.0.0
Assigned To: Seahorse Maintainer
Seahorse Maintainer
: 404081 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-11-14 11:11 UTC by Sam Morris
Modified: 2007-03-15 14:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Screenshot of the passphrase entry window (10.23 KB, image/png)
2006-12-14 09:29 UTC, Sam Morris
  Details
seahorse-head-gpg2.patch (8.83 KB, patch)
2007-02-02 23:25 UTC, Alon Bar-Lev
reviewed Details | Review

Description Sam Morris 2006-11-14 11:10:36 UTC
Distribution: Debian 4.0
Package: seahorse
Severity: Normal
Version: GNOME2.15.91 unspecified
Gnome-Distributor: Debian
Synopsis: Crash when using gpg2
Bugzilla-Product: seahorse
Bugzilla-Component: Daemon
Bugzilla-Version: unspecified
BugBuddy-GnomeVersion: 2.0 (2.16.1)
Description:
Description of the crash:
The deamon crashed when I ran 'gpg2 --clearsign' and entered my
passphrase.


Debugging Information:

Backtrace was generated from '/usr/bin/seahorse-daemon'

(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".




------- Bug created by bug-buddy at 2006-11-14 11:11 -------

Comment 1 André Klapper 2006-11-15 02:04:45 UTC
Thanks for taking the time to report this bug.
Unfortunately, that stack trace is missing some elements that will help a lot to solve the problem, so it will be hard for the developers to fix that crash. Can you get us a stack trace with debugging symbols? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Comment 2 Sam Morris 2006-11-15 02:06:38 UTC
That's all the info I can coax from gdb, unfortunately. Sometimes it just doesn't want to generate a back trace, and I can't find any information about what to do in such a case. :(
Comment 3 André Klapper 2006-12-14 02:54:33 UTC
hmm... is this reproducible, at least? :-)
Comment 4 Sam Morris 2006-12-14 08:17:26 UTC
Yes. Also I think I know why there is no back trace. My user doesn't have permission to ptrace the seahorse-daemon process because the executable is owned by root and is has the setuid bit set.

I'll try to get a proper backtrace and post it here.
Comment 5 Sam Morris 2006-12-14 09:27:47 UTC
** ERROR **: file seahorse-agent-prompt.c: line 125 (prompt_done_dialog): assertion failed: (pass)
aborting...

Program received signal SIGABRT, Aborted.

Thread 16384 (LWP 8027)

  • #0 kill
    at ../string/bits/string2.h line 998
  • #1 pthread_kill
    at signals.c line 69
  • #2 __pthread_raise
    at signals.c line 200
  • #3 *__GI_raise
    at ../linuxthreads/sysdeps/unix/sysv/linux/raise.c line 38
  • #4 *__GI_abort
    at ../sysdeps/generic/abort.c line 88
  • #5 IA__g_logv
  • #6 IA__g_log
  • #7 IA__g_assert_warning
    at gmessages.c line 552
  • #8 prompt_done_dialog
    at seahorse-agent-prompt.c line 125
  • #9 passphrase_response
    at seahorse-agent-prompt.c line 141
  • #10 IA__g_cclosure_marshal_VOID__INT
    at gmarshal.c line 216
  • #11 IA__g_closure_invoke
    at gclosure.c line 490
  • #12 signal_emit_unlocked_R
    at gsignal.c line 2440
  • #13 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #14 IA__g_signal_emit
    at gsignal.c line 2243
  • #15 IA__gtk_dialog_response
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkdialog.c line 835
  • #16 enter_callback
    at seahorse-passphrase.c line 125
  • #17 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #18 IA__g_closure_invoke
    at gclosure.c line 490
  • #19 signal_emit_unlocked_R
    at gsignal.c line 2440
  • #20 IA__g_signal_emitv
    at gsignal.c line 2111
  • #21 gtk_binding_entry_activate
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkbindings.c line 535
  • #22 binding_match_activate
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkbindings.c line 955
  • #23 gtk_bindings_activate_list
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkbindings.c line 1089
  • #24 IA__gtk_bindings_activate_event
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkbindings.c line 1166
  • #25 gtk_widget_real_key_press_event
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkwidget.c line 3655
  • #26 seahorse_secure_entry_key_press
    at seahorse-secure-entry.c line 968
  • #27 _gtk_marshal_BOOLEAN__BOXED
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkmarshalers.c line 84
  • #28 g_type_class_meta_marshal
    at gclosure.c line 567
  • #29 IA__g_closure_invoke
    at gclosure.c line 490
  • #30 signal_emit_unlocked_R
    at gsignal.c line 2478
  • #31 IA__g_signal_emit_valist
    at gsignal.c line 2209
  • #32 IA__g_signal_emit
    at gsignal.c line 2243
  • #33 gtk_widget_event_internal
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkwidget.c line 3911
  • #34 IA__gtk_window_propagate_key_event
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkwindow.c line 4671
  • #35 gtk_window_key_press_event
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkwindow.c line 4701
  • #36 _gtk_marshal_BOOLEAN__BOXED
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkmarshalers.c line 84
  • #37 g_type_class_meta_marshal
    at gclosure.c line 567
  • #38 IA__g_closure_invoke
    at gclosure.c line 490
  • #39 signal_emit_unlocked_R
    at gsignal.c line 2478
  • #40 IA__g_signal_emit_valist
    at gsignal.c line 2209
  • #41 IA__g_signal_emit
    at gsignal.c line 2243
  • #42 gtk_widget_event_internal
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkwidget.c line 3911
  • #43 IA__gtk_propagate_event
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkmain.c line 2162
  • #44 IA__gtk_main_do_event
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkmain.c line 1422
  • #45 gdk_event_dispatch
    at /tmp/buildd/gtk+2.0-2.10.6/gdk/x11/gdkevents-x11.c line 2320
  • #46 IA__g_main_context_dispatch
    at gmain.c line 2045
  • #47 g_main_context_iterate
    at gmain.c line 2677
  • #48 IA__g_main_loop_run
    at gmain.c line 2881
  • #49 IA__gtk_main
    at /tmp/buildd/gtk+2.0-2.10.6/gtk/gtkmain.c line 1001
  • #50 main
    at seahorse-daemon.c line 275

Comment 6 Sam Morris 2006-12-14 09:29:04 UTC
Created attachment 78347 [details]
Screenshot of the passphrase entry window

The passphrase entry window is also screwed up... here's what it looks like.
Comment 7 André Klapper 2006-12-14 10:12:21 UTC
great, thanks a lot for your further investigating!
stacktrace looks good, confirming.
Comment 8 Sam Morris 2006-12-14 10:43:53 UTC
Bug buddy's failure to handle errors from GDB is something to bear in mind for future bug submissions I think. At least, bug-buddy should display errors from gdb... I filed this as bug #385798.
Comment 9 Islam Amer 2007-01-23 13:22:04 UTC
I am also seeing this issue when trying to use gpg2 to sign my email in evolution. I am starting seahorse-agent as described on live.gnome.org by adding it to an xinitrc.d file and chaining the startup commands. This is on gentoo. ssh-agent functionality is working great.

gpg-agent functionality however is not working and I have to kill seahorse-agent to be able to sign and send my email.

seahorse version is 0.9.10
gnupg version is 2.0.1
gpgme version is 1.1.2
Is there any information needed to get this fixed ? Thank you.
Comment 10 Alon Bar-Lev 2007-02-02 07:53:12 UTC
Hello,

Can you please try the patch attached to:
http://bugs.gentoo.org/show_bug.cgi?id=164523

It should solves the issue using gnupg-2, the protocol was changed a little, but since I don't use seahorse, I could not confirm it.

Thanks!
Comment 11 Adam Schreiber 2007-02-02 18:42:31 UTC
At face value your patch looks reasonable, but if you have the time could you update it to apply against SVN HEAD?  If not, let me know and I'll attempt to update it.
Comment 12 Alon Bar-Lev 2007-02-02 23:25:38 UTC
Created attachment 81796 [details] [review]
seahorse-head-gpg2.patch

Against head.
Please also add a notice that gpg2 cannot be used without the --variables option, since gpg2 does not support gpg-agent-options anymore.
Comment 13 Adam Schreiber 2007-02-03 21:54:16 UTC
*** Bug 404081 has been marked as a duplicate of this bug. ***
Comment 14 Gilles Dartiguelongue 2007-02-03 22:56:10 UTC
Sorry for the duplicate, I tend to skip bugs beginning with "crash" since bugbuddy is so easy to use to report bugs :)

At first sight, this patch is a bit more complete than the one I had, and the patches I provided where written by Alon IIRC :) I'll try to apply them to my overlay and see what happens.

Comment 15 Islam Amer 2007-02-04 05:21:39 UTC
I tried the patch against seahorse-0.9.10 and the problem is fixed.

Now when I send a signed email in evolution, it pops up the passphrase dialog, with the correct information. I type the passphrase, and it sends the email.

I will now upgrade to gpg-2.0.2 ( gentoo ) and see if things are still fixed.
Comment 16 Adam Schreiber 2007-02-04 14:50:44 UTC
I've tried out the patch with still using gpg-1.4.6 and everything seems to work properly.

Islam, if you find everything working with gpg-2.0.2 I'll commit the patch.
Comment 17 Stef Walter 2007-02-06 03:22:00 UTC
Do you mind if I take a look before it goes in?

Specifically, I'm wondering if in the long term it would be more beneficial to make decisions on 1.x vs. 2.x behavior at compile time rather than at run time.

The compile time option has the benefit of producing simpler code. Although I guess that claim would depend on how many differences there is between GPG 1.x and 2.x ...

It would allow us to account for things like Alon Bar-Lev points out in comment #12
Comment 18 Adam Schreiber 2007-02-06 04:05:44 UTC
Go right ahead.  I'm still not experiencing any problems with gpg 1.4.6.
Comment 19 Alon Bar-Lev 2007-02-06 07:15:00 UTC
(In reply to comment #17)
> The compile time option has the benefit of producing simpler code. Although I
> guess that claim would depend on how many differences there is between GPG 1.x
> and 2.x ...

But what happens when user upgrades gpg?
Almost sure he open a bug first before he realize he need to recompile your product.
Runtime detection for none cupled components are the best way to go.
And if you like compile time options, you should also verify that you work with correct component at runtime anyway.
Comment 20 Stef Walter 2007-02-07 03:44:49 UTC
Yes. I agree. 

After looking into the issue further, the GnuPG guys seem to make efforts (if not guarantees) that the GPG 1.x and GPG 2.x are compatible in most ways. I think that most incompatibilities will have been due to us not handling things exactly in the same way as GPG (any version) expects them. 

Alon, as far as your patch I just have one change to you ask after which I'll include it in seahorse:

This code assumes a fixed order of options and arguments:

   split_arguments (args, &tmp, &tmp, &id, &errmsg, &prompt, &description, NULL);

That order won't always be the case as both the '--data' and '--check' options may or may not be present according to the protocol. A better way would be to have split_arguments accept a flag which when set would skip any options beginning in '--'.

Comment 21 Alon Bar-Lev 2007-02-07 07:24:13 UTC
Yes. I thought I will bring it up after someone say it works...
Since you manipulate the input string, I implemented this hack.
I thought maybe I should pass strstr (args, "--") instead of args, and have only one tmp.

The problem is that the agent as-is will not work with gpgsm... So you should review gpg2 anyway, and probably change the behavior.

I am not using your product... But reviewing what users said... They like your GUI... So I am thinking of an implementation of a bridge between gpg and gpg-agent "listening" important events and update the GUI, without actually implementing any agent functionality.
Comment 22 Stef Walter 2007-02-08 17:07:27 UTC
Certainly. The idea is to use gpg-agent to do the actual work eventually. 
Comment 23 Stef Walter 2007-02-08 21:34:07 UTC
Committed a modified version of the patch, which is more resilient when it comes to flags passed from GPG2. 

2007-02-08  Nate Nielsen  <nielsen@memberwebs.com>

    * configure.in
    * agent/seahorse-agent-actions.c:
    * agent/seahorse-agent-io.c:
    * agent/seahorse-agent.h:
    * libseahorse/seahorse-gpg-options.c: Fixes for agent interoperability
    with GPG2. Patch from Alon Bar-Lev. Fixes bug #375062

I don't have GPG2 installed (due to library conflicts with version 1.4). Could you verify that this still fixes the bug? Thanks.
Comment 24 Alon Bar-Lev 2007-03-15 10:46:46 UTC
(In reply to comment #23)
> I don't have GPG2 installed (due to library conflicts with version 1.4). Could
> you verify that this still fixes the bug? Thanks.

Hello,
Just reviewed version 1.0.
Any reason why the configure.in 
accepted_versions="1.2 1.4"
And not:
accepted_versions="1.2 1.4 2.0"
As it is working now with 2.0.

Thanks!
Comment 25 Adam Schreiber 2007-03-15 14:04:39 UTC
Because it wasn't working for everyone(bug #410324).  To try and end this confusion, I built  gpg-2.0.3 and removed my install of gpg-1.4.6.  So far everything appears to be working correctly.  

Note: I'm using seahorse-agent properly chained into my session startup.
Comment 26 Alon Bar-Lev 2007-03-15 14:13:16 UTC
Thanks!
It is working correctly as far as I can see.

The only issue is to check for gpg2 if gpg cannot be found.
Or best add --with-gpg= or something.

Can you please explain "session startup" as I am not gnome user and we have some issue with people don't know where to setup the environment at:
http://bugs.gentoo.org/show_bug.cgi?id=164523

There must be a way in gnome to enable them to set session wide environment variable.
Comment 27 Adam Schreiber 2007-03-15 14:20:23 UTC
The correct way to integrate with the session is documented at:
http://live.gnome.org/Seahorse/SessionIntegration
Comment 28 Alon Bar-Lev 2007-03-15 14:30:18 UTC
Thanks!

Which method are you using?

It seems this one is the simplest.

.gnomerc::eval `seahorse-agent --variables`

Comment 29 Adam Schreiber 2007-03-15 14:42:58 UTC
I'm using the version shown for Slackware.