GNU bug report logs - #24628
GNUtls initialization adds 500ms to startup --- do we really need it just for the RNG?

Previous Next

Package: emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Thu, 6 Oct 2016 19:46:01 UTC

Severity: normal

Tags: moreinfo

Fixed in version 26.1

Done: Glenn Morris <rgm <at> gnu.org>

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 24628 in the body.
You can then email your comments to 24628 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-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Thu, 06 Oct 2016 19:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Colascione <dancol <at> dancol.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 06 Oct 2016 19:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <dancol <at> dancol.org>
To: bug-gnu-emacs <at> gnu.org
Subject: GNUtls initialization adds 500ms to startup --- do we really need it
 just for the RNG?
Date: Thu, 6 Oct 2016 12:45:23 -0700
On my system, I noticed that the call to emacs_gnutls_global_init is 
adding 500ms to the time it takes to run emacs -Q -nw --batch --eval 
'(kill-emacs)'. We're not actually using GNUtls for anything but an RNG 
seed, and /dev/urandom is also up to the task.

I'm not sure what's making GNUtls so slow, except that it's talking to a 
process called credkit-service, which is using a lot of CPU time. It 
shouldn't matter though.

Can we go back to just using /dev/urandom directly?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Thu, 06 Oct 2016 20:23:01 GMT) Full text and rfc822 format available.

Message #8 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 24628 <at> debbugs.gnu.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Thu, 06 Oct 2016 13:22:15 -0700
[Message part 1 (text/plain, inline)]
>>>>> "DC" == Daniel Colascione <dancol <at> dancol.org> writes:

DC> Can we go back to just using /dev/urandom directly?

I would prefer that too, if it's available.  Eli?

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 07 Oct 2016 06:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: 24628 <at> debbugs.gnu.org, dancol <at> dancol.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Fri, 07 Oct 2016 09:51:28 +0300
> From: John Wiegley <jwiegley <at> gmail.com>
> Date: Thu, 06 Oct 2016 13:22:15 -0700
> Cc: 24628 <at> debbugs.gnu.org
> 
> >>>>> "DC" == Daniel Colascione <dancol <at> dancol.org> writes:
> 
> DC> Can we go back to just using /dev/urandom directly?
> 
> I would prefer that too, if it's available.  Eli?

We've been there before, and not so long ago.  The original code,
written by yours truly, read /dev/urandom directly, see commit
3ffe81e.  Two days later Paul replaced that with GnuTLS calls (commit
05e8148), and I wasn't happy about that, to say the least:

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22202#91

However, my objections were evidently not enough to revert back,
although you agreed with me:

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22202#118

I leave it to you to guess what is my opinion about this ;-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 07 Oct 2016 07:50:02 GMT) Full text and rfc822 format available.

Message #14 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24628 <at> debbugs.gnu.org, dancol <at> dancol.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Fri, 07 Oct 2016 00:49:37 -0700
[Message part 1 (text/plain, inline)]
>>>>> Eli Zaretskii <eliz <at> gnu.org> writes:

> However, my objections were evidently not enough to revert back, although
> you agreed with me:
>   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22202#118

Thanks for the references. Let's revert this change for 25.2 until the stated
problem (entropy exhaustion) becomes a real problem, i.e. reported by a user.

There is no reason to make everyone pay a 1/2 second startup cost for a
theoretical problem, or a code simplification whose benefits are so minor.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 07 Oct 2016 10:46:02 GMT) Full text and rfc822 format available.

Message #17 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 24628 <at> debbugs.gnu.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Fri, 07 Oct 2016 12:43:52 +0200
Daniel Colascione <dancol <at> dancol.org> writes:

> On my system, I noticed that the call to emacs_gnutls_global_init is
> adding 500ms to the time it takes to run emacs -Q -nw --batch --eval
> '(kill-emacs)'. We're not actually using GNUtls for anything but an
> RNG seed, and /dev/urandom is also up to the task.
>
> I'm not sure what's making GNUtls so slow, except that it's talking to
> a process called credkit-service, which is using a lot of CPU time. It
> shouldn't matter though.
>
> Can we go back to just using /dev/urandom directly?

[larsi <at> stories ~]$ time emacs -Q -nw --batch --eval '(kill-emacs)'

real    0m0.021s
user    0m0.008s
sys     0m0.004s

My Emacs (from master) doesn't spend 500ms talking to anything, and it's
built with gnutls support, so the interesting question here is why your
gnutls library is so slow.

You didn't report the bug with `M-x report-emacs-bug', so no information
about your system is available.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 07 Oct 2016 16:02:02 GMT) Full text and rfc822 format available.

Message #20 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: 24628 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Fri, 07 Oct 2016 12:01:11 -0400
On Fri, 07 Oct 2016 00:49:37 -0700 John Wiegley <jwiegley <at> gmail.com> wrote: 

>>>>>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> However, my objections were evidently not enough to revert back, although
>> you agreed with me:
>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22202#118

JW> Thanks for the references. Let's revert this change for 25.2 until the stated
JW> problem (entropy exhaustion) becomes a real problem, i.e. reported by a user.

JW> There is no reason to make everyone pay a 1/2 second startup cost for a
JW> theoretical problem, or a code simplification whose benefits are so minor.

Could it be a compile-time or run-time option? If the problem becomes
practical, it will be good to have a workaround.

Ted




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 07 Oct 2016 16:50:02 GMT) Full text and rfc822 format available.

Message #23 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: John Wiegley <jwiegley <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 24628 <at> debbugs.gnu.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Fri, 07 Oct 2016 09:49:48 -0700
[Message part 1 (text/plain, inline)]
>>>>> Ted Zlatanov <tzz <at> lifelogs.com> writes:

> Could it be a compile-time or run-time option? If the problem becomes
> practical, it will be good to have a workaround.

That's a good idea, Ted.  A compile option, off by default until we determine
that all issues have been resolved.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 07 Oct 2016 20:34:02 GMT) Full text and rfc822 format available.

Message #26 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: 24628 <at> debbugs.gnu.org, dancol <at> dancol.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Fri, 07 Oct 2016 16:32:57 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Is it possible to do the gnutls initialization in parallel with
ordinary Emacs execution?  Probably it would become unnoticeable that
way.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 07 Oct 2016 22:08:01 GMT) Full text and rfc822 format available.

Message #29 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: John Wiegley <jwiegley <at> gmail.com>, 24628 <at> debbugs.gnu.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Sat, 08 Oct 2016 00:04:56 +0200
Richard Stallman <rms <at> gnu.org> writes:

> Is it possible to do the gnutls initialization in parallel with
> ordinary Emacs execution?  Probably it would become unnoticeable that
> way.

The gnutls initialisation should take virtually zero time, and it does
so on most systems.  We have a report of that initialisation taking time
on a single system, and we need to find out why.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 26.1, send any further explanations to 24628 <at> debbugs.gnu.org and Daniel Colascione <dancol <at> dancol.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 30 Oct 2016 18:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24628; Package emacs. (Fri, 18 Nov 2016 08:46:01 GMT) Full text and rfc822 format available.

Message #34 received at 24628 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Wiegley <jwiegley <at> gmail.com>
Cc: 24628 <at> debbugs.gnu.org, dancol <at> dancol.org
Subject: Re: bug#24628: GNUtls initialization adds 500ms to startup --- do we
 really need it just for the RNG?
Date: Fri, 18 Nov 2016 10:45:00 +0200
> From: John Wiegley <jwiegley <at> gmail.com>
> Cc: dancol <at> dancol.org,  24628 <at> debbugs.gnu.org
> Date: Fri, 07 Oct 2016 00:49:37 -0700
> 
> >>>>> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > However, my objections were evidently not enough to revert back, although
> > you agreed with me:
> >   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22202#118
> 
> Thanks for the references. Let's revert this change for 25.2

Finally done by cherry-picking the change from master.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Dec 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 181 days ago.

Previous Next


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