GNU bug report logs - #16960
24.3.50; Infinite loop in url-retrieve-synchronously if method is POST and response status is 301/302

Previous Next

Package: emacs;

Reported by: Alex Kost <alezost <at> gmail.com>

Date: Fri, 7 Mar 2014 15:26:02 UTC

Severity: normal

Merged with 21017

Found in version 24.3.50

To reply to this bug, email your comments to 16960 AT debbugs.gnu.org.

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#16960; Package emacs. (Fri, 07 Mar 2014 15:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Kost <alezost <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 07 Mar 2014 15:26:02 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 Infinite loop in url-retrieve-synchronously if method is POST and
 response status is 301/302
Date: Fri, 07 Mar 2014 19:25:30 +0400
[Message part 1 (text/plain, inline)]
The problem is the following: when I try to login to
https://aur.archlinux.org with `url-retrieve-synchronously' (see the
code below), Emacs freezes (C-g helps) because callback passed to
`url-retrieve' is never called.

AFAIU this happens because `url-http-parse-headers' returns nil if
response status is 301/302/307 and method is not "HEAD" or "GET" (see
<http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/url/url-http.el#n574>).
At least the problem goes away when I add:

  (setq success t)

after

  (or `moved-permanently `found `temporary-redirect)

in `url-http-parse-headers'.

Would it be OK to allow such requests?

Recipe is simple but you need to have an account on
<https://aur.archlinux.org> for that:

1. emacs -Q
2. Evaluate (setq url-debug t)
3. Evaluate the following code:

[Message part 2 (application/emacs-lisp, inline)]
[Message part 3 (text/plain, inline)]
3. Emacs hangs; press C-g
4. In "*URL-DEBUG*" buffer you can see the line:

  http -> Finished parsing HTTP headers: nil


In GNU Emacs 24.3.50.2 (i686-pc-linux-gnu, GTK+ Version 3.10.6)
 of 2014-02-02 on leviafan
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
Configured using:
 `configure --prefix=/home/alexx/usr'

Merged 16960 21017. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 09 Jul 2015 15:38:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16960; Package emacs. (Fri, 25 Dec 2015 20:37:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alex Kost <alezost <at> gmail.com>
Cc: 16960 <at> debbugs.gnu.org
Subject: Re: bug#16960: 24.3.50;
 Infinite loop in url-retrieve-synchronously if method is POST and
 response status is 301/302
Date: Fri, 25 Dec 2015 21:36:32 +0100
Alex Kost <alezost <at> gmail.com> writes:

> The problem is the following: when I try to login to
> https://aur.archlinux.org with `url-retrieve-synchronously' (see the
> code below), Emacs freezes (C-g helps) because callback passed to
> `url-retrieve' is never called.
>
> AFAIU this happens because `url-http-parse-headers' returns nil if
> response status is 301/302/307 and method is not "HEAD" or "GET" (see
> <http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/url/url-http.el#n574>).
> At least the problem goes away when I add:
>
>   (setq success t)
>
> after
>
>   (or `moved-permanently `found `temporary-redirect)
>
> in `url-http-parse-headers'.
>
> Would it be OK to allow such requests?
>
> Recipe is simple but you need to have an account on
> <https://aur.archlinux.org> for that:

I don't have an account there, so I can't reproduce this bug.  But could
you create a patch that fixes this problem?

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




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

Previous Next


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