From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 21 16:46:38 2015 Received: (at submit) by debbugs.gnu.org; 21 Mar 2015 20:46:38 +0000 Received: from localhost ([127.0.0.1]:60082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQI1-0008HG-Pg for submit@debbugs.gnu.org; Sat, 21 Mar 2015 16:46:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51085) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQI0-0008H4-7r for submit@debbugs.gnu.org; Sat, 21 Mar 2015 16:46:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZQHt-0003aT-Ot for submit@debbugs.gnu.org; Sat, 21 Mar 2015 16:46:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQHt-0003aN-MX for submit@debbugs.gnu.org; Sat, 21 Mar 2015 16:46:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQHs-0000gf-Qd for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 16:46:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZQHp-0003Yt-KS for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 16:46:28 -0400 Received: from mail.nullprogram.com ([192.241.191.137]:36668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQHp-0003Xm-Hi for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 16:46:25 -0400 Received: from localhost ([127.0.0.1] helo=wellocc1-ld2.jhuapl.edu) by mail.nullprogram.com with esmtp (Exim 4.84) (envelope-from ) id 1YZQHi-0008GV-Le; Sat, 21 Mar 2015 16:46:18 -0400 From: Christopher Wellons To: bug-gnu-emacs@gnu.org Subject: 24.4; url-retrieve invokes same callback twice with kill-buffer User-Agent: Notmuch/0.18+10~g7d81d70 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-unknown-linux-gnu) X-Hashcash: 1:20:150321:bug-gnu-emacs@gnu.org::YizSjuuhKX8GMG6Y:00000000000000000000000000000000000000000QQy Date: Sat, 21 Mar 2015 16:46:16 -0400 Message-ID: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Emacs 24.4.1 on x86_64 Linux, the callback passed to `url-retrieve' is invoked twice if `kill-buffer' is called within the callback when the status reports a connection failure. In the example below, it's assumed this URL will reject the connection, which will cause `url-retrieve' to asynchronously invoke the callback with an error status ("failed with code 111\n"). The second invocation of the callback is synchronous with the first invocation, because it's called recursively from within the `kill-buffer' call. The error message the second time is "deleted\n". ;;; -*- lexical-binding: t; -*- (let ((calls 0)) (url-retrieve "http://localhost:1/" (lambda (_) (assert (= 1 (cl-incf calls))) (kill-buffer)))) When I eval the above expression, the assertion fails asynchronously. error in process sentinel: Assertion failed: (= 1 (cl-incf calls)) I expect the callback given to `url-retrieve' to never be invoked more than once each time it's passed to `url-retrieve'. Ideally I expect it to be called exactly once for each call to `url-retrieve', always delivering errors asynchronously. I also tested this on a Windows build of Emacs. The callback is invoked zero times because the connection error is delivered synchronously at the call to `url-retrieve' (which I now realize explains why connection queuing doesn't work right on Windows). So even if the double-invoke problem is fixed for Linux, the behavior still differs across platforms. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 21 17:01:15 2015 Received: (at 20159) by debbugs.gnu.org; 21 Mar 2015 21:01:15 +0000 Received: from localhost ([127.0.0.1]:60091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQWA-0000CR-L2 for submit@debbugs.gnu.org; Sat, 21 Mar 2015 17:01:14 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:34803) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQW8-0000CE-Gk for 20159@debbugs.gnu.org; Sat, 21 Mar 2015 17:01:13 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NLK00100Y7QLX00@a-mtaout22.012.net.il> for 20159@debbugs.gnu.org; Sat, 21 Mar 2015 23:01:06 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLK001TXYDT8980@a-mtaout22.012.net.il>; Sat, 21 Mar 2015 23:01:06 +0200 (IST) Date: Sat, 21 Mar 2015 23:00:51 +0200 From: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-reply-to: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> X-012-Sender: halo1@inter.net.il To: Christopher Wellons Message-id: <83y4mqrrp8.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Christopher Wellons > Date: Sat, 21 Mar 2015 16:46:16 -0400 > > > ;;; -*- lexical-binding: t; -*- > (let ((calls 0)) > (url-retrieve "http://localhost:1/" > (lambda (_) > (assert (= 1 (cl-incf calls))) > (kill-buffer)))) > > When I eval the above expression, the assertion fails asynchronously. > > error in process sentinel: Assertion failed: (= 1 (cl-incf calls)) > > I expect the callback given to `url-retrieve' to never be invoked more > than once each time it's passed to `url-retrieve'. Ideally I expect it > to be called exactly once for each call to `url-retrieve', always > delivering errors asynchronously. > > I also tested this on a Windows build of Emacs. The callback is invoked > zero times because the connection error is delivered synchronously at > the call to `url-retrieve' (which I now realize explains why connection > queuing doesn't work right on Windows). So even if the double-invoke > problem is fixed for Linux, the behavior still differs across platforms. I don't understand what you mean by "error is delivered synchronously at the call", and by "connection queuing doesn't work right". Please consider elaborating on those 2 points. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 21 17:48:11 2015 Received: (at 20159) by debbugs.gnu.org; 21 Mar 2015 21:48:11 +0000 Received: from localhost ([127.0.0.1]:60117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZRFb-0001Kd-BF for submit@debbugs.gnu.org; Sat, 21 Mar 2015 17:48:11 -0400 Received: from mail.nullprogram.com ([192.241.191.137]:55562) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZRFZ-0001KV-O7 for 20159@debbugs.gnu.org; Sat, 21 Mar 2015 17:48:10 -0400 Received: from localhost ([127.0.0.1] helo=wellocc1-ld2.jhuapl.edu) by mail.nullprogram.com with esmtp (Exim 4.84) (envelope-from ) id 1YZRFX-0000Rg-PA; Sat, 21 Mar 2015 17:48:08 -0400 From: Christopher Wellons To: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-Reply-To: <83y4mqrrp8.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> User-Agent: Notmuch/0.18+10~g7d81d70 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-unknown-linux-gnu) X-Hashcash: 1:20:150321:eliz@gnu.org::O2lRXjehEdBr+uek:000009NEW X-Hashcash: 1:20:150321:20159@debbugs.gnu.org::v1xsmbDw3XcJpEvW:000000000000000000000000000000000000000099rp Date: Sat, 21 Mar 2015 17:48:05 -0400 Message-ID: <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.0 (-) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> I also tested this on a Windows build of Emacs. The callback is invoked >> zero times because the connection error is delivered synchronously at >> the call to `url-retrieve' (which I now realize explains why connection >> queuing doesn't work right on Windows). So even if the double-invoke >> problem is fixed for Linux, the behavior still differs across platforms. > > I don't understand what you mean by "error is delivered synchronously > at the call", and by "connection queuing doesn't work right". Please > consider elaborating on those 2 points. On Windows, url-retrieve doesn't return until the connection is either established or fails, making the call mostly synchronous. If the remote server takes 20 seconds to SYNACK, Emacs will lock up for 20 seconds (and C-g doesn't work either!). For example, currently the server at example.com doesn't seem to respond to anything, so try evaluating the following on Windows. For me, Emacs freezes for 21 seconds, until timing out, and the callback is never invoked. (url-retrieve "http://example.com:1/" (lambda (_))) On Linux it returns immediately and about a minute later the callback is invoked with an error status, timing out. I could call this 100 times in a loop without locking up Emacs. On Windows 7 on my computer, this locks up Emacs for half an hour, though hitting C-g will stop it within 21 seconds (between loop iterations): ;; Try it if you dare! (dotimes (_ 100) (ignore-errors (url-retrieve "http://example.com:1/" (lambda (_))))) Since it's synchronous on Windows, the error can be reported directly to the caller, which is what it does. The downside is awful performance and inconsistent error reporting (sometimes synchronously to the caller, sometimes asynchronously using the callback). I maintain the Elfeed RSS/Atom reader. I've noticed over the past 1.5 years that its performance on Windows is very poor compared to Linux. It's bad enough that I've disabled parallel fetching of feeds on Windows. I see now that it's probably because url-retrieve isn't fully synchronous there. If I call url-retrieve four times in a row to fire off four connections, the TCP connections themselves will be performed serially between calls and not in parallel, as it is on Linux, so there's no point to doing so. They don't queue properly. I hope that explains it well enough! From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 22 13:32:14 2015 Received: (at 20159) by debbugs.gnu.org; 22 Mar 2015 17:32:14 +0000 Received: from localhost ([127.0.0.1]:60863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZjjR-00058f-UF for submit@debbugs.gnu.org; Sun, 22 Mar 2015 13:32:14 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:54947) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZjjP-00058R-AN for 20159@debbugs.gnu.org; Sun, 22 Mar 2015 13:32:12 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NLM00700IX29T00@mtaout27.012.net.il> for 20159@debbugs.gnu.org; Sun, 22 Mar 2015 19:26:48 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLM004S3J4NA930@mtaout27.012.net.il>; Sun, 22 Mar 2015 19:26:48 +0200 (IST) Date: Sun, 22 Mar 2015 19:31:48 +0200 From: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-reply-to: <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> X-012-Sender: halo1@inter.net.il To: Christopher Wellons Message-id: <83pp81rla3.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Christopher Wellons > Cc: 20159@debbugs.gnu.org > Date: Sat, 21 Mar 2015 17:48:05 -0400 > > On Windows, url-retrieve doesn't return until the connection is either > established or fails, making the call mostly synchronous. If the remote > server takes 20 seconds to SYNACK, Emacs will lock up for 20 seconds > (and C-g doesn't work either!). For example, currently the server at > example.com doesn't seem to respond to anything, so try evaluating the > following on Windows. For me, Emacs freezes for 21 seconds, until timing > out, and the callback is never invoked. > > (url-retrieve "http://example.com:1/"; (lambda (_))) > > On Linux it returns immediately and about a minute later the callback is > invoked with an error status, timing out. I could call this 100 times in > a loop without locking up Emacs. On Windows 7 on my computer, this locks > up Emacs for half an hour, though hitting C-g will stop it within 21 > seconds (between loop iterations): > > ;; Try it if you dare! > (dotimes (_ 100) > (ignore-errors > (url-retrieve "http://example.com:1/"; (lambda (_))))) Thanks for the example. Due to some subtle technical issues with the 'select' emulation, the ':nowait' subfeature is turned off on Windows since more than 8 years ago. The result is that the 'connect' call is blocking, and I believe this is what you see. Volunteers are welcome to add support for non-blocking connections; see these messages for the starting point: http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01586.html http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html However, the URL retrieval once the connection is established generally works the same as on GNU/Linux: 'select' notifies the main loop when some stuff is available for reading, and Emacs then reads from every connection that has stuff ready. The 'select' emulation uses separate threads for each connection, so there's no serialization there. Therefore, if you see performance issues after the connection is established, they are most probably due to other factor(s). > Since it's synchronous on Windows, the error can be reported directly to > the caller, which is what it does. The downside is awful performance and > inconsistent error reporting (sometimes synchronously to the caller, > sometimes asynchronously using the callback). Errors for connection part are indeed reported directly. As for performance issues, see above: I see no direct relation between these two, but maybe I'm missing something. > I maintain the Elfeed RSS/Atom reader. I've noticed over the past 1.5 > years that its performance on Windows is very poor compared to Linux. > It's bad enough that I've disabled parallel fetching of feeds on > Windows. I see now that it's probably because url-retrieve isn't fully > synchronous there. If I call url-retrieve four times in a row to fire > off four connections, the TCP connections themselves will be performed > serially between calls and not in parallel, as it is on Linux, so > there's no point to doing so. They don't queue properly. Again, this is true for the connection establishing part, but shouldn't be so for the subsequent retrieval. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 27 05:52:12 2015 Received: (at 20159) by debbugs.gnu.org; 27 Mar 2015 09:52:12 +0000 Received: from localhost ([127.0.0.1]:37823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbQvz-0007K2-Ru for submit@debbugs.gnu.org; Fri, 27 Mar 2015 05:52:12 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:51185) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbQvx-0007Jp-Nm for 20159@debbugs.gnu.org; Fri, 27 Mar 2015 05:52:11 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NLV00L0075LJ700@mtaout27.012.net.il> for 20159@debbugs.gnu.org; Fri, 27 Mar 2015 12:46:48 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLV00CZD7601C80@mtaout27.012.net.il>; Fri, 27 Mar 2015 12:46:48 +0300 (IDT) Date: Fri, 27 Mar 2015 12:52:00 +0300 From: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-reply-to: <83pp81rla3.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: wellons@nullprogram.com Message-id: <838ueibwe7.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> <83pp81rla3.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Sun, 22 Mar 2015 19:31:48 +0200 > From: Eli Zaretskii > Cc: 20159@debbugs.gnu.org > > Due to some subtle technical issues with the 'select' emulation, the > ':nowait' subfeature is turned off on Windows since more than 8 years > ago. The result is that the 'connect' call is blocking, and I believe > this is what you see. > > Volunteers are welcome to add support for non-blocking connections; > see these messages for the starting point: > > http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01586.html > http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html No one volunteered, so I did it myself, see commit d133cf8 on master. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 27 13:00:41 2015 Received: (at submit) by debbugs.gnu.org; 27 Mar 2015 17:00:41 +0000 Received: from localhost ([127.0.0.1]:38300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbXcd-00024N-3Z for submit@debbugs.gnu.org; Fri, 27 Mar 2015 13:00:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42408) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbXca-000249-CK for submit@debbugs.gnu.org; Fri, 27 Mar 2015 13:00:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbXcP-0002dG-9v for submit@debbugs.gnu.org; Fri, 27 Mar 2015 13:00:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbXcP-0002dC-7o for submit@debbugs.gnu.org; Fri, 27 Mar 2015 13:00:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbXcL-0000JI-An for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 13:00:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbXcG-0002bA-Du for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 13:00:21 -0400 Received: from plane.gmane.org ([80.91.229.3]:51523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbXcG-0002aV-80 for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 13:00:16 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YbXc3-0007nW-D4 for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2015 18:00:03 +0100 Received: from uk.solarflare.com ([193.34.186.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Mar 2015 18:00:03 +0100 Received: from andrewjmoreton by uk.solarflare.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Mar 2015 18:00:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer Date: Fri, 27 Mar 2015 16:59:39 +0000 Lines: 26 Message-ID: References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> <83pp81rla3.fsf@gnu.org> <838ueibwe7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: uk.solarflare.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (cygwin) Cancel-Lock: sha1:dhk5KMSxP0yGE+xQY0M3u8WR4+M= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) On Fri 27 Mar 2015, Eli Zaretskii wrote: >> Date: Sun, 22 Mar 2015 19:31:48 +0200 >> From: Eli Zaretskii >> Cc: 20159@debbugs.gnu.org >> >> Due to some subtle technical issues with the 'select' emulation, the >> ':nowait' subfeature is turned off on Windows since more than 8 years >> ago. The result is that the 'connect' call is blocking, and I believe >> this is what you see. >> >> Volunteers are welcome to add support for non-blocking connections; >> see these messages for the starting point: >> >> http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01586.html >> http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html > > No one volunteered, so I did it myself, see commit d133cf8 on master. This change broke gnus for me on a mingw64 x64 build of emacs, as gnutls seems unable to connect to the NNTP server at gmane.org. I will report more details when I have time to investigate this further with gdb. AndyM From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 27 15:22:42 2015 Received: (at 20159) by debbugs.gnu.org; 27 Mar 2015 19:22:42 +0000 Received: from localhost ([127.0.0.1]:38316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbZq5-0005MO-N2 for submit@debbugs.gnu.org; Fri, 27 Mar 2015 15:22:41 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:42166) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YbZq3-0005M7-9G for 20159@debbugs.gnu.org; Fri, 27 Mar 2015 15:22:40 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NLV00L00XHQCF00@a-mtaout20.012.net.il> for 20159@debbugs.gnu.org; Fri, 27 Mar 2015 22:22:32 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLV00L5UXTJ9F40@a-mtaout20.012.net.il>; Fri, 27 Mar 2015 22:22:32 +0300 (IDT) Date: Fri, 27 Mar 2015 22:22:31 +0300 From: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-reply-to: X-012-Sender: halo1@inter.net.il To: Andy Moreton Message-id: <83lhii1c08.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> <83pp81rla3.fsf@gnu.org> <838ueibwe7.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Andy Moreton > Date: Fri, 27 Mar 2015 16:59:39 +0000 > > > No one volunteered, so I did it myself, see commit d133cf8 on master. > > This change broke gnus for me on a mingw64 x64 build of emacs, as gnutls > seems unable to connect to the NNTP server at gmane.org. Sorry about that. Does Gnus do something windows-specific for connecting? Perhaps that specific treatment relied on something that is no longer true on Windows. > I will report more details when I have time to investigate this further > with gdb. Thanks. If you cannot figure it out, a recipe from "emacs -Q" will help. Bonus points if you can reproduce the problem with just a TLS connection that doesn't need Gnus. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 27 15:40:31 2015 Received: (at 20159) by debbugs.gnu.org; 27 Mar 2015 19:40:31 +0000 Received: from localhost ([127.0.0.1]:38327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yba7K-0005oJ-Rt for submit@debbugs.gnu.org; Fri, 27 Mar 2015 15:40:31 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:56444) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yba7H-0005nz-4C for 20159@debbugs.gnu.org; Fri, 27 Mar 2015 15:40:28 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NLV00J00XXEE200@mtaout27.012.net.il> for 20159@debbugs.gnu.org; Fri, 27 Mar 2015 22:35:07 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLV009ECYEJLHA0@mtaout27.012.net.il>; Fri, 27 Mar 2015 22:35:07 +0300 (IDT) Date: Fri, 27 Mar 2015 22:40:19 +0300 From: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-reply-to: <83lhii1c08.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: andrewjmoreton@gmail.com Message-id: <83iodm1b6k.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> <83pp81rla3.fsf@gnu.org> <838ueibwe7.fsf@gnu.org> <83lhii1c08.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 27 Mar 2015 22:22:31 +0300 > From: Eli Zaretskii > Cc: 20159@debbugs.gnu.org > > > From: Andy Moreton > > Date: Fri, 27 Mar 2015 16:59:39 +0000 > > > > > No one volunteered, so I did it myself, see commit d133cf8 on master. > > > > This change broke gnus for me on a mingw64 x64 build of emacs, as gnutls > > seems unable to connect to the NNTP server at gmane.org. > > Sorry about that. Does Gnus do something windows-specific for > connecting? Perhaps that specific treatment relied on something that > is no longer true on Windows. Another, perhaps more probable culprit is the emacs_gnutls_pull function. It calls sys_read, where I made some changes to support the non-blocking connect. Perhaps emacs_gnutls_pull cannot cope with some results of those changes, and itself needs to be amended. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 28 03:39:52 2015 Received: (at 20159) by debbugs.gnu.org; 28 Mar 2015 07:39:52 +0000 Received: from localhost ([127.0.0.1]:38533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YblLT-0007Kj-VZ for submit@debbugs.gnu.org; Sat, 28 Mar 2015 03:39:52 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:58791) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YblLP-0007KQ-1b for 20159@debbugs.gnu.org; Sat, 28 Mar 2015 03:39:48 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NLW00D00VIAOZ00@mtaout29.012.net.il> for 20159@debbugs.gnu.org; Sat, 28 Mar 2015 10:36:49 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLW007TKVTCTD50@mtaout29.012.net.il>; Sat, 28 Mar 2015 10:36:49 +0300 (IDT) Date: Sat, 28 Mar 2015 10:39:40 +0300 From: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-reply-to: <83iodm1b6k.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: andrewjmoreton@gmail.com Message-id: <838ueh1sg3.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> <83pp81rla3.fsf@gnu.org> <838ueibwe7.fsf@gnu.org> <83lhii1c08.fsf@gnu.org> <83iodm1b6k.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 27 Mar 2015 22:40:19 +0300 > From: Eli Zaretskii > Cc: 20159@debbugs.gnu.org > > > > This change broke gnus for me on a mingw64 x64 build of emacs, as gnutls > > > seems unable to connect to the NNTP server at gmane.org. > > > > Sorry about that. Does Gnus do something windows-specific for > > connecting? Perhaps that specific treatment relied on something that > > is no longer true on Windows. > > Another, perhaps more probable culprit is the emacs_gnutls_pull > function. It calls sys_read, where I made some changes to support the > non-blocking connect. Perhaps emacs_gnutls_pull cannot cope with some > results of those changes, and itself needs to be amended. I found and fixed a stupid mistake in sys_connect that broke blocking connects. Before I fixed it, "M-x eww" wouldn't work; now it does, including with HTTPS URLs that require GnuTLS. Please see if this also fixes your problem with Gnus and GnuTLS connections to NNTP servers. Sorry. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 28 06:56:55 2015 Received: (at submit) by debbugs.gnu.org; 28 Mar 2015 10:56:55 +0000 Received: from localhost ([127.0.0.1]:38572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YboQA-0003kc-FY for submit@debbugs.gnu.org; Sat, 28 Mar 2015 06:56:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50732) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YboQ7-0003kP-Vh for submit@debbugs.gnu.org; Sat, 28 Mar 2015 06:56:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YboQ1-0003FD-QC for submit@debbugs.gnu.org; Sat, 28 Mar 2015 06:56:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YboQ1-0003F9-Nw for submit@debbugs.gnu.org; Sat, 28 Mar 2015 06:56:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YboQ0-0008PN-R6 for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2015 06:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YboPx-0003DE-IL for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2015 06:56:44 -0400 Received: from plane.gmane.org ([80.91.229.3]:37027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YboPx-0003Cq-CE for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2015 06:56:41 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YboPv-000344-56 for bug-gnu-emacs@gnu.org; Sat, 28 Mar 2015 11:56:39 +0100 Received: from 82-69-64-228.dsl.in-addr.zen.co.uk ([82.69.64.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 Mar 2015 11:56:39 +0100 Received: from andrewjmoreton by 82-69-64-228.dsl.in-addr.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 Mar 2015 11:56:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Andy Moreton Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer Date: Sat, 28 Mar 2015 10:56:10 +0000 Lines: 28 Message-ID: <86wq21o0fp.fsf@gmail.com> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> <83pp81rla3.fsf@gnu.org> <838ueibwe7.fsf@gnu.org> <83lhii1c08.fsf@gnu.org> <83iodm1b6k.fsf@gnu.org> <838ueh1sg3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 82-69-64-228.dsl.in-addr.zen.co.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) Cancel-Lock: sha1:zX5ZyLr3UU34WLMnoJwbbeH1xic= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) On Sat 28 Mar 2015, Eli Zaretskii wrote: >> Date: Fri, 27 Mar 2015 22:40:19 +0300 >> From: Eli Zaretskii >> Cc: 20159@debbugs.gnu.org >> >> > > This change broke gnus for me on a mingw64 x64 build of emacs, as gnutls >> > > seems unable to connect to the NNTP server at gmane.org. >> > >> > Sorry about that. Does Gnus do something windows-specific for >> > connecting? Perhaps that specific treatment relied on something that >> > is no longer true on Windows. >> >> Another, perhaps more probable culprit is the emacs_gnutls_pull >> function. It calls sys_read, where I made some changes to support the >> non-blocking connect. Perhaps emacs_gnutls_pull cannot cope with some >> results of those changes, and itself needs to be amended. > > I found and fixed a stupid mistake in sys_connect that broke blocking > connects. Before I fixed it, "M-x eww" wouldn't work; now it does, > including with HTTPS URLs that require GnuTLS. Please see if this > also fixes your problem with Gnus and GnuTLS connections to NNTP > servers. Thanks Eli, gnus is working again for me. AndyM From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 28 07:28:46 2015 Received: (at 20159) by debbugs.gnu.org; 28 Mar 2015 11:28:47 +0000 Received: from localhost ([127.0.0.1]:38576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ybov0-0004Uz-HC for submit@debbugs.gnu.org; Sat, 28 Mar 2015 07:28:46 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:38304) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yboux-0004Uk-AZ for 20159@debbugs.gnu.org; Sat, 28 Mar 2015 07:28:44 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NLX00I006C5HV00@mtaout26.012.net.il> for 20159@debbugs.gnu.org; Sat, 28 Mar 2015 14:29:38 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLX006Q16LEUYA0@mtaout26.012.net.il>; Sat, 28 Mar 2015 14:29:38 +0300 (IDT) Date: Sat, 28 Mar 2015 14:28:35 +0300 From: Eli Zaretskii Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer In-reply-to: <86wq21o0fp.fsf@gmail.com> X-012-Sender: halo1@inter.net.il To: Andy Moreton Message-id: <83384p1huk.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <83y4mqrrp8.fsf@gnu.org> <87egoi3tuy.fsf@wellocc1-ld2.jhuapl.edu> <83pp81rla3.fsf@gnu.org> <838ueibwe7.fsf@gnu.org> <83lhii1c08.fsf@gnu.org> <83iodm1b6k.fsf@gnu.org> <838ueh1sg3.fsf@gnu.org> <86wq21o0fp.fsf@gmail.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Andy Moreton > Date: Sat, 28 Mar 2015 10:56:10 +0000 > > > I found and fixed a stupid mistake in sys_connect that broke blocking > > connects. Before I fixed it, "M-x eww" wouldn't work; now it does, > > including with HTTPS URLs that require GnuTLS. Please see if this > > also fixes your problem with Gnus and GnuTLS connections to NNTP > > servers. > > Thanks Eli, gnus is working again for me. Great, thanks for testing. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 13:30:48 2015 Received: (at 20159) by debbugs.gnu.org; 25 Dec 2015 18:30:48 +0000 Received: from localhost ([127.0.0.1]:35283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCX8a-0000cT-Bj for submit@debbugs.gnu.org; Fri, 25 Dec 2015 13:30:48 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:53572) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCX8Y-0000ZR-Bq for 20159@debbugs.gnu.org; Fri, 25 Dec 2015 13:30:46 -0500 Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aCX8B-0002Ys-T1; Fri, 25 Dec 2015 19:30:24 +0100 From: Lars Ingebrigtsen To: Christopher Wellons Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> Date: Fri, 25 Dec 2015 19:30:23 +0100 In-Reply-To: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> (Christopher Wellons's message of "Sat, 21 Mar 2015 16:46:16 -0400") Message-ID: <87si2qxtxc.fsf@gnus.org> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-MailScanner-ID: 1aCX8B-0002Ys-T1 X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1451673024.443@MwUJrRq2JmpCLs8Pb9ocUg X-Spam-Status: No X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Christopher Wellons writes: > ;;; -*- lexical-binding: t; -*- > (let ((calls 0)) > (url-retrieve "http://localhost:1/" > (lambda (_) > (assert (=3D 1 (cl-incf calls))) > (kill-buffer)))) > > When I eval the above expression, the assertion fails asynchronously. > > error in process sentinel: Assertion failed: (=3D 1 (cl-incf calls)) Eli fixed something related to this, but the bug still remains. I used this version: ;;; -*- lexical-binding: t; -*- (let ((calls 0)) (url-retrieve "http://localhost:1/" (lambda (status) (message "%s '%s'" calls status) (assert (=3D 1 (cl-incf calls))) (kill-buffer)))) These are the messages: Contacting host: localhost:1 # 0 =92(:error (error connection-failed failed with code 111 :host localhost :service 1))=92 1 =92(:error (error connection-failed deleted :host localhost :service 1) :error (error connection-failed failed with co= de 111 :host localhost :service 1))=92 The second message is... pretty weird... Anybody have a guess why this happens? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 13:30:50 2015 Received: (at control) by debbugs.gnu.org; 25 Dec 2015 18:30:51 +0000 Received: from localhost ([127.0.0.1]:35286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCX8c-0000fJ-N7 for submit@debbugs.gnu.org; Fri, 25 Dec 2015 13:30:50 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:53578) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCX8b-0000dn-Qh for control@debbugs.gnu.org; Fri, 25 Dec 2015 13:30:50 -0500 Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aCX8G-0002Z2-6b for control@debbugs.gnu.org; Fri, 25 Dec 2015 19:30:28 +0100 Date: Fri, 25 Dec 2015 19:30:27 +0100 Message-Id: <87r3iaxtx8.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #20159 X-MailScanner-ID: 1aCX8G-0002Z2-6b X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1451673028.41483@1Dd1iiLt6DocZl1Yi9Z1uQ X-Spam-Status: No X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tags 20159 confirmed From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 29 23:05:21 2016 Received: (at 20159) by debbugs.gnu.org; 1 Mar 2016 04:05:21 +0000 Received: from localhost ([127.0.0.1]:54568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aabYj-0000Pw-Fl for submit@debbugs.gnu.org; Mon, 29 Feb 2016 23:05:21 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:39099) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aabYe-0000Pl-Jw for 20159@debbugs.gnu.org; Mon, 29 Feb 2016 23:05:16 -0500 Received: from 109.179.133.80.tmi.telenormobil.no ([109.179.133.80] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aabYF-0001zZ-CJ; Tue, 01 Mar 2016 05:04:48 +0100 From: Lars Ingebrigtsen To: Christopher Wellons Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <87si2qxtxc.fsf@gnus.org> Date: Tue, 01 Mar 2016 15:04:37 +1100 In-Reply-To: <87si2qxtxc.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 25 Dec 2015 19:30:23 +0100") Message-ID: <871t7uyhbe.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-MailScanner-ID: 1aabYF-0001zZ-CJ X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457409888.56349@gsyiwCv1I/JtPkgkqKB6Ug X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20159 Cc: 20159@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Lars Ingebrigtsen writes: > Eli fixed something related to this, but the bug still remains. I used > this version: > > ;;; -*- lexical-binding: t; -*- > (let ((calls 0)) > (url-retrieve "http://localhost:1/" > (lambda (status) > (message "%s '%s'" calls status) > (assert (=3D 1 (cl-incf calls))) > (kill-buffer)))) > > These are the messages: > > Contacting host: localhost:1 > # > 0 =92(:error (error connection-failed failed with code 111 > :host localhost :service 1))=92 > 1 =92(:error (error connection-failed deleted > :host localhost :service 1) :error (error connection-failed failed with = code 111 > :host localhost :service 1))=92 > > The second message is... pretty weird... > > Anybody have a guess why this happens? I've done some further debugging, and what's happening is (simply, ahem) that when we get a "connection failed" message from the sentinel, and then kill the buffer, we also kill the process, and then the sentinel is called again, and then it calls our callback again. So the weird thing is that the process isn't already dead, kinda... Or something... --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 29 23:09:37 2016 Received: (at 20159-done) by debbugs.gnu.org; 1 Mar 2016 04:09:37 +0000 Received: from localhost ([127.0.0.1]:54572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aabcv-0000Vj-FY for submit@debbugs.gnu.org; Mon, 29 Feb 2016 23:09:37 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:54614) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aabct-0000Vb-Sf for 20159-done@debbugs.gnu.org; Mon, 29 Feb 2016 23:09:36 -0500 Received: from 109.179.133.80.tmi.telenormobil.no ([109.179.133.80] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aabbn-0002AX-7U; Tue, 01 Mar 2016 05:08:28 +0100 From: Lars Ingebrigtsen To: Christopher Wellons Subject: Re: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> <87si2qxtxc.fsf@gnus.org> Date: Tue, 01 Mar 2016 15:08:18 +1100 In-Reply-To: <87si2qxtxc.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 25 Dec 2015 19:30:23 +0100") Message-ID: <87wppmx2kt.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aabbn-0002AX-7U X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1457410111.01772@OB2jfOe1ZTVaijjdK+ArFg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20159-done Cc: 20159-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) The two statuses are these: Process status failed Process status closed But I kinda think that url.el is behaving as specified. The callbacks may be called many times, and you're supposed to check the status. And if you're killing the same buffer twice, this is pilot error. So I don't think there's really a bug here. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Tue Jun 17 19:57:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 29 Mar 2016 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator