GNU bug report logs - #2412
spurious "Sign failed" errors

Previous Next

Package: emacs;

Reported by: Sven Joachim <svenjoac <at> gmx.de>

Date: Fri, 20 Feb 2009 18:10:07 UTC

Severity: normal

Merged with 3953

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 2412 in the body.
You can then email your comments to 2412 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2412; Package emacs. (Fri, 20 Feb 2009 18:10:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac <at> gmx.de>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 20 Feb 2009 18:10:08 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Sven Joachim <svenjoac <at> gmx.de>
To: undisclosed-recipients:;
Subject: spurious "Sign failed" errors
Date: Fri, 20 Feb 2009 19:03:44 +0100 (MET)
[Message part 1 (text/plain, inline)]
Gnus v5.13
GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-11-30 on turtle, modified by Debian
200 news.motzarella.org InterNetNews NNRP server INN 2.4.5 ready (posting ok).

I'm experiencing painful, but not always reproducible problems with
sending or previewing signed mails.  Often I get an error "Sign failed"
and a backtrace like this:

,----
| Debugger entered--Lisp error: (error "Sign failed")
|   signal(error ("Sign failed"))
|   byte-code("<snipped>" [mml2015-epg-secret-key-id-list error password-cache-remove signal] 4)
|   mml2015-epg-sign((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
|   mml2015-sign((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
|   mml-pgpmime-sign-buffer((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
|   mml-generate-mime-1((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
|   mml-generate-mime()
|   message-encode-message-body()
|   mml-to-mime()
|   mml-preview(nil)
|   call-interactively(mml-preview nil nil)
`----

If this happens during sending, the message actually is signed and sent,
but no copy lands in my archive folder. :-(

I'm using gpg-agent with pinentry-gtk2 for the passphrase.


[Message part 2 (application/emacs-lisp, inline)]

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2412; Package emacs. (Sat, 21 Feb 2009 17:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 21 Feb 2009 17:30:03 GMT) Full text and rfc822 format available.

Message #10 received at 2412 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Daiki Ueno <ueno <at> unixuser.org>
Cc: 2412 <at> debbugs.gnu.org, Sven Joachim <svenjoac <at> gmx.de>
Subject: Re: spurious "Sign failed" errors
Date: Sat, 21 Feb 2009 12:25:46 -0500
Hi Daiki,

This may be a bug in epg, could you take a look?  This is Bug#2412 in
the Emacs bug tracker.  Thanks.


Sven Joachim <svenjoac <at> gmx.de> wrote:

> Gnus v5.13
> GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11)
>  of 2008-11-30 on turtle, modified by Debian
> 200 news.motzarella.org InterNetNews NNRP server INN 2.4.5 ready
> (posting ok).

> I'm experiencing painful, but not always reproducible problems with
> sending or previewing signed mails.  Often I get an error "Sign failed"
> and a backtrace like this:

> ,----
> | Debugger entered--Lisp error: (error "Sign failed")
> |   signal(error ("Sign failed"))
> |   byte-code("<snipped>" [mml2015-epg-secret-key-id-list error password-cache-remove signal] 4)
> |   mml2015-epg-sign((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
> |   mml2015-sign((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
> |   mml-pgpmime-sign-buffer((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
> |   mml-generate-mime-1((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))
> |   mml-generate-mime()
> |   message-encode-message-body()
> |   mml-to-mime()
> |   mml-preview(nil)
> |   call-interactively(mml-preview nil nil)
> `----
>
> If this happens during sending, the message actually is signed and sent,
> but no copy lands in my archive folder. :-(
>
> I'm using gpg-agent with pinentry-gtk2 for the passphrase.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2412; Package emacs. (Sat, 21 Feb 2009 20:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daiki Ueno <ueno <at> unixuser.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 21 Feb 2009 20:45:03 GMT) Full text and rfc822 format available.

Message #15 received at 2412 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Daiki Ueno <ueno <at> unixuser.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 2412 <at> debbugs.gnu.org, Sven Joachim <svenjoac <at> gmx.de>
Subject: Re: bug#2412: spurious "Sign failed" errors
Date: Sun, 22 Feb 2009 05:40:18 +0900
Chong Yidong <cyd <at> stupidchicken.com> writes:

> Hi Daiki,
>
> This may be a bug in epg, could you take a look?  This is Bug#2412 in
> the Emacs bug tracker.  Thanks.

Thanks for noticing this.

> Sven Joachim <svenjoac <at> gmx.de> wrote:
>> | Debugger entered--Lisp error: (error "Sign failed")
>> |   signal(error ("Sign failed"))
>> |   byte-code("<snipped>" [mml2015-epg-secret-key-id-list error password-cache-remove signal] 4)
>> |   mml2015-epg-sign((part (sign . "pgpmime") (tag-location . 186) (contents . "Nur ein Test.\n")))

It looks like epg is signalling the error.

Sven, could you please try (setq epg-debug t) and show me the contents
of " *epg-debug*" buffer next time you see the error?

Regards,
-- 
Daiki Ueno




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2412; Package emacs. (Thu, 16 Apr 2009 04:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 16 Apr 2009 04:30:04 GMT) Full text and rfc822 format available.

Message #20 received at 2412 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Sven Joachim <svenjoac <at> gmx.de>
Cc: 2412 <at> debbugs.gnu.org
Subject: Re: spurious "Sign failed" errors
Date: Thu, 16 Apr 2009 00:27:29 -0400
Hi Sven,

Are you still experiencing these problems?  If so, please do as Daiki
requested:

> could you please try (setq epg-debug t) and show me the contents of
> " *epg-debug*" buffer next time you see the error?




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2412; Package emacs. (Thu, 16 Apr 2009 19:05:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac <at> gmx.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 16 Apr 2009 19:05:05 GMT) Full text and rfc822 format available.

Message #25 received at 2412 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Sven Joachim <svenjoac <at> gmx.de>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 2412 <at> debbugs.gnu.org, Daiki Ueno <ueno <at> unixuser.org>
Subject: Re: spurious "Sign failed" errors
Date: Thu, 16 Apr 2009 20:56:50 +0200
On 2009-04-16 06:27 +0200, Chong Yidong wrote:

> Hi Sven,
>
> Are you still experiencing these problems?

Sorry for not replying sooner.  Yes, they still persist. :-(

>  If so, please do as Daiki requested:
>
>> could you please try (setq epg-debug t) and show me the contents of
>> " *epg-debug*" buffer next time you see the error?

Looks innocent enough to me:

,----
| gpg --no-tty --status-fd 1 --yes --use-agent --command-fd 0 --armor --textmode --output /tmp/epg-output2077H-b --detach-sign
| [GNUPG:] USERID_HINT ECB679C787E9AABE Sven Joachim (Debian User) <svenjoac <at> gmx.de>
| [GNUPG:] NEED_PASSPHRASE ECB679C787E9AABE ECB679C787E9AABE 17 0
| [GNUPG:] GOOD_PASSPHRASE
| [GNUPG:] BEGIN_SIGNING
| [GNUPG:] SIG_CREATED D 17 2 01 1239906974 9AACBC0C69283380715D3788ECB679C787E9AABE
| gpg --no-tty --status-fd 1 --yes --use-agent --command-fd 0 --armor --textmode --output /tmp/epg-output2077UIi --detach-sign
| [GNUPG:] USERID_HINT ECB679C787E9AABE Sven Joachim (Debian User) <svenjoac <at> gmx.de>
| [GNUPG:] NEED_PASSPHRASE ECB679C787E9AABE ECB679C787E9AABE 17 0
| [GNUPG:] GOOD_PASSPHRASE
| [GNUPG:] BEGIN_SIGNING
| [GNUPG:] SIG_CREATED D 17 2 01 1239906984 9AACBC0C69283380715D3788ECB679C787E9AABE
`----

IIRC, the first try did show the preview of the test mail, the second
one gave the "Sign failed" error.

Sven




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2412; Package emacs. (Sun, 03 May 2009 05:50:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daiki Ueno <ueno <at> unixuser.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 03 May 2009 05:50:04 GMT) Full text and rfc822 format available.

Message #30 received at 2412 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Daiki Ueno <ueno <at> unixuser.org>
To: Sven Joachim <svenjoac <at> gmx.de>
Cc: 2412 <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>
Subject: Re: bug#2412: spurious "Sign failed" errors
Date: Sun, 03 May 2009 14:43:42 +0900
[Message part 1 (text/plain, inline)]
Hi,

Sven Joachim <svenjoac <at> gmx.de> writes:

>>> could you please try (setq epg-debug t) and show me the contents of
>>> " *epg-debug*" buffer next time you see the error?

> Looks innocent enough to me:

> | [GNUPG:] SIG_CREATED D 17 2 01 1239906974 9AACBC0C69283380715D3788ECB679C787E9AABE
> | [GNUPG:] SIG_CREATED D 17 2 01 1239906984 9AACBC0C69283380715D3788ECB679C787E9AABE

Thanks.  It looks innocent for me too, but now I can suspect a timing
problem.  Could you please try the patch attached below?

[epg.el.diff (text/x-diff, inline)]
diff --git a/lisp/epg.el b/lisp/epg.el
index e96258f..3c80ef9 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -1175,7 +1175,8 @@ This function is for internal use only."
 (defun epg-wait-for-completion (context)
   "Wait until the `epg-gpg-program' process completes."
   (while (eq (process-status (epg-context-process context)) 'run)
-    (accept-process-output (epg-context-process context) 1)))
+    (accept-process-output (epg-context-process context) 1))
+  (sleep-for 0.1))
 
 (defun epg-reset (context)
   "Reset the CONTEXT."
[Message part 3 (text/plain, inline)]
Regards,
-- 
Daiki Ueno

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2412; Package emacs. (Sun, 03 May 2009 10:40:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac <at> gmx.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 03 May 2009 10:40:08 GMT) Full text and rfc822 format available.

Message #35 received at 2412 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Sven Joachim <svenjoac <at> gmx.de>
To: Daiki Ueno <ueno <at> unixuser.org>
Cc: 2412 <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>
Subject: Re: bug#2412: spurious "Sign failed" errors
Date: Sun, 03 May 2009 12:33:30 +0200
On 2009-05-03 07:43 +0200, Daiki Ueno wrote:

> Sven Joachim <svenjoac <at> gmx.de> writes:
>
>>>> could you please try (setq epg-debug t) and show me the contents of
>>>> " *epg-debug*" buffer next time you see the error?
>
>> Looks innocent enough to me:
>
>> | [GNUPG:] SIG_CREATED D 17 2 01 1239906974 9AACBC0C69283380715D3788ECB679C787E9AABE
>> | [GNUPG:] SIG_CREATED D 17 2 01 1239906984 9AACBC0C69283380715D3788ECB679C787E9AABE
>
> Thanks.  It looks innocent for me too, but now I can suspect a timing
> problem.  Could you please try the patch attached below?
>
>
> diff --git a/lisp/epg.el b/lisp/epg.el
> index e96258f..3c80ef9 100644
> --- a/lisp/epg.el
> +++ b/lisp/epg.el
> @@ -1175,7 +1175,8 @@ This function is for internal use only."
>  (defun epg-wait-for-completion (context)
>    "Wait until the `epg-gpg-program' process completes."
>    (while (eq (process-status (epg-context-process context)) 'run)
> -    (accept-process-output (epg-context-process context) 1)))
> +    (accept-process-output (epg-context-process context) 1))
> +  (sleep-for 0.1))
>  
>  (defun epg-reset (context)
>    "Reset the CONTEXT."

That seems to do the trick.  At least, I had no problem in ~15 attempts
to preview/send signed messages, whereas without your patch the "Sign
failed" error would happen about every second time.

Cheers,
       Sven




Reply sent to Daiki Ueno <ueno <at> unixuser.org>:
You have taken responsibility. (Sun, 03 May 2009 22:45:04 GMT) Full text and rfc822 format available.

Notification sent to Sven Joachim <svenjoac <at> gmx.de>:
bug acknowledged by developer. (Sun, 03 May 2009 22:45:05 GMT) Full text and rfc822 format available.

Message #40 received at 2412-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Daiki Ueno <ueno <at> unixuser.org>
To: Sven Joachim <svenjoac <at> gmx.de>
Cc: 2412-done <at> debbugs.gnu.org, Chong Yidong <cyd <at> stupidchicken.com>
Subject: Re: bug#2412: spurious "Sign failed" errors
Date: Mon, 04 May 2009 07:36:48 +0900
Sven Joachim <svenjoac <at> gmx.de> writes:

>> -    (accept-process-output (epg-context-process context) 1)))
>> +    (accept-process-output (epg-context-process context) 1))
>> +  (sleep-for 0.1))
>
> That seems to do the trick.  At least, I had no problem in ~15 attempts
> to preview/send signed messages, whereas without your patch the "Sign
> failed" error would happen about every second time.

Thanks for testing.  I've checked in the patch.

Regards,
-- 
Daiki Ueno




Message #41 received at 2412-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Daiki Ueno <ueno <at> unixuser.org>
Cc: Sven Joachim <svenjoac <at> gmx.de>, 2412-done <at> debbugs.gnu.org
Subject: Re: bug#2412: spurious "Sign failed" errors
Date: Sun, 03 May 2009 21:02:58 -0400
Daiki Ueno <ueno <at> unixuser.org> writes:

> Thanks for testing.  I've checked in the patch.

Please add a prominent comment about why this change was done.  Future
changes to accept-process-output may make it unnecessary.  Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Mon, 01 Jun 2009 14:24:10 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Daiki Ueno <ueno <at> unixuser.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 28 Jul 2009 11:25:06 GMT) Full text and rfc822 format available.

bug reopened, originator not changed. Request was from Daiki Ueno <ueno <at> unixuser.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 28 Jul 2009 11:25:06 GMT) Full text and rfc822 format available.

Merged 2412 3953. Request was from Daiki Ueno <ueno <at> unixuser.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 28 Jul 2009 11:25:06 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to Sven Joachim <svenjoac <at> gmx.de> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Tue, 11 Aug 2009 04:55:06 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Wed, 26 Aug 2009 12:00:06 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to Sven Joachim <svenjoac <at> gmx.de> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Sat, 07 Nov 2009 18:45:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Sun, 06 Dec 2009 15:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.