From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: me--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61411: [PATCH] Handle a case where url-basic-auth can crash Date: Sun, 26 Feb 2023 08:52:31 +0000 Message-ID: <7d66200bf9f7541a75484418fa3474ac@elken.dev> References: <83sfetj8p2.fsf@gnu.org> Reply-To: me@elken.dev Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35993"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61411@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 26 09:53:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pWCmS-0009Ay-FZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Feb 2023 09:53:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWCmG-0007iY-Lx; Sun, 26 Feb 2023 03:53:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWCmE-0007iJ-JU for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 03:53:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWCmE-0001K2-Bc for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 03:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWCmD-0005y9-Ts for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 03:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: me@elken.dev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Feb 2023 08:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61411 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61411-submit@debbugs.gnu.org id=B61411.167740156022911 (code B ref 61411); Sun, 26 Feb 2023 08:53:01 +0000 Original-Received: (at 61411) by debbugs.gnu.org; 26 Feb 2023 08:52:40 +0000 Original-Received: from localhost ([127.0.0.1]:42325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWCls-0005xT-G0 for submit@debbugs.gnu.org; Sun, 26 Feb 2023 03:52:40 -0500 Original-Received: from mail.elken.dev ([165.22.120.78]:45553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWClq-0005xG-RC for 61411@debbugs.gnu.org; Sun, 26 Feb 2023 03:52:39 -0500 Original-Received: from authenticated-user (mail.elken.dev [165.22.120.78]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mail.elken.dev (Postfix) with ESMTPSA id 56CAB414E8; Sun, 26 Feb 2023 09:52:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elken.dev; s=mail; t=1677401552; bh=WEK/otyjKHH6bkmRXvL7nretpBI6omP/BccrjOpOgg0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=B9mGuD3nWJtD0urCHwkE/DrhCvB2DvojZGzopiK8UHZwkTH/wcLK+4JrlIvwdm0Ja 8qjoLdIFZMMEnSz1+S/API6zsW3TZrOCyxFiD49DJhC+cwvm18iZNsaPGecD+vPXYq jGNgv8iXGiLaekoxyW3ZpbOcUDfgPM/MYfjDo4z/+6xs/A1DMF6rcljuhGqB7qOSNJ m/HWMLAKHc7sX8OXnMu25QxD5W1fkLFpG/XfHd5Fo6EvILVZEZiUTGl84hlfYOWJhO EJplg1jTu10+xbuqKmE1BBCnhfuvSCZdmeFrfRXXR9mH23XDWKjkKfdKko4fZhRLkc e8qvsOmd56h0Q== In-Reply-To: <83sfetj8p2.fsf@gnu.org> X-Sender: me@elken.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256776 Archived-At: Hi Eli, Thanks for responding; I incorrectly assumed because the patch was so trivial my description was enough. My bad! Below is a snippet of elisp that when `M-x eval-buffer`'d crashes an `emacs -Q` and causes an `emacs -Q -l repro.el` to freeze indefinitely on e444115d026c809395d4d248a99bb467bc87bb1d (require 'url) (eval-when-compile (require 'cl-lib)) (cl-defun send-request (endpoint &key verb data headers noninteractive json noauth sync callback) (let* ((url-request-method (or verb "GET")) (url-cookie-trusted-urls '(".*")) (url-request-noninteractive noninteractive) (url-request-extra-headers `(("Referer" . ,endpoint) ("X-CSRF-TOKEN" . nil) ("Cookie" . nil))) (url-request-data data)) (if sync (with-current-buffer (url-retrieve-synchronously endpoint) (funcall (or callback #'identity) url-http-response-status)) (url-retrieve endpoint (or callback #'identity))))) (send-request "https://httpstat.us/401" :noninteractive t :sync t) The linked API is a simple service used to return various status codes, in this instance always a 401 regardless of what authentication is passed. I'm not sure if my patch is the best catch-all solution to the underlying issue (I confess, I don't fully understand why this crashes). With my simple patch applied though, Emacs continues as expected. I hope this is enough information now, I apologize for the poor initial report. As I already had a patch ready, I didn't think I should have used `M-x report-emacs-bug` but I will in future :)