From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <8337q0mpe7.fsf@gnu.org> <83twigl7mn.fsf@gnu.org> <83lh3skybm.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0934b60291aa0531e437f7 X-Trace: ger.gmane.org 1462231184 9247 80.91.229.3 (2 May 2016 23:19:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 May 2016 23:19:44 +0000 (UTC) Cc: 23424@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 03 01:19:33 2016 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 1axN7l-0005Oq-K7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 May 2016 01:19:33 +0200 Original-Received: from localhost ([::1]:39012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axN7h-0006Ru-Dw for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 May 2016 19:19:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axN7X-0006DZ-7O for bug-gnu-emacs@gnu.org; Mon, 02 May 2016 19:19:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axN7K-00031H-Sn for bug-gnu-emacs@gnu.org; Mon, 02 May 2016 19:19:13 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axN7J-00030e-Ly for bug-gnu-emacs@gnu.org; Mon, 02 May 2016 19:19:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1axN7G-0004pX-Aa for bug-gnu-emacs@gnu.org; Mon, 02 May 2016 19:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 May 2016 23:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23424 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23424-submit@debbugs.gnu.org id=B23424.146223113618555 (code B ref 23424); Mon, 02 May 2016 23:19:02 +0000 Original-Received: (at 23424) by debbugs.gnu.org; 2 May 2016 23:18:56 +0000 Original-Received: from localhost ([127.0.0.1]:34372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axN7A-0004pD-2F for submit@debbugs.gnu.org; Mon, 02 May 2016 19:18:56 -0400 Original-Received: from mail-oi0-f45.google.com ([209.85.218.45]:34006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axN78-0004p1-FO for 23424@debbugs.gnu.org; Mon, 02 May 2016 19:18:54 -0400 Original-Received: by mail-oi0-f45.google.com with SMTP id k142so4548523oib.1 for <23424@debbugs.gnu.org>; Mon, 02 May 2016 16:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HlePggNONgMRqyv9tRWuGhxpKc8IoycOFi2z0Ab6fOI=; b=aVdDIr20uoFAvC3ecvlWF8Zad7vsQZ4kuNPXM7ZtZhye/Rgs+x+kbyQBJ95YBeTRrf o6r2erKGGOH/01vICC03/D91lOtyZGPsazQPM+hBsv4vK6OOhFGn22XBxVq/6EwGbnSy qTfQDEKvPArlTVQ+Ln1ZmnBWfF8WecrWx7mXCid7y+z924prGzl7FjfedEKtKp70THeD MXLxHfV65sUPiomnW8gEQIO2fDpFst4yuwUbkiWxISeZ190gjN5fBxQj4O0GLG6xFrz0 b2dolcnvac5IUmGqSSztIgoRJPWP3a2gimVRuR93p5zZqPaUUWitK47QFKBNyV2va923 AaUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HlePggNONgMRqyv9tRWuGhxpKc8IoycOFi2z0Ab6fOI=; b=QMr3mOXdYu/LbjkSyZM7agi08ctDaSVn+RZBgrvTnnKFIDgBes3qqTeOdYmrihg0Ls tj/isRkl7WKL8AtzW48PhF/UKfyq6jCmI0JtqOIpHWvfb72dVng0ohARR3R819cPjOgc A+jT/mEf3ge0m4Emb+BEpOMDq5zjgo2J+GKiyk6HwIr+QH7l9nsBW2/TEsuGssXsHy8r 1XYkVSpIEV06m7Pack33kz1EewS4ESQb36eAp6ECOMKq0vBOExWgGj9SyL8DZwBBHEcX g0lnHgKqi2Smho7XDZv91/ETmouC6pKPgPaDwb6u4FFZ7lll0woxSZanwSOVMk1yTQv+ 0Kdw== X-Gm-Message-State: AOPr4FVGRgOvT9CVM2xHatNzcMnxKR/nE42kambje/9Gu2i+9i5VhCs+lx0A6xKH7pAz/rl7fVWNzqMLxYVKLQ== X-Received: by 10.157.6.80 with SMTP id 74mr16248278otn.164.1462231128771; Mon, 02 May 2016 16:18:48 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:117625 Archived-At: --94eb2c0934b60291aa0531e437f7 Content-Type: text/plain; charset=UTF-8 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 [("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 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 [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 --94eb2c0934b60291aa0531e437f7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I was finally able to get the backtrace for end-of-file af= ter rebuilding emacs without those 2 assertion check flags.

So the last elisp-land function to p= ropagate the error was in url-http.el:

=3D=3D=3D= =3D=3D
(defun url-http-activate-callback ()
=C2=A0= "Activate callback specified when this buffer was created."
=C2=A0 (url-http-mark-connection-as-free (url-host url-current-object= )
=C2=A0 =C2=A0(url-port url-current-object)
=C2=A0 =C2=A0url-http-= process)
=C2=A0 (url-http-debug "Activating callback in buff= er (%s): %S %S"
=C2=A0(buffer-name) url-callback-function url-callba= ck-arguments)
=C2=A0 (apply url-callback-function url-callback-ar= guments))
=3D=3D=3D=3D=3D

I see th= at 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)" resul= ts in error?

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

=3D=3D=3D=3D=3D
(defun url-http-activate= -callback ()
=C2=A0 "Activate callback specified when this b= uffer was created."
=C2=A0 (url-http-mark-connection-as-free= (url-host url-current-object)
=C2=A0 =C2=A0(url-port url-current-objec= t)
<= /span> =C2=A0 =C2=A0url-http-process)
=C2=A0 (url-http-debug &quo= t;Activating callback in buffer (%s): %S %S"
=C2=A0(buffer-name) url= -callback-function url-callback-arguments)
=C2=A0 (message "= url-callback-function: %S" url-callback-function)
=C2=A0 (apply url-callback-function url-callback-argu= ments))
=3D=3D=3D=3D=3D

I get:

=3D= =3D=3D=3D=3D
url-callback-function: #[257 <byte-co= de> [("melpa-fake" . "https://gist.githubusercontent.com/kaushalmodi/= 0603d601d84fc3282a34f08d3fe75f30/raw/597a359fba08dac61ff20e1ece6437b406a5a6= 22/") "archive-contents" t "https://gist.github= usercontent.com/kaushalmodi/0603d601d84fc3282a34f08d3fe75f30/raw/597a359fba= 08dac61ff20e1ece6437b406a5a622/archive-contents" package-user-dir = package-check-signature require url-handlers generate-new-buffer " *te= mp*" make-byte-code 0 <byte-code> vconcat vector [buffer-name ki= ll-buffer] 2 (error) plist-get :error error "Error retrieving: %s %S&q= uot; search-forward-regexp "^
?

?&q= uot; nil noerror "incomprehensible buffer" url-insert-buffer-cont= ents kill-buffer t package--update-downloads-in-progress signal buffer-stri= ng expand-file-name format "archives/%s" read-from-string make-di= rectory write-region silent package--check-signature 256 <byte-code> = [write-region nil silent mapconcat epg-signature-to-string "
" ".signed"] 7 "

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

(fn STATUS)"]
error in process filter: End of file du= ring parsing [2 times]
=3D=3D=3D=3D=3D

So can we have something like:
- If=C2=A0=C2=A0(apply url-callback= -function url-callback-arguments) returns an error, then extract the url be= ing fetched from url-callback-function and print some like "Error incu= rred when when processing XYZ url.". In this case, we know that read-f= rom-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 m= ean that it read an empty string; in this case the lisp form was incomplete= ).=C2=A0

=
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 i= n that var, we can have a well constructed error message that can tell us w= hat exactly went wrong. What do you think?=C2=A0
--

--
Kaushal Modi

--94eb2c0934b60291aa0531e437f7--