Subject: bug#19860: Acknowledgement (25.0.50; One url-retrieve-synchronously call running concurrently with another can freeze it)

From: Dmitry Gutov <[email-masked]>
Date: Mon, 16 Feb 2015 00:19:23 +0200

With debug-on-quit, pressing C-g during the wait yields:

Debugger entered--Lisp error: (quit)
   (condition-case nil (let ((inhibit-quit nil)) (accept-process-output 
proc)) (quit (setq quit-flag t) (eval (quote (ignore nil)))))
   (or (condition-case nil (let ((inhibit-quit nil)) 
(accept-process-output proc)) (quit (setq quit-flag t) (eval (quote 
(ignore nil))))) (null proc))
   (if (or (condition-case nil (let ((inhibit-quit nil)) 
(accept-process-output proc)) (quit (setq quit-flag t) (eval (quote 
(ignore nil))))) (null proc)) nil (if quit-flag (progn (delete-process 
proc))) (setq proc (and (not quit-flag) (get-buffer-process 
asynch-buffer))))
   (if (buffer-local-value (quote url-redirect-buffer) asynch-buffer) 
(setq proc (get-buffer-process (setq asynch-buffer (buffer-local-value 
(quote url-redirect-buffer) asynch-buffer)))) (if (and proc (memq 
(process-status proc) (quote (closed exit signal failed))) (eq proc (or 
(get-buffer-process asynch-buffer) proc))) (progn (delete-process proc) 
(setq retrieval-done t))) (if (or (condition-case nil (let 
((inhibit-quit nil)) (accept-process-output proc)) (quit (setq quit-flag 
t) (eval (quote (ignore nil))))) (null proc)) nil (if quit-flag (progn 
(delete-process proc))) (setq proc (and (not quit-flag) 
(get-buffer-process asynch-buffer)))))
   (while (not retrieval-done) (url-debug (quote retrieval) "Spinning in 
url-retrieve-synchronously: %S (%S)" retrieval-done asynch-buffer) (if 
(buffer-local-value (quote url-redirect-buffer) asynch-buffer) (setq 
proc (get-buffer-process (setq asynch-buffer (buffer-local-value (quote 
url-redirect-buffer) asynch-buffer)))) (if (and proc (memq 
(process-status proc) (quote (closed exit signal failed))) (eq proc (or 
(get-buffer-process asynch-buffer) proc))) (progn (delete-process proc) 
(setq retrieval-done t))) (if (or (condition-case nil (let 
((inhibit-quit nil)) (accept-process-output proc)) (quit (setq quit-flag 
t) (eval (quote ...)))) (null proc)) nil (if quit-flag (progn 
(delete-process proc))) (setq proc (and (not quit-flag) 
(get-buffer-process asynch-buffer))))))
   (let ((proc (get-buffer-process asynch-buffer))) (while (not 
retrieval-done) (url-debug (quote retrieval) "Spinning in 
url-retrieve-synchronously: %S (%S)" retrieval-done asynch-buffer) (if 
(buffer-local-value (quote url-redirect-buffer) asynch-buffer) (setq 
proc (get-buffer-process (setq asynch-buffer (buffer-local-value (quote 
url-redirect-buffer) asynch-buffer)))) (if (and proc (memq 
(process-status proc) (quote (closed exit signal failed))) (eq proc (or 
(get-buffer-process asynch-buffer) proc))) (progn (delete-process proc) 
(setq retrieval-done t))) (if (or (condition-case nil (let (...) 
(accept-process-output proc)) (quit (setq quit-flag t) (eval ...))) 
(null proc)) nil (if quit-flag (progn (delete-process proc))) (setq proc 
(and (not quit-flag) (get-buffer-process asynch-buffer)))))))
   (if (null asynch-buffer) nil (let ((proc (get-buffer-process 
asynch-buffer))) (while (not retrieval-done) (url-debug (quote 
retrieval) "Spinning in url-retrieve-synchronously: %S (%S)" 
retrieval-done asynch-buffer) (if (buffer-local-value (quote 
url-redirect-buffer) asynch-buffer) (setq proc (get-buffer-process (setq 
asynch-buffer (buffer-local-value ... asynch-buffer)))) (if (and proc 
(memq (process-status proc) (quote ...)) (eq proc (or ... proc))) (progn 
(delete-process proc) (setq retrieval-done t))) (if (or (condition-case 
nil (let ... ...) (quit ... ...)) (null proc)) nil (if quit-flag (progn 
(delete-process proc))) (setq proc (and (not quit-flag) 
(get-buffer-process asynch-buffer))))))) asynch-buffer)
   (let ((retrieval-done nil) (asynch-buffer nil)) (setq asynch-buffer 
(url-retrieve url (function (lambda (&rest ignored) (url-debug (quote 
retrieval) "Synchronous fetching done (%S)" (current-buffer)) (setq 
retrieval-done t asynch-buffer (current-buffer)))) nil silent 
inhibit-cookies)) (if (null asynch-buffer) nil (let ((proc 
(get-buffer-process asynch-buffer))) (while (not retrieval-done) 
(url-debug (quote retrieval) "Spinning in url-retrieve-synchronously: %S 
(%S)" retrieval-done asynch-buffer) (if (buffer-local-value (quote 
url-redirect-buffer) asynch-buffer) (setq proc (get-buffer-process (setq 
asynch-buffer ...))) (if (and proc (memq ... ...) (eq proc ...)) (progn 
(delete-process proc) (setq retrieval-done t))) (if (or (condition-case 
nil ... ...) (null proc)) nil (if quit-flag (progn ...)) (setq proc (and 
... ...)))))) asynch-buffer))
   url-retrieve-synchronously("http://xip.io")
   long-outer-op()
   long-ops-now()