From unknown Mon Jun 23 09:41:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36350: [2.2.5] =?UTF-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Jun 2019 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36350 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 36350@debbugs.gnu.org Cc: Mark H Weaver X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156137235427587 (code B ref -1); Mon, 24 Jun 2019 10:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Jun 2019 10:32:34 +0000 Received: from localhost ([127.0.0.1]:55624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfMH4-0007Ag-Gn for submit@debbugs.gnu.org; Mon, 24 Jun 2019 06:32:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:56027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfMH3-00079k-B8 for submit@debbugs.gnu.org; Mon, 24 Jun 2019 06:32:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45441) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfMH1-0001IU-Di for bug-guile@gnu.org; Mon, 24 Jun 2019 06:32:33 -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.0 required=5.0 tests=ALL_TRUSTED,BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hfMH1-0001hs-5h; Mon, 24 Jun 2019 06:32:31 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43456 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hfMGq-0002yD-Al; Mon, 24 Jun 2019 06:32:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Messidor an 227 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 24 Jun 2019 12:32:18 +0200 Message-ID: <87pnn3b7f1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) 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: -3.3 (---) Hello, In Guile 2.2.5, if you run: ./meta/guile examples/web/hello.scm & wget -O - http://localhost:8080 You=E2=80=99ll notice that =E2=80=98wget=E2=80=99 hangs (never receives a r= esponse) because the server is actually stuck in a read(2) call that will never complete, in =E2=80=98read-headers=E2=80=99. Reverting 73cde5ed7218a090ecee888870908af5445796f0 solves the problem. AIUI, before that commit, =E2=80=98read-header-line=E2=80=99 would read exa= ctly one line. After this change, it calls =E2=80=98lookahead-char=E2=80=99, which = can block, and that=E2=80=99s exactly what=E2=80=99s happening here. I don=E2=80=99t know how HTTP continuation lines work, so I=E2=80=99m not s= ure what a correct fix would look like. Mark, WDYT? I also noticed that there are no unit tests for (web server), which we should probably address while we=E2=80=99re at it. :-) Thanks, Ludo=E2=80=99. From unknown Mon Jun 23 09:41:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36350: [2.2.5] =?UTF-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers References: <87pnn3b7f1.fsf@gnu.org> In-Reply-To: <87pnn3b7f1.fsf@gnu.org> Resent-From: Dan Frumin Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Jun 2019 12:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36350 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 36350@debbugs.gnu.org Received: via spool by 36350-submit@debbugs.gnu.org id=B36350.156137796112444 (code B ref 36350); Mon, 24 Jun 2019 12:07:01 +0000 Received: (at 36350) by debbugs.gnu.org; 24 Jun 2019 12:06:01 +0000 Received: from localhost ([127.0.0.1]:55682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfNjV-0003EX-1h for submit@debbugs.gnu.org; Mon, 24 Jun 2019 08:06:01 -0400 Received: from smtp1.science.ru.nl ([131.174.16.143]:57140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfNjT-0003EM-Mn for 36350@debbugs.gnu.org; Mon, 24 Jun 2019 08:06:00 -0400 Received: from [145.116.188.250] (ip-145-116-188-250.wlan-int.ru.nl [145.116.188.250]) (authen=dfrumin) by smtp1.science.ru.nl (8.14.4/5.32) with ESMTP id x5OC5v9D006060 for <36350@debbugs.gnu.org>; Mon, 24 Jun 2019 14:05:57 +0200 From: Dan Frumin Message-ID: <9061114e-67e8-7ec2-1d09-b1600ab07582@cs.ru.nl> Date: Mon, 24 Jun 2019 14:05:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) I believe that `(lookahead-char port)` really blocks when the client has finished sending the request and there is no more data from `port` to consume. If I understand it correctly, then per HTTP/1.1 [1] the request ends with CRLF at the last line, and then comes the message. So I we have read an empty string, then we shouldn't proceed with further lookaheads. Specifically, the following code works out for me: (define (read-header-line port) "Read an HTTP header line, including any continuation lines, and return the combined string without its final CRLF or LF. Raise a 'bad-header' exception if the line does not end in CRLF or LF, or if EOF is reached." (format #t "Reading header line now: ") (match (%read-line port) (((? string? line) . #\newline) ;; '%read-line' does not consider #\return a delimiter; so if it's ;; there, remove it. We are more tolerant than the RFC in that we ;; tolerate LF-only endings. (let ((line (if (string-suffix? "\r" line) (string-drop-right line 1) line))) ;; If the next character is a space or tab, then there's at least ;; one continuation line. Read the continuation lines by calling ;; 'read-header-line' recursively, and append them to this header ;; line, folding the leading spaces and tabs to a single space. (if (and (not (string-null? line)) (space-or-tab? (lookahead-char port))) (string-append line " " (string-trim (read-header-line port) spaces-and-tabs)) line))) ((line . _) ;EOF or missing delimiter (bad-header 'read-header-line line)))) Moreover, the continuation lines in general have been deprecated: [2]. I have to say I would be in favor of removing support for continuation lines in general. Best regards, -Dan [1]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html [2]: https://tools.ietf.org/html/rfc7230#section-3.2.4 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 24 08:31:44 2019 Received: (at control) by debbugs.gnu.org; 24 Jun 2019 12:31:44 +0000 Received: from localhost ([127.0.0.1]:55751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfO8O-00042b-7W for submit@debbugs.gnu.org; Mon, 24 Jun 2019 08:31:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfO8M-00042K-Lt for control@debbugs.gnu.org; Mon, 24 Jun 2019 08:31:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hfO8F-00027z-NR for control@debbugs.gnu.org; Mon, 24 Jun 2019 08:31:35 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43580 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hfO8C-0006uI-Vy for control@debbugs.gnu.org; Mon, 24 Jun 2019 08:31:33 -0400 Date: Mon, 24 Jun 2019 14:31:31 +0200 Message-Id: <87imsvb1wc.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #36350 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) 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: -3.3 (---) severity 36350 important quit From unknown Mon Jun 23 09:41:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36350: [2.2.5] =?UTF-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers Resent-From: Dan Frumin Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Jun 2019 12:46:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36350 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 36350@debbugs.gnu.org Received: via spool by 36350-submit@debbugs.gnu.org id=B36350.156138030416952 (code B ref 36350); Mon, 24 Jun 2019 12:46:03 +0000 Received: (at 36350) by debbugs.gnu.org; 24 Jun 2019 12:45:04 +0000 Received: from localhost ([127.0.0.1]:55765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfOLI-0004P3-2w for submit@debbugs.gnu.org; Mon, 24 Jun 2019 08:45:04 -0400 Received: from smtp1.science.ru.nl ([131.174.16.143]:58124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfOLF-0004MT-JI for 36350@debbugs.gnu.org; Mon, 24 Jun 2019 08:45:02 -0400 Received: from [145.116.188.250] (ip-145-116-188-250.wlan-int.ru.nl [145.116.188.250]) (authen=dfrumin) by smtp1.science.ru.nl (8.14.4/5.32) with ESMTP id x5OCiwSL010839 for <36350@debbugs.gnu.org>; Mon, 24 Jun 2019 14:44:58 +0200 From: Dan Frumin References: <9061114e-67e8-7ec2-1d09-b1600ab07582@cs.ru.nl> Message-ID: <7d306db9-87d9-0b1d-8ecb-7486ae982349@cs.ru.nl> Date: Mon, 24 Jun 2019 14:44:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <9061114e-67e8-7ec2-1d09-b1600ab07582@cs.ru.nl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) By the way, I've just tested the web server in Google Chrome, and it works fine! I was told that a (potential) reason for that is that Chrome sends TCP FIN to the server, which closes the socket for reading, and then `lookahead-char` sees eof. Best, Dan From unknown Mon Jun 23 09:41:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36350: [2.2.5] =?UTF-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Jun 2019 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36350 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 36350@debbugs.gnu.org Received: via spool by 36350-submit@debbugs.gnu.org id=B36350.15613907453659 (code B ref 36350); Mon, 24 Jun 2019 15:40:02 +0000 Received: (at 36350) by debbugs.gnu.org; 24 Jun 2019 15:39:05 +0000 Received: from localhost ([127.0.0.1]:57641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfR3g-0000ww-Cq for submit@debbugs.gnu.org; Mon, 24 Jun 2019 11:39:04 -0400 Received: from world.peace.net ([64.112.178.59]:56942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfR3f-0000wF-1n for 36350@debbugs.gnu.org; Mon, 24 Jun 2019 11:39:03 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfR3Z-0002gu-D9; Mon, 24 Jun 2019 11:38:57 -0400 From: Mark H Weaver References: <87pnn3b7f1.fsf@gnu.org> Date: Mon, 24 Jun 2019 11:36:41 -0400 In-Reply-To: <87pnn3b7f1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 24 Jun 2019 12:32:18 +0200") Message-ID: <87h88f0zbv.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) 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: -1.0 (-) Hi Ludovic, Ludovic Court=C3=A8s writes: > ./meta/guile examples/web/hello.scm & > wget -O - http://localhost:8080 > > You=E2=80=99ll notice that =E2=80=98wget=E2=80=99 hangs (never receives a= response) because the > server is actually stuck in a read(2) call that will never complete, in > =E2=80=98read-headers=E2=80=99. > > Reverting 73cde5ed7218a090ecee888870908af5445796f0 solves the problem. > > AIUI, before that commit, =E2=80=98read-header-line=E2=80=99 would read e= xactly one > line. After this change, it calls =E2=80=98lookahead-char=E2=80=99, whic= h can block, > and that=E2=80=99s exactly what=E2=80=99s happening here. Gah, indeed! Also, I see now that there was already some existing code to handle HTTP continuation lines, before my commit referenced above, although it neglects to fold the whitespace after the CRLF into a single SP octet. I'm not sure how I failed to notice that. The commit should simply be reverted, I think. Pushed as commit e1225d013ed8673382d6d8f9300dd6b175c8b820 on the stable-2.2 branch. I tried leaving the new test in place, but it failed due to the lack of whitespace folding in the previous code. I really messed up here, sorry. > I also noticed that there are no unit tests for (web server), which we > should probably address while we=E2=80=99re at it. :-) Yes, that would be great. I won't be able to do it anytime soon, though. Mark From unknown Mon Jun 23 09:41:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36350: [2.2.5] =?UTF-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Jun 2019 18:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36350 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Mark H Weaver Cc: 36350@debbugs.gnu.org Received: via spool by 36350-submit@debbugs.gnu.org id=B36350.156140262410611 (code B ref 36350); Mon, 24 Jun 2019 18:58:01 +0000 Received: (at 36350) by debbugs.gnu.org; 24 Jun 2019 18:57:04 +0000 Received: from localhost ([127.0.0.1]:57983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfU9H-0002l0-OS for submit@debbugs.gnu.org; Mon, 24 Jun 2019 14:57:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfU9F-0002kA-7o for 36350@debbugs.gnu.org; Mon, 24 Jun 2019 14:57:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hfU99-0006hj-PD; Mon, 24 Jun 2019 14:56:55 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43354 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hfU92-0003Qz-Q3; Mon, 24 Jun 2019 14:56:51 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87pnn3b7f1.fsf@gnu.org> <87h88f0zbv.fsf@netris.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Messidor an 227 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 24 Jun 2019 20:56:46 +0200 In-Reply-To: <87h88f0zbv.fsf@netris.org> (Mark H. Weaver's message of "Mon, 24 Jun 2019 11:36:41 -0400") Message-ID: <87lfxq95ht.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) 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: -3.3 (---) Hi Mark, Mark H Weaver skribis: > Ludovic Court=C3=A8s writes: > >> ./meta/guile examples/web/hello.scm & >> wget -O - http://localhost:8080 >> >> You=E2=80=99ll notice that =E2=80=98wget=E2=80=99 hangs (never receives = a response) because the >> server is actually stuck in a read(2) call that will never complete, in >> =E2=80=98read-headers=E2=80=99. >> >> Reverting 73cde5ed7218a090ecee888870908af5445796f0 solves the problem. >> >> AIUI, before that commit, =E2=80=98read-header-line=E2=80=99 would read = exactly one >> line. After this change, it calls =E2=80=98lookahead-char=E2=80=99, whi= ch can block, >> and that=E2=80=99s exactly what=E2=80=99s happening here. > > Gah, indeed! > > Also, I see now that there was already some existing code to handle HTTP > continuation lines, before my commit referenced above, although it > neglects to fold the whitespace after the CRLF into a single SP octet. > I'm not sure how I failed to notice that. > > The commit should simply be reverted, I think. Pushed as commit > e1225d013ed8673382d6d8f9300dd6b175c8b820 on the stable-2.2 branch. > I tried leaving the new test in place, but it failed due to the lack of > whitespace folding in the previous code. OK, reverting sounds good to me. > I really messed up here, sorry. No problem. Perhaps we should consider releasing 2.0.6 soon and use that in Guix on =E2=80=98core-updates=E2=80=99. Thanks, Ludo=E2=80=99. From unknown Mon Jun 23 09:41:07 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36350: [2.2.5] =?UTF-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 25 Jun 2019 07:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36350 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 36350@debbugs.gnu.org Received: via spool by 36350-submit@debbugs.gnu.org id=B36350.156144751322683 (code B ref 36350); Tue, 25 Jun 2019 07:26:01 +0000 Received: (at 36350) by debbugs.gnu.org; 25 Jun 2019 07:25:13 +0000 Received: from localhost ([127.0.0.1]:58557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hffpI-0005tm-Oi for submit@debbugs.gnu.org; Tue, 25 Jun 2019 03:25:12 -0400 Received: from world.peace.net ([64.112.178.59]:58310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hffpH-0005ta-Qt for 36350@debbugs.gnu.org; Tue, 25 Jun 2019 03:25:12 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hffpC-0007eH-8g; Tue, 25 Jun 2019 03:25:06 -0400 From: Mark H Weaver References: <87pnn3b7f1.fsf@gnu.org> <87h88f0zbv.fsf@netris.org> <87lfxq95ht.fsf@gnu.org> Date: Tue, 25 Jun 2019 03:22:55 -0400 In-Reply-To: <87lfxq95ht.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 24 Jun 2019 20:56:46 +0200") Message-ID: <875zoucemt.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) 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: -1.0 (-) Ludovic Court=C3=A8s writes: > Perhaps we should consider releasing 2.0.6 soon and use that in Guix > on =E2=80=98core-updates=E2=80=99. Sure, sounds like a good idea. Mark From unknown Mon Jun 23 09:41:07 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#36350: closed (Re: bug#36350: [2.2.5] =?UTF-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers) Message-ID: References: <878stisvie.fsf@gnu.org> <87pnn3b7f1.fsf@gnu.org> X-Gnu-PR-Message: they-closed 36350 X-Gnu-PR-Package: guile Reply-To: 36350@debbugs.gnu.org Date: Sun, 30 Jun 2019 19:51:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1561924262-17337-1" This is a multi-part message in MIME format... ------------=_1561924262-17337-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #36350: [2.2.5] =E2=80=98read-headers=E2=80=99 blocks, thereby breaking web= servers which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 36350@debbugs.gnu.org. --=20 36350: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36350 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1561924262-17337-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36350-done) by debbugs.gnu.org; 30 Jun 2019 19:50:29 +0000 Received: from localhost ([127.0.0.1]:47317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhfqH-0004T6-3x for submit@debbugs.gnu.org; Sun, 30 Jun 2019 15:50:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhfqF-0004SU-9e for 36350-done@debbugs.gnu.org; Sun, 30 Jun 2019 15:50:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hhfq8-0003zY-3D; Sun, 30 Jun 2019 15:50:20 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40006 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hhfq6-00010a-Mn; Sun, 30 Jun 2019 15:50:19 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mark H Weaver Subject: Re: bug#36350: [2.2.5] =?utf-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers References: <87pnn3b7f1.fsf@gnu.org> <87h88f0zbv.fsf@netris.org> <87lfxq95ht.fsf@gnu.org> <875zoucemt.fsf@netris.org> Date: Sun, 30 Jun 2019 21:50:17 +0200 In-Reply-To: <875zoucemt.fsf@netris.org> (Mark H. Weaver's message of "Tue, 25 Jun 2019 03:22:55 -0400") Message-ID: <878stisvie.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36350-done Cc: 36350-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: -3.3 (---) Hi, Mark H Weaver skribis: > Ludovic Court=C3=A8s writes: >> Perhaps we should consider releasing 2.0.6 soon and use that in Guix >> on =E2=80=98core-updates=E2=80=99. > > Sure, sounds like a good idea. Done in a152a67d3865cc6e7f9d7abd8f17a6e905b8e841. The test is simple but would catch regressions like this one. Ludo=E2=80=99. ------------=_1561924262-17337-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Jun 2019 10:32:34 +0000 Received: from localhost ([127.0.0.1]:55624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfMH4-0007Ag-Gn for submit@debbugs.gnu.org; Mon, 24 Jun 2019 06:32:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:56027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfMH3-00079k-B8 for submit@debbugs.gnu.org; Mon, 24 Jun 2019 06:32:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45441) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfMH1-0001IU-Di for bug-guile@gnu.org; Mon, 24 Jun 2019 06:32:33 -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.0 required=5.0 tests=ALL_TRUSTED,BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hfMH1-0001hs-5h; Mon, 24 Jun 2019 06:32:31 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43456 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hfMGq-0002yD-Al; Mon, 24 Jun 2019 06:32:25 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guile@gnu.org Subject: [2.2.5] =?utf-8?Q?=E2=80=98read-headers=E2=80=99?= blocks, thereby breaking web servers X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Messidor an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 24 Jun 2019 12:32:18 +0200 Message-ID: <87pnn3b7f1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Mark H Weaver 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: -3.3 (---) Hello, In Guile 2.2.5, if you run: ./meta/guile examples/web/hello.scm & wget -O - http://localhost:8080 You=E2=80=99ll notice that =E2=80=98wget=E2=80=99 hangs (never receives a r= esponse) because the server is actually stuck in a read(2) call that will never complete, in =E2=80=98read-headers=E2=80=99. Reverting 73cde5ed7218a090ecee888870908af5445796f0 solves the problem. AIUI, before that commit, =E2=80=98read-header-line=E2=80=99 would read exa= ctly one line. After this change, it calls =E2=80=98lookahead-char=E2=80=99, which = can block, and that=E2=80=99s exactly what=E2=80=99s happening here. I don=E2=80=99t know how HTTP continuation lines work, so I=E2=80=99m not s= ure what a correct fix would look like. Mark, WDYT? I also noticed that there are no unit tests for (web server), which we should probably address while we=E2=80=99re at it. :-) Thanks, Ludo=E2=80=99. ------------=_1561924262-17337-1--