all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry <dgutov@yandex.ru>
To: 18116@debbugs.gnu.org
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	[thread overview]
Message-ID: <86ppgr4hqe.fsf@yandex.ru> (raw)

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





             reply	other threads:[~2014-07-27  3:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-27  3:12 Dmitry [this message]
2014-08-13 17:06 ` bug#18116: 24.3.92; url-http calls CALLBACK recursively with malformed CBARGS if the former calls `delete-process' Glenn Morris
2014-08-18 19:34 ` Óscar Fuentes
2014-09-10  2:24 ` Stefan Monnier
2014-09-11  1:52   ` Dmitry Gutov
2014-09-12 17:22     ` Stefan Monnier
2014-09-19  2:00       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ppgr4hqe.fsf@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=18116@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.