From unknown Tue Aug 19 02:58:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19768: json.el: end-of-file errors untrappable Resent-From: era eriksson Original-Sender: "Debbugs-submit" Resent-CC: era+emacs@iki.fi, bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Feb 2015 14:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19768 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 19768@debbugs.gnu.org Cc: era+emacs@iki.fi X-Debbugs-Original-To: submit@debbugs.gnu.org X-Debbugs-Original-Xcc: era+emacs@iki.fi Received: via spool by submit@debbugs.gnu.org id=B.142305838632398 (code B ref -1); Wed, 04 Feb 2015 14:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Feb 2015 13:59:46 +0000 Received: from localhost ([127.0.0.1]:33543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ0Ub-0008QU-UW for submit@debbugs.gnu.org; Wed, 04 Feb 2015 08:59:46 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:32939) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ0Ua-0008QM-A4 for submit@debbugs.gnu.org; Wed, 04 Feb 2015 08:59:45 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C335820A9C for ; Wed, 4 Feb 2015 08:59:43 -0500 (EST) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Wed, 04 Feb 2015 08:59:43 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:subject :date; s=smtpout; bh=0PyhP+vlxUGi7CH/0mxsnasu66A=; b=dD1y4wbVY8f jdcoAbf2h5s6OvHbfDYs9v3vDHOg0VphTaqhxC9w7H7RODSvyNcKbzyn2EPc1HG8 2Gny5yt3vVHvjCmLfV6fntNmOe/9L5lytgtkgUAvhYw+KqGa6e0kPc8JlHVeHyYb BK+fKYd0TViSKd+wZ3TVBnFOdIEwMgWc= Received: by web5.nyi.internal (Postfix, from userid 99) id 993B2B644B2; Wed, 4 Feb 2015 08:59:43 -0500 (EST) Message-Id: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> X-Sasl-Enc: GwU4iU/6aqXMVTO14uBSJhfHRwCOpNw8JdzVrfskFfHC 1423058383 From: era eriksson MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-b6284d51 Date: Wed, 04 Feb 2015 15:59:43 +0200 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Package: emacs Version: 24.3.1 X-Debbugs-Cc: era+emacs@iki.fi The code in json.el uses (signal 'end-of-file) in many scenarios. Unfortunately, the default value of debug-ignore-errors causes these errors to bypass any error checking, and unhelpfully land in the *Messages* buffer with little indication as to what went wrong or which code path caused this message. Once you know this, debugging json-read is easy; but the fix is unobvious, and might have unintended side effects. Steps to repro: (require 'json) (setq debug-on-error t) (json-read-from-string "") Expected result: *Backtrace* showing where something went wrong Actual result: json-read: End of file during parsing (The "json-read:" prefix is not visible in the minibuffer message for me, but it lands in the *Messages* buffer.) Workaround: (let (debug-ignore-errors) (json-read-from-string "")) I'm not sure what the proper fix should be. Maybe these occurrences could be changed to json-end-of-file or something? Or maybe json-read could include the 'let' form from the workaround. See also: http://stackoverflow.com/questions/28317081/debug-on-error-vs-debug-on-signal-in-json-el-in-particular /* era */ -- If this were a real .signature, it would suck less. Well, maybe not. From unknown Tue Aug 19 02:58:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19768: json.el: end-of-file errors untrappable Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Feb 2015 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19768 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: era eriksson Cc: 19768@debbugs.gnu.org, era+emacs@iki.fi Received: via spool by 19768-submit@debbugs.gnu.org id=B19768.142306410814466 (code B ref 19768); Wed, 04 Feb 2015 15:36:02 +0000 Received: (at 19768) by debbugs.gnu.org; 4 Feb 2015 15:35:08 +0000 Received: from localhost ([127.0.0.1]:34027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ1yt-0003lF-6y for submit@debbugs.gnu.org; Wed, 04 Feb 2015 10:35:07 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:49598) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ1yq-0003l6-J0 for 19768@debbugs.gnu.org; Wed, 04 Feb 2015 10:35:04 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t14FYwVg016245; Wed, 4 Feb 2015 10:34:58 -0500 Received: by pastel.home (Postfix, from userid 20848) id 21FE41758; Wed, 4 Feb 2015 10:34:58 -0500 (EST) From: Stefan Monnier Message-ID: References: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> Date: Wed, 04 Feb 2015 10:34:58 -0500 In-Reply-To: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> (era eriksson's message of "Wed, 04 Feb 2015 15:59:43 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV5207=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5207> : inlines <2031> : streams <1384669> : uri <1846255> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > I'm not sure what the proper fix should be. Maybe these occurrences > could be changed to json-end-of-file or something? That sounds right. If we define json-end-of-file as an error which as `end-of-file' as parent, it should give us the best of both worlds. Stefan From unknown Tue Aug 19 02:58:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19768: json.el: end-of-file errors untrappable Resent-From: era eriksson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Feb 2015 11:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19768 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 19768@debbugs.gnu.org Received: via spool by 19768-submit@debbugs.gnu.org id=B19768.142313709411425 (code B ref 19768); Thu, 05 Feb 2015 11:52:02 +0000 Received: (at 19768) by debbugs.gnu.org; 5 Feb 2015 11:51:34 +0000 Received: from localhost ([127.0.0.1]:34579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJKy5-0002yC-PH for submit@debbugs.gnu.org; Thu, 05 Feb 2015 06:51:34 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54663) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJKy3-0002y4-Fz for 19768@debbugs.gnu.org; Thu, 05 Feb 2015 06:51:32 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2A38320E24 for <19768@debbugs.gnu.org>; Thu, 5 Feb 2015 06:51:31 -0500 (EST) Received: from web5 ([10.202.2.215]) by compute5.internal (MEProxy); Thu, 05 Feb 2015 06:51:31 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to:cc :mime-version:content-transfer-encoding:content-type:in-reply-to :references:subject:date; s=smtpout; bh=9s50eEQsN44Anc461PH8hIc0 UIY=; b=Qx/HcCmbXbGACd0CJyNlpjDnyZOHSpsLDWcT0I4skryWklusG08HWGci iGrpLr7w9A5i46Cs+tPQXFJNfcd5YiS+9dYEUFV5GTMZzSQwyInNjtSwP8b9fxlR wK5veaHTJvnTI+m89d/qprYpCXIvc3psJvK2/h7sbfMxGTmfzxA= Received: by web5.nyi.internal (Postfix, from userid 99) id F3DF6A67AE8; Thu, 5 Feb 2015 06:51:30 -0500 (EST) Message-Id: <1423137090.527204.223447373.25D98B2F@webmail.messagingengine.com> X-Sasl-Enc: si/TgyAICIAmx6zm7qlARSo4M48pTfk29GKZUpccsLv4 1423137090 From: era eriksson MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-b6284d51 In-Reply-To: References: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> Date: Thu, 05 Feb 2015 13:51:30 +0200 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Wed, Feb 4, 2015, at 17:34, Stefan Monnier wrote: > > I'm not sure what the proper fix should be. Maybe these occurrences > > could be changed to json-end-of-file or something? > > That sounds right. If we define json-end-of-file as an error which as > `end-of-file' as parent, it should give us the best of both worlds. https://github.com/tripleee/emacs/tree/bug19768 contains a simple patch which implements this, but I am uncertain how to test it. Also, I am having second thoughts about defining the new error symbol as a child of 'end-of-file when all the other error symbols neatly inherit from 'json-error. Anyway, feel free to review and/or pull and/or ignore. (-: /* era */ -- If this were a real .signature, it would suck less. Well, maybe not. From unknown Tue Aug 19 02:58:54 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: era eriksson Subject: bug#19768: closed (Re: bug#19768: json.el: end-of-file errors untrappable) Message-ID: References: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> X-Gnu-PR-Message: they-closed 19768 X-Gnu-PR-Package: emacs Reply-To: 19768@debbugs.gnu.org Date: Thu, 05 Feb 2015 19:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1423165982-11649-1" This is a multi-part message in MIME format... ------------=_1423165982-11649-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #19768: json.el: end-of-file errors untrappable which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 19768@debbugs.gnu.org. --=20 19768: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19768 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1423165982-11649-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19768-done) by debbugs.gnu.org; 5 Feb 2015 19:52:48 +0000 Received: from localhost ([127.0.0.1]:35039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJSTo-00031S-6g for submit@debbugs.gnu.org; Thu, 05 Feb 2015 14:52:48 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:44391) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJSTm-00031K-W4 for 19768-done@debbugs.gnu.org; Thu, 05 Feb 2015 14:52:47 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t15JqdW6014467; Thu, 5 Feb 2015 14:52:39 -0500 Received: by pastel.home (Postfix, from userid 20848) id 690A710A1; Thu, 5 Feb 2015 14:52:39 -0500 (EST) From: Stefan Monnier To: era eriksson Subject: Re: bug#19768: json.el: end-of-file errors untrappable Message-ID: References: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> <1423137090.527204.223447373.25D98B2F@webmail.messagingengine.com> Date: Thu, 05 Feb 2015 14:52:39 -0500 In-Reply-To: <1423137090.527204.223447373.25D98B2F@webmail.messagingengine.com> (era eriksson's message of "Thu, 05 Feb 2015 13:51:30 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5208=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5208> : inlines <2040> : streams <1385310> : uri <1847337> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 19768-done Cc: 19768-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > https://github.com/tripleee/emacs/tree/bug19768 contains a simple patch > which implements this, but I am uncertain how to test it. Also, I am > having second thoughts about defining the new error symbol as a child of > 'end-of-file when all the other error symbols neatly inherit from > 'json-error. Anyway, feel free to review and/or pull and/or ignore. (-: Installed, making it inherit from both kinds of errors ;-) Stefan ------------=_1423165982-11649-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Feb 2015 13:59:46 +0000 Received: from localhost ([127.0.0.1]:33543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ0Ub-0008QU-UW for submit@debbugs.gnu.org; Wed, 04 Feb 2015 08:59:46 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:32939) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YJ0Ua-0008QM-A4 for submit@debbugs.gnu.org; Wed, 04 Feb 2015 08:59:45 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C335820A9C for ; Wed, 4 Feb 2015 08:59:43 -0500 (EST) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Wed, 04 Feb 2015 08:59:43 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:subject :date; s=smtpout; bh=0PyhP+vlxUGi7CH/0mxsnasu66A=; b=dD1y4wbVY8f jdcoAbf2h5s6OvHbfDYs9v3vDHOg0VphTaqhxC9w7H7RODSvyNcKbzyn2EPc1HG8 2Gny5yt3vVHvjCmLfV6fntNmOe/9L5lytgtkgUAvhYw+KqGa6e0kPc8JlHVeHyYb BK+fKYd0TViSKd+wZ3TVBnFOdIEwMgWc= Received: by web5.nyi.internal (Postfix, from userid 99) id 993B2B644B2; Wed, 4 Feb 2015 08:59:43 -0500 (EST) Message-Id: <1423058383.3713286.222999749.0FE1B22B@webmail.messagingengine.com> X-Sasl-Enc: GwU4iU/6aqXMVTO14uBSJhfHRwCOpNw8JdzVrfskFfHC 1423058383 From: era eriksson To: submit@debbugs.gnu.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-b6284d51 Subject: json.el: end-of-file errors untrappable Date: Wed, 04 Feb 2015 15:59:43 +0200 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Package: emacs Version: 24.3.1 X-Debbugs-Cc: era+emacs@iki.fi The code in json.el uses (signal 'end-of-file) in many scenarios. Unfortunately, the default value of debug-ignore-errors causes these errors to bypass any error checking, and unhelpfully land in the *Messages* buffer with little indication as to what went wrong or which code path caused this message. Once you know this, debugging json-read is easy; but the fix is unobvious, and might have unintended side effects. Steps to repro: (require 'json) (setq debug-on-error t) (json-read-from-string "") Expected result: *Backtrace* showing where something went wrong Actual result: json-read: End of file during parsing (The "json-read:" prefix is not visible in the minibuffer message for me, but it lands in the *Messages* buffer.) Workaround: (let (debug-ignore-errors) (json-read-from-string "")) I'm not sure what the proper fix should be. Maybe these occurrences could be changed to json-end-of-file or something? Or maybe json-read could include the 'let' form from the workaround. See also: http://stackoverflow.com/questions/28317081/debug-on-error-vs-debug-on-signal-in-json-el-in-particular /* era */ -- If this were a real .signature, it would suck less. Well, maybe not. ------------=_1423165982-11649-1--