From unknown Tue Jun 17 20:10:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#486 <486@debbugs.gnu.org> To: bug#486 <486@debbugs.gnu.org> Subject: Status: pgg-gpg.el - pgg-gpg-process-region timing problem Reply-To: bug#486 <486@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:10:38 +0000 retitle 486 pgg-gpg.el - pgg-gpg-process-region timing problem reassign 486 emacs submitter 486 "ken manheimer" severity 486 normal thanks From ken.manheimer@gmail.com Thu Jun 26 09:16:35 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.9 required=4.0 tests=BAYES_00,FOURLA,GMAIL, MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 26 Jun 2008 16:16:35 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5QGGN7v004285 for ; Thu, 26 Jun 2008 09:16:24 -0700 Received: from mx10.gnu.org ([199.232.76.166]:34261) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KBu8r-0008RT-Gq for emacs-pretest-bug@gnu.org; Thu, 26 Jun 2008 12:16:13 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KBu8y-0006t4-Ba for emacs-pretest-bug@gnu.org; Thu, 26 Jun 2008 12:16:22 -0400 Received: from yx-out-1718.google.com ([74.125.44.155]:63838) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KBu8x-0006sh-PI for emacs-pretest-bug@gnu.org; Thu, 26 Jun 2008 12:16:20 -0400 Received: by yx-out-1718.google.com with SMTP id 34so77886yxf.66 for ; Thu, 26 Jun 2008 09:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=w3XZLziRrXQGttEwto6R9vtlBWSK3U5vurCAPa2KnSM=; b=dMdguAGfWRZJgBkQ6YOxp4XeBbuAPvtv0MULS3TchkinFcLdZvstF6NPKWu+vKDx8u qzUv0ZGWnSw59prBBYN17BGMEPjZcknn2HBn3GWtBFbyLHxLNKaA7KNwH0Tl3qNOOLUt HmAxwKEfWq1vhy0QKKhXmKwX9wtyMlRNRqLDM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=vWCMKU11Si/7hFydGBW6wPj0+H4M45Xq6Qg/rtSFDZ1yvVqZTZvhBzG2ZDQWcXfMKV 0YOyI1MfGtG27WE+OVqUQL4xboLLpRhyOWsk4zli8VjnvcwcmTF0vB/aIR5sZYtziHJZ QRPnlfrXa6fpX88WdnaCQiMJQSos5NDY14D3w= Received: by 10.114.56.1 with SMTP id e1mr83896waa.204.1214496977326; Thu, 26 Jun 2008 09:16:17 -0700 (PDT) Received: by 10.114.201.14 with HTTP; Thu, 26 Jun 2008 09:16:17 -0700 (PDT) Message-ID: <2cd46e7f0806260916y39870423ge4bda26f97d6d504@mail.gmail.com> Date: Thu, 26 Jun 2008 12:16:17 -0400 From: "ken manheimer" To: emacs-devel , emacs-pretest-bug@gnu.org, "Thien-Thi Nguyen" , "Stefan Monnier" , "Daiki Ueno" , "Sascha Wilde" Subject: Re: pgg-gpg.el - pgg-gpg-process-region timing problem In-Reply-To: <2cd46e7f0806221037h6d16839bp567eb5b901313375@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3321_25181615.1214496977333" References: <2cd46e7f0806221037h6d16839bp567eb5b901313375@mail.gmail.com> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) ------=_Part_3321_25181615.1214496977333 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline i am not sure how to proceed with this problem. as demonstrated by the pggprob.el script, i consistently get encryption and decryption problems without the contrived delay in my pgg-gpg-process-region patch. (the problem does not happen if i just do a regular pgg-decrypt - i think the crucial thing is that a symmetric passphrase is being passed into pgg-gpg-process-region.) i have tried everything i could think of to exclude local quirks from the problem, including starting emacs with '--no-site-file -q' and eliminating everything from my ~/.gnupg/gpg.conf file. i have reproduced the problem (and workaround) consistently in kubuntu 8.04 emacs-snapshot package and a recent CVS HEAD checkout. in fact, i have incidentally reinstalled my kubuntu 8.04 OS recently, on both my main 2.0 Ghz T43 thinkpad and on a 750 Mhz a20p thinkpad. the problem continues consistently on the t43 but does *not* occur on the a20p, which is not contrary to the sensitivities of a timing problem. i have also tried thien-thi nguyen's alternative approaches, but neither worked for me, hanging in different places. i am pretty sure this is a real problem, and something that warrants attention. i realize that the difficulty in repeating the problem elsewhere increases the challenge in addressing it, and am open to cooperating with people to try things, if that would help. the consistent effectiveness of my workaround should help provide clues about the nature of the problem, at least. any suggestions? -- ken http://myriadicity.net On Sun, Jun 22, 2008 at 1:37 PM, ken manheimer wrote: > allout encryption, which depends on pgg.el &c, has been failing due to > a weird timing problem i've narrowed down to the > pgg-gpg-process-region function. this is in emacs 23.0.60 built from > a CVS HEAD checkout of an hour or so ago, and some earlier 23.0.60 > versions. i've reproduced the problem using emacs -q and regularly > launched emacs, etc. > > the problem is that pgg-gpg-process-region often returns a nil status > despite successful decryption, unless a delay (eg, (sleep-for .3) is > inserted between process start and later interaction with the process. > with the delay, the status is something like 207 or 208, while > without it the status is nil - yet, on examination the content is > sucessfully decrypted. > > the size of the delay needs to be increased when the machine is > heavily loaded, and can be reduced (on my thinkpad t43 2 GHz laptop, > 3Gb ram, running kubuntu 8.0.4 +) to no lower than (sleep-for .2). > rarely, the proper status is returned without the delay, depending on > the machine load and other things i can't identify. considering the > real-time sensitivity of the problem, your mileage will almost > certainly vary! > > i originally thought the problem might be in gpg, but now figure it > resides either in the emacs process mechanism, pgg's use of that, or > somewhere in the combination of emacs and pgg. > > i've created a simple .el script, pggprob.el, with minimal code and > data to produce the problem, and a patch, pggprob-patch.txt, with a > single-line modification to pgg-gpg-process-region to work around the > problem. both are attached. since the workaround is merely a timing > delay, it's clearly not a fix! i'm hoping this is enough to enable > others to reproduce the problem, and investigate... > -- > ken > http://myriadicity.net > > If Emacs crashed, and you have the Emacs process in the gdb debugger, > please include the output from the following gdb commands: > `bt full' and `xbacktrace'. > If you would like to further debug the crash, please read the file > /home/klm/src/emacs-HEAD/etc/DEBUG for instructions. > > In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.12.9) > of 2008-06-22 on twist > Windowing system distributor `The X.Org Foundation', version 11.0.10400090 > Important settings: > value of $LC_ALL: nil > value of $LC_COLLATE: nil > value of $LC_CTYPE: nil > value of $LC_MESSAGES: nil > value of $LC_MONETARY: nil > value of $LC_NUMERIC: nil > value of $LC_TIME: nil > value of $LANG: en_US.UTF-8 > value of $XMODIFIERS: nil > locale-coding-system: utf-8-unix > default-enable-multibyte-characters: t > > Major mode: Emacs-Lisp > > Minor modes in effect: > tooltip-mode: t > tool-bar-mode: t > mouse-wheel-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > global-auto-composition-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > line-number-mode: t > transient-mark-mode: t > > Recent input: > C-x C-f l > i b / e m a a l l s c r p g g p > M-x e v a l - c u r M-. C-g > M-> C-x C-e M-x e m a c s r e p o r t > - e m > > Recent messages: > For information about GNU Emacs and the GNU system, type C-h C-a. > Source file `/home/klm/src/emacs-HEAD/lisp/pgg-gpg.el' newer than > byte-compiled file > Quit > Mark set > nil > -- ken http://myriadicity.net ------=_Part_3321_25181615.1214496977333 Content-Type: application/octet-stream; name=pggprob.el Content-Transfer-Encoding: base64 X-Attachment-Id: f_fhrwgxd60 Content-Disposition: attachment; filename=pggprob.el OzsgZGVtb25zdHJhdGUgdGltaW5nIHByb2JsZW0gaW4gcGdnLWdwZy1wcm9jZXNzLXJlZ2lvbgoK KHNldHEgcGFzc3BocmFzZSAiYSIKICAgICAgdmVyaWZpZXIgIi0tLS0tQkVHSU4gUEdQIE1FU1NB R0UtLS0tLQpWZXJzaW9uOiBHbnVQRyB2MS40LjYgKEdOVS9MaW51eCkKCmpBMEVBd01DbzcyZk5H QjFyTnhneVN2K3J4ZGtQdjQ2blZ4UTVmZzR5VDc4bGRnVmNEc2VEN01yZTRGaGppZm4KVlRBMS9Q ZG1ldFZmRmI5Kwo9TVhGNgotLS0tLUVORCBQR1AgTUVTU0FHRS0tLS0tIgogICAgICBjb3VudCAw KQoKKGRlZnVuIGRlY3J5cHQgKHBhc3NwaHJhc2UgdGV4dCkKICAod2l0aC1jdXJyZW50LWJ1ZmZl ciAoZ2V0LWJ1ZmZlci1jcmVhdGUgIipwZ2ctdGVzdCoiKQogICAgKGVyYXNlLWJ1ZmZlcikKICAg IChpbnNlcnQgdGV4dCkKICAgIChwZ2ctZGVjcnlwdCBuaWwgbmlsIHBhc3NwaHJhc2UpKSkKCjs7 IHRoZSBmb2xsb3dpbmcgeWllbGRzIG5pbCB3L291dCB0aGUgcGF0Y2hlZCBkZWxheSwgMjA4IHdp dGggaXQuCjs7IGV4YW1pbmF0aW9uIG9mIHRoZSBhY3R1YWwgcmVzdWx0cyBidWZmZXIgc2hvd3Mg dGhhdCB0aGUgdmVyaWZpZXIgaXMKOzsgc3VjY2Vzc2Z1bGx5IGRlY3J5cHRlZCBpbiBib3RoIGNh c2VzLCBob3dldmVyLgooZGVjcnlwdCBwYXNzcGhyYXNlIHZlcmlmaWVyKQo= ------=_Part_3321_25181615.1214496977333 Content-Type: text/plain; name=pgg-patch.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fhrwusef2 Content-Disposition: attachment; filename=pgg-patch.txt LS0tIHBnZy1ncGcuZWwufjEuMjcufgkyMDA4LTA1LTA2IDAzOjU3OjQ2LjAwMDAwMDAwMCAtMDQw MAorKysgcGdnLWdwZy5lbAkyMDA4LTA2LTIyIDEzOjI0OjE0LjAwMDAwMDAwMCAtMDQwMApAQCAt ODYsNiArODYsNyBAQAogCSAgICAoc2V0cSBwcm9jZXNzCiAJCSAgKGFwcGx5ICMnc3RhcnQtcHJv Y2VzcyAiKkdudVBHKiIgZXJyb3JzLWJ1ZmZlcgogCQkJIHByb2dyYW0gYXJncykpKQorICAgICAg ICAgIChzbGVlcC1mb3IgLjMpICAgICAgICAgICAgICAgIDsga2xtOiB0aW1pbmcgZGVsYXkKIAkg IChzZXQtcHJvY2Vzcy1zZW50aW5lbCBwcm9jZXNzICMnaWdub3JlKQogCSAgKHdoZW4gcGFzc3Bo cmFzZQogCSAgICAoc2V0cSBwYXNzcGhyYXNlLXdpdGgtbmV3bGluZSAoY29uY2F0IHBhc3NwaHJh c2UgIlxuIikpCg== ------=_Part_3321_25181615.1214496977333-- From rgm@gnu.org Fri Jun 27 17:05:40 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.8 required=4.0 tests=AWL,BAYES_00,ONEWORD, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 28 Jun 2008 00:05:41 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5S05cWK021577 for ; Fri, 27 Jun 2008 17:05:39 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KCNwU-0007Gc-Mf; Fri, 27 Jun 2008 20:05:26 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18533.32838.630845.565243@fencepost.gnu.org> Date: Fri, 27 Jun 2008 20:05:26 -0400 From: Glenn Morris To: control@debbugs.gnu.org Subject: merge X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: red X-Ran: 0l8Y8"+,#K:tVUK4-6)g~|Bq0yDez#"#7T(`&1glAAW`CxxS4PDCnpVNF]uO#]E-9tm'k4 merge 465 469 470 471 472 474 476 486 487 From cyd@stupidchicken.com Sat Aug 2 07:51:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,BAYES_00,FVGT_m_MULTI_ODD, MURPHY_DRUGS_REL8,MURPHY_WRONG_WORD1,MURPHY_WRONG_WORD2,RCVD_IN_PBL, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 486) by emacsbugs.donarmstrong.com; 2 Aug 2008 14:51:32 +0000 Received: from furry (c-24-63-201-57.hsd1.ma.comcast.net [24.63.201.57]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m72EpTMk018731 for <486@emacsbugs.donarmstrong.com>; Sat, 2 Aug 2008 07:51:30 -0700 Received: by furry (Postfix, from userid 1000) id 46933C056; Sat, 2 Aug 2008 10:51:24 -0400 (EDT) From: Chong Yidong To: "ken manheimer" Cc: 486@debbugs.gnu.org Subject: Re: pgg-gpg.el - pgg-gpg-process-region timing problem Date: Sat, 02 Aug 2008 10:51:24 -0400 Message-ID: <87d4krv5ar.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > i am not sure how to proceed with this problem. as demonstrated by > the pggprob.el script, i consistently get encryption and decryption > problems without the contrived delay in my pgg-gpg-process-region > patch. (the problem does not happen if i just do a regular > pgg-decrypt - i think the crucial thing is that a symmetric passphrase > is being passed into pgg-gpg-process-region.) I haven't been able to reproduce this problem, so let me make sure I understand your recipe correctly. First, I create a buffer with the following contents (setq passphrase "a" verifier "-----BEGIN PGP MESSAGE----- Version: GnuPG v1.4.6 (GNU/Linux) jA0EAwMCo72fNGB1rNxgySv+rxdkPv46nVxQ5fg4yT78ldgVcDseD7Mre4Fhjifn VTA1/PdmetVfFb9+ =MXF6 -----END PGP MESSAGE-----" count 0) (defun decrypt (passphrase text) (with-current-buffer (get-buffer-create "*pgg-test*") (erase-buffer) (insert text) (pgg-decrypt nil nil passphrase))) Then, I eval the buffer with M-x eval-buffer. Finally, I do M-: (decrypt passphrase verifier) RET This consistently gives me the message `208' in the echo area. I don't see a nil result, but that's what you see, correct? From unknown Tue Jun 17 20:10:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Aug 2008 14:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator