[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnutls infloop possibly fixed
From: |
Ted Zlatanov |
Subject: |
Re: gnutls infloop possibly fixed |
Date: |
Sat, 11 Feb 2012 21:48:08 -0500 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) |
On Sat, 11 Feb 2012 18:10:23 +0100 Lars Ingebrigtsen <address@hidden> wrote:
LI> I finally took a hard look at the GnuTLS-related Emacs hangs. It turned
LI> out to be pretty easy to reproduce for me. If I switch off the wifi on
LI> this laptop and then presses `g' in Gnus, Emacs would reliably use 100%
LI> CPU, and `C-g' or anything wouldn't work. So a totally dead Emacs.
LI> I chased this down to emacs_gnutls_write, which would just, well,
LI> infloop if libgnutls returned EAGAIN. I've now removed that, and just
LI> leaves the normal Emacs process loop to retry if we get an EAGAIN.
LI> This seems to work for me -- `C-g' reliably works for me if I drop the
LI> network, or I get a new IP address.
LI> There may be other side-effects, though. Slower throughput? I don't
LI> know. Please give it a whirl and report back whether things stop
LI> working or not.
Thanks! I have just one question: can we, instead of aborting on
EAGAIN, retry a few times? My suggestion is below. Maybe we could wait
a millisecond, too. Or is all that handled at the Emacs process loop
level?
Thanks
Ted
=== modified file 'src/gnutls.c'
--- src/gnutls.c 2012-02-11 17:06:14 +0000
+++ src/gnutls.c 2012-02-12 02:46:24 +0000
@@ -341,6 +341,7 @@
EMACS_INT
emacs_gnutls_write (struct Lisp_Process *proc, const char *buf, EMACS_INT
nbyte)
{
+ int retries = 10;
ssize_t rtnval = 0;
EMACS_INT bytes_written;
gnutls_session_t state = proc->gnutls_state;
@@ -365,6 +366,8 @@
{
if (rtnval == GNUTLS_E_INTERRUPTED)
continue;
+ if (rtnval == GNUTLS_E_AGAIN && retries-- > 0)
+ continue;
else
break;
}
- gnutls infloop possibly fixed, Lars Ingebrigtsen, 2012/02/11
- Re: gnutls infloop possibly fixed,
Ted Zlatanov <=
- Re: gnutls infloop possibly fixed, Lars Ingebrigtsen, 2012/02/12
- Re: gnutls infloop possibly fixed, Ted Zlatanov, 2012/02/12
- Re: gnutls infloop possibly fixed, Tom Tromey, 2012/02/13
- Re: gnutls infloop possibly fixed, Lars Ingebrigtsen, 2012/02/13
- Re: gnutls infloop possibly fixed, Lars Ingebrigtsen, 2012/02/13
- Re: gnutls infloop possibly fixed, Andreas Schwab, 2012/02/13
- Re: gnutls infloop possibly fixed, Lars Ingebrigtsen, 2012/02/13
- Re: gnutls infloop possibly fixed, Richard Stallman, 2012/02/13
- Re: gnutls infloop possibly fixed, Andreas Schwab, 2012/02/13