From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Newsgroups: gmane.emacs.bugs Subject: bug#18116: 24.3.92; url-http calls CALLBACK recursively with malformed CBARGS if the former calls `delete-process' Date: Sun, 27 Jul 2014 06:12:57 +0300 Message-ID: <86ppgr4hqe.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1406430863 16861 80.91.229.3 (27 Jul 2014 03:14:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jul 2014 03:14:23 +0000 (UTC) To: 18116@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 27 05:14:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XBEue-0006jj-9w for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Jul 2014 05:14:16 +0200 Original-Received: from localhost ([::1]:33709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBEud-0000ZS-Jl for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Jul 2014 23:14:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBEuV-0000ZK-VQ for bug-gnu-emacs@gnu.org; Sat, 26 Jul 2014 23:14:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBEuR-00009t-7U for bug-gnu-emacs@gnu.org; Sat, 26 Jul 2014 23:14:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBEuR-00009p-3F for bug-gnu-emacs@gnu.org; Sat, 26 Jul 2014 23:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XBEuQ-0006BS-LV for bug-gnu-emacs@gnu.org; Sat, 26 Jul 2014 23:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Jul 2014 03:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18116 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.140643080823719 (code B ref -1); Sun, 27 Jul 2014 03:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jul 2014 03:13:28 +0000 Original-Received: from localhost ([127.0.0.1]:39148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBEtr-0006AU-Aa for submit@debbugs.gnu.org; Sat, 26 Jul 2014 23:13:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48485) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XBEto-0006AE-81 for submit@debbugs.gnu.org; Sat, 26 Jul 2014 23:13:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBEtd-0008US-TR for submit@debbugs.gnu.org; Sat, 26 Jul 2014 23:13:18 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBEtd-0008UL-Pm for submit@debbugs.gnu.org; Sat, 26 Jul 2014 23:13:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBEtY-0000Od-RX for bug-gnu-emacs@gnu.org; Sat, 26 Jul 2014 23:13:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBEtU-0008TU-2P for bug-gnu-emacs@gnu.org; Sat, 26 Jul 2014 23:13:08 -0400 Original-Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:35570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBEtT-0008TM-Qm for bug-gnu-emacs@gnu.org; Sat, 26 Jul 2014 23:13:03 -0400 Original-Received: by mail-we0-f176.google.com with SMTP id q58so5750857wes.7 for ; Sat, 26 Jul 2014 20:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=iK9WwqdwlsXyF+bJOcJepKO8hYTXOujFLORMUloAyqc=; b=pJzqrgPj0ZZ8iXMJmxPQ7kdbVgcyiuVWM5e1367ZFKEsdpVbSNDkKF5BhKVb5Mhtvs qoJsdEc8cn7y8xNWs5SnQIH7x+JO0CIuuFazJvK3aeaNEves77gIVCUMp46hdwzQhR4J PV7jHU1xZi3fbpgECtMqfKYgyQRBO8nx4+esVVQcHqiKiCot9iRZ5UcsCLQP7qFHAMZx pKQ3UHPg5m8BzurUPVLNgZS78n3we2si9G5v32AsFWchW/ub3t5h58vW62hP2Bc30j0W WvCA5XAtTZ7vreAZKwQMRbbuRCUaFa7/Qat+ZSIhHM+EbaKqYk44/L8i3/s/o4p+waiJ KeAg== X-Received: by 10.180.19.200 with SMTP id h8mr17833192wie.32.1406430782455; Sat, 26 Jul 2014 20:13:02 -0700 (PDT) Original-Received: from axl (93-109-244.netrun.cytanet.com.cy. [93.109.109.244]) by mx.google.com with ESMTPSA id es9sm34038091wjd.1.2014.07.26.20.13.00 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 26 Jul 2014 20:13:01 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91837 Archived-At: Note: this could be considered a regression from Emacs 24.3 With this test case: ``` (require 'url-http) (defvar uht-counter 0) (defun uht-callback (status) (declare (special url-http-process)) (message "%s %s" uht-counter status) (delete-process url-http-process)) (defun uht-test () (setq uht-counter (1+ uht-counter)) ;; The port must not be open. (url-http (url-generic-parse-url "http://localhost:3333") #'uht-callback (list 'foo))) ``` Evaluate `(uht-test)' and see two messages in the message log with the same counter value. The second message outputs a different STATUS value, caused by modification of `url-callback-arguments' in `url-http-async-sentinel', like this: 4 (:error (error connection-failed failed with code 111 :host localhost :service 3333) . foo) 4 (:error (error connection-failed deleted :host localhost :service 3333) :error (error connection-failed failed with code 111 :host localhost :service 3333) . foo) If the callback expects STATUS to contain some specific data structure, that can cause breakage, see https://github.com/marijnh/tern/issues/350 for an example. Now, I'm not entirely sure the problem is in `url-http'. It does not manifest in Emacs 24.3, possibly because in the current pretest, when the connection fails, the `url-http-process' is still alive when `delete-process' is called in `uht-callback'. This is not the case in the current stable Emacs (wherein, as a consequence, `uht-callback' doesn't get called the second time), so this could be a regression in the processes subsystem. In GNU Emacs 24.3.92.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-07-24 on axl Repository revision: 117398 stephen.berman@gmx.net-20140722213204-51v7bp0chfei6wbx Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS