unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 23424@debbugs.gnu.org
Subject: bug#23424: 25.0.93; error in process sentinel with Melpa added to package-archives
Date: Mon, 02 May 2016 23:18:38 +0000	[thread overview]
Message-ID: <CAFyQvY0iBYW5stC0hgrN0WsX1cmk3TBi5B91Yz=O4pEAH=K4JQ@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY3WfB6=ejZ3GVxa+6tpfs0HE53gZtAK46Ot2t8yw2RP-g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3466 bytes --]

I was finally able to get the backtrace for end-of-file after rebuilding
emacs without those 2 assertion check flags.

>
So the last elisp-land function to propagate the error was in url-http.el:

=====
(defun url-http-activate-callback ()
  "Activate callback specified when this buffer was created."
  (url-http-mark-connection-as-free (url-host url-current-object)
   (url-port url-current-object)
   url-http-process)
  (url-http-debug "Activating callback in buffer (%s): %S %S"
 (buffer-name) url-callback-function url-callback-arguments)
  (apply url-callback-function url-callback-arguments))
=====

I see that url-http-debug form but it is not run because the error appears
too soon and the user does not have change to hit C-g to make the info
print in url-http-debug. So how about printing that info if "(apply
url-callback-function url-callback-arguments)" results in error?

With the above "melpa-fake" archive from my gist.github.com and a modified
version of url-http-activate-callback as below:

=====
(defun url-http-activate-callback ()
  "Activate callback specified when this buffer was created."
  (url-http-mark-connection-as-free (url-host url-current-object)
   (url-port url-current-object)
   url-http-process)
  (url-http-debug "Activating callback in buffer (%s): %S %S"
 (buffer-name) url-callback-function url-callback-arguments)
  (message "url-callback-function: %S" url-callback-function)
  (apply url-callback-function url-callback-arguments))
=====

I get:

=====
url-callback-function: #[257 <byte-code> [("melpa-fake" . "
https://gist.githubusercontent.com/kaushalmodi/0603d601d84fc3282a34f08d3fe75f30/raw/597a359fba08dac61ff20e1ece6437b406a5a622/")
"archive-contents" t "
https://gist.githubusercontent.com/kaushalmodi/0603d601d84fc3282a34f08d3fe75f30/raw/597a359fba08dac61ff20e1ece6437b406a5a622/archive-contents"
package-user-dir package-check-signature require url-handlers
generate-new-buffer " *temp*" make-byte-code 0 <byte-code> vconcat vector
[buffer-name kill-buffer] 2 (error) plist-get :error error "Error
retrieving: %s %S" search-forward-regexp "^
?

?" nil noerror "incomprehensible buffer" url-insert-buffer-contents
kill-buffer t package--update-downloads-in-progress signal buffer-string
expand-file-name format "archives/%s" read-from-string make-directory
write-region silent package--check-signature 256 <byte-code> [write-region
nil silent mapconcat epg-signature-to-string "
" ".signed"] 7 "

(fn &optional GOOD-SIGS)" "\301\300!\207"
[package--update-downloads-in-progress] package-unsigned-archives] 20 "

(fn STATUS)"]
error in process filter: End of file during parsing [2 times]
=====

So can we have something like:
- If  (apply url-callback-function url-callback-arguments) returns an
error, then extract the url being fetched from url-callback-function and
print some like "Error incurred when when processing XYZ url.". In this
case, we know that read-from-string threw an error. So we can even say that
the string fetched from XYZ url could not be parsed as a valid lisp form
(it does not necessarily mean that it read an empty string; in this case
the lisp form was incomplete).

The value of url-callback-function has a lot of other info which I do not
understand (I spy mainly the URL in it and "read-from-string" in it). But
may be using all the info in that var, we can have a well constructed error
message that can tell us what exactly went wrong. What do you think?
-- 

-- 
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 5740 bytes --]

  reply	other threads:[~2016-05-02 23:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02 15:19 bug#23424: 25.0.93; error in process sentinel with Melpa added to package-archives Kaushal Modi
2016-05-02 15:49 ` Eli Zaretskii
2016-05-02 15:54   ` Robert Pluim
2016-05-02 16:23     ` Eli Zaretskii
2016-05-02 16:22   ` Kaushal Modi
2016-05-02 16:41     ` Kaushal Modi
2016-05-02 16:54       ` Kaushal Modi
2016-05-02 16:58       ` Eli Zaretskii
2016-05-02 17:22         ` Kaushal Modi
2016-05-02 20:19           ` Eli Zaretskii
2016-05-02 20:51             ` Kaushal Modi
2016-05-02 22:05               ` Kaushal Modi
2016-05-02 23:18                 ` Kaushal Modi [this message]
2016-05-03 14:59                   ` Eli Zaretskii
2016-05-03 15:12                 ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAFyQvY0iBYW5stC0hgrN0WsX1cmk3TBi5B91Yz=O4pEAH=K4JQ@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=23424@debbugs.gnu.org \
    --cc=eliz@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).