GNU bug report logs - #42499
[PATCH] Add Bytecode Offset information to Backtrace

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Zach Shaftel <zshaftel@HIDDEN>; Keywords: patch; dated Thu, 23 Jul 2020 23:31:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 42499 <at> debbugs.gnu.org:


Received: (at 42499) by debbugs.gnu.org; 18 Oct 2020 15:03:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 18 11:03:15 2020
Received: from localhost ([127.0.0.1]:38846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kUADK-0006OY-Ud
	for submit <at> debbugs.gnu.org; Sun, 18 Oct 2020 11:03:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37114)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kUADA-0006Nq-Fg
 for 42499 <at> debbugs.gnu.org; Sun, 18 Oct 2020 11:03:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44515)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kUAD5-0005sU-6o; Sun, 18 Oct 2020 11:02:59 -0400
Received: from [176.228.60.248] (port=1851 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kUAD4-0001Qn-C2; Sun, 18 Oct 2020 11:02:58 -0400
Date: Sun, 18 Oct 2020 18:03:02 +0300
Message-Id: <831rhvshjt.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87h7qskl6y.fsf@HIDDEN> (message from Lars Ingebrigtsen on Sun, 
 18 Oct 2020 10:11:33 +0200)
Subject: Re: bug#42499: [PATCH] Add Bytecode Offset information to Backtrace
References: <87tuxxzucm.fsf@HIDDEN> <87ft6dusmq.fsf@HIDDEN>
 <83h7qttcxw.fsf@HIDDEN> <87h7qskl6y.fsf@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 42499
Cc: zshaftel@HIDDEN, 42499 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Cc: zshaftel@HIDDEN,  42499 <at> debbugs.gnu.org
> Date: Sun, 18 Oct 2020 10:11:33 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > I don't think we should start dismissing .elc compiled files just
> > because native compilation is on the horizon.  Some users might
> > legitimately decide they don't want their Lisp natively-compiled, or
> > may be unable to do so because of the GCC version they have
> > installed.  We should continue supporting byte-compilation features
> > for the next few versions at least.
> 
> Yes, of course.  The only question is whether it makes sense to add new,
> advanced features that is only relevant for .elc files at this point

I think it does, for those very reasons.  We cannot deprecate .elc
files, certainly not yet.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42499; Package emacs. Full text available.

Message received at 42499 <at> debbugs.gnu.org:


Received: (at 42499) by debbugs.gnu.org; 18 Oct 2020 08:11:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 18 04:11:46 2020
Received: from localhost ([127.0.0.1]:36122 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kU3n7-0006B7-Vw
	for submit <at> debbugs.gnu.org; Sun, 18 Oct 2020 04:11:46 -0400
Received: from quimby.gnus.org ([95.216.78.240]:48638)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kU3n5-0006At-Rr
 for 42499 <at> debbugs.gnu.org; Sun, 18 Oct 2020 04:11:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=iONHBQSKz9kebzhvSic2dWu3d4v42HYxOrboiTLGGes=; b=UpQuAXwukkvnlVKKFhdN+BIku+
 G3cwDLhh+ayrs9bfbMYAWgTbcBg2hhc/YhNU+zP2DpElS+ovMA5pmGvT8sD5MokaXtJblw81skgAF
 hFkUHtIR3naegNMyHGQutrxZvjdam3ZnxBfJ5S0gvyvWoIcmlaGCxH9Q94bMqVu7IJXM=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kU3mw-0006Hw-KN; Sun, 18 Oct 2020 10:11:38 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#42499: [PATCH] Add Bytecode Offset information to Backtrace
References: <87tuxxzucm.fsf@HIDDEN> <87ft6dusmq.fsf@HIDDEN>
 <83h7qttcxw.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEVDNUhYT2KHdIYf
 GCT0zK+oXWX////KAn60AAAAAWJLR0QGYWa4fQAAAAd0SU1FB+QKEgciIGgyBOwAAAG7SURBVDjL
 XZRBcsMgDEWlquzBHvY2SfakTA/Qjr13Oub+V6mEwNAyWWT0pP9BCAMAoHV1TZQSB6z8Iv+BC9yS
 LECnoFVMISRdkg14FTgXbqmhCBYHsAzAdXMX1g6InTq4UwMp4VhxXzqA0eP+TQ1E7CCE+zZ386sk
 CLhdQCuwgu/5OmIBVk4Z2GNu5qjnsKI3jQcEBQQqlkYgyaCdWUZQmkjFy7awycXcWqBS0uJ+24oU
 WydJqDuKHFeA5V7AaTfAnwr6BZd05/N2ASpAlPBV8qsUJQHISv5lNN5AqWPXPNd4ATMUQNHl/Lnl
 LkUVPH0+TB6kSDdFbz4TXlLcQQUoIJpt8KCyW5yRwXsHFitIi8/QAceoaGGyJhszANSOTOTM8e4H
 DwbiFGg1x3mMB+Qbj8iPZkV77gOQKREaA1q//QM8IPNHsHB5XyC4eXossfV2yxVMqyOew96RrHfq
 pgViCKuFP8AKwGd4vJz1/yr4UcXw+Fmduu/b0QDPFLKWU5PcgeMR4We+Kjh3HajyDig9xV7BVywf
 DlAgYk7c9/OQgUYlc5m2qQJTkgWgTnpEnsM9v7wagzyoOtEK8i+W2o66dNtRxAAAACV0RVh0ZGF0
 ZTpjcmVhdGUAMjAyMC0xMC0xOFQwNzozNDozMiswMDowMGkk31EAAAAldEVYdGRhdGU6bW9kaWZ5
 ADIwMjAtMTAtMThUMDc6MzQ6MzIrMDA6MDAYeWftAAAAAElFTkSuQmCC
X-Now-Playing: Rocket To The Sky's _Cigars_: "Cigars"
Date: Sun, 18 Oct 2020 10:11:33 +0200
In-Reply-To: <83h7qttcxw.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 17 Oct
 2020 12:32:43 +0300")
Message-ID: <87h7qskl6y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Eli Zaretskii <eliz@HIDDEN> writes: > I don't think we
 should
 start dismissing .elc compiled files just > because native compilation is
 on the horizon. Some users might > legitimately decide they don't want their
 Lisp natively-compiled, [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 42499
Cc: zshaftel@HIDDEN, 42499 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> I don't think we should start dismissing .elc compiled files just
> because native compilation is on the horizon.  Some users might
> legitimately decide they don't want their Lisp natively-compiled, or
> may be unable to do so because of the GCC version they have
> installed.  We should continue supporting byte-compilation features
> for the next few versions at least.

Yes, of course.  The only question is whether it makes sense to add new,
advanced features that is only relevant for .elc files at this point

> I have an email from Craig in late August saying the disclaimer is
> being submitted to legal.  Suggest to ping Craig about this.

Will do.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42499; Package emacs. Full text available.

Message received at 42499 <at> debbugs.gnu.org:


Received: (at 42499) by debbugs.gnu.org; 18 Oct 2020 04:15:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 18 00:15:53 2020
Received: from localhost ([127.0.0.1]:36024 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kU06r-0006aU-6j
	for submit <at> debbugs.gnu.org; Sun, 18 Oct 2020 00:15:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48434)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1kU06o-0006aH-VS
 for 42499 <at> debbugs.gnu.org; Sun, 18 Oct 2020 00:15:51 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38414)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>)
 id 1kU06j-0000vt-Mq; Sun, 18 Oct 2020 00:15:45 -0400
Received: from rms by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rms@HIDDEN>)
 id 1kU06g-0000ye-4o; Sun, 18 Oct 2020 00:15:42 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <83h7qttcxw.fsf@HIDDEN> (message from Eli Zaretskii on Sat, 17
 Oct 2020 12:32:43 +0300)
Subject: Re: bug#42499: [PATCH] Add Bytecode Offset information to Backtrace
References: <87tuxxzucm.fsf@HIDDEN> <87ft6dusmq.fsf@HIDDEN>
 <83h7qttcxw.fsf@HIDDEN>
Message-Id: <E1kU06g-0000ye-4o@HIDDEN>
Date: Sun, 18 Oct 2020 00:15:42 -0400
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 42499
Cc: larsi@HIDDEN, zshaftel@HIDDEN, 42499 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I don't think we should start dismissing .elc compiled files just
  > because native compilation is on the horizon.  Some users might
  > legitimately decide they don't want their Lisp natively-compiled, or
  > may be unable to do so because of the GCC version they have
  > installed.  We should continue supporting byte-compilation features
  > for the next few versions at least.

We should continue supporting byte compilation indefinitely.
My machine is slower than what you are accustomed to,
and I think that native compilation could be a big slowdown.


-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42499; Package emacs. Full text available.

Message received at 42499 <at> debbugs.gnu.org:


Received: (at 42499) by debbugs.gnu.org; 17 Oct 2020 09:32:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 17 05:32:50 2020
Received: from localhost ([127.0.0.1]:33336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kTia2-0008IR-6i
	for submit <at> debbugs.gnu.org; Sat, 17 Oct 2020 05:32:50 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49426)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kTia0-0008I7-Q9
 for 42499 <at> debbugs.gnu.org; Sat, 17 Oct 2020 05:32:49 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53174)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kTiZv-0007Mr-GG; Sat, 17 Oct 2020 05:32:43 -0400
Received: from [176.228.60.248] (port=4127 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kTiZu-0003Gt-QM; Sat, 17 Oct 2020 05:32:43 -0400
Date: Sat, 17 Oct 2020 12:32:43 +0300
Message-Id: <83h7qttcxw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87ft6dusmq.fsf@HIDDEN> (message from Lars Ingebrigtsen on Sat, 
 17 Oct 2020 11:08:29 +0200)
Subject: Re: bug#42499: [PATCH] Add Bytecode Offset information to Backtrace
References: <87tuxxzucm.fsf@HIDDEN> <87ft6dusmq.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 42499
Cc: zshaftel@HIDDEN, 42499 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Sat, 17 Oct 2020 11:08:29 +0200
> Cc: 42499 <at> debbugs.gnu.org
> 
> > If you disassemble one of the annotated functions, you can find the
> > instruction where the error occured.
> 
> Sounds useful, but probably somewhat less so since Emacs is moving to
> natively compiling Elisp in Emacs 28.  Does anybody else have an opinion
> here?

I don't think we should start dismissing .elc compiled files just
because native compilation is on the horizon.  Some users might
legitimately decide they don't want their Lisp natively-compiled, or
may be unable to do so because of the GCC version they have
installed.  We should continue supporting byte-compilation features
for the next few versions at least.

> > My copyright assignment is still pending so I assume this can't be
> > merged until I hear back from copyright-clerk.
> 
> This was in July, and I can't see your name in the copyright assingment
> file.  Did the assignment process stall?

I have an email from Craig in late August saying the disclaimer is
being submitted to legal.  Suggest to ping Craig about this.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42499; Package emacs. Full text available.

Message received at 42499 <at> debbugs.gnu.org:


Received: (at 42499) by debbugs.gnu.org; 17 Oct 2020 09:08:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 17 05:08:41 2020
Received: from localhost ([127.0.0.1]:33307 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kTiCe-0005ZH-OZ
	for submit <at> debbugs.gnu.org; Sat, 17 Oct 2020 05:08:40 -0400
Received: from quimby.gnus.org ([95.216.78.240]:37578)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kTiCd-0005Z4-FD
 for 42499 <at> debbugs.gnu.org; Sat, 17 Oct 2020 05:08:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=z493cokkFUVvnLW50M8XP9VSZlZpG92ObAPNjExuxYM=; b=erqQn/VnrVRSDcjrmYNBXj6biz
 NhHesMb1tdvXT6Mx+z61v6Ybe007cIycwSSzSeKLy6aKfUol9Jf5f99vCQVo56Avm4gKKqxiW8K5d
 xNviKf1Nzn/iPREacsV3fABuuV4gHRTAH5+Jd0xbYwZLPkbGxgEWptiguEdOhRDv5KTU=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kTiCV-0001kf-6T; Sat, 17 Oct 2020 11:08:33 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Zach Shaftel <zshaftel@HIDDEN>
Subject: Re: bug#42499: [PATCH] Add Bytecode Offset information to Backtrace
References: <87tuxxzucm.fsf@HIDDEN>
X-Now-Playing: Machinedrum's _Vapor City Citizenship Programme_: "SeeSea VIP"
Date: Sat, 17 Oct 2020 11:08:29 +0200
In-Reply-To: <87tuxxzucm.fsf@HIDDEN> (Zach Shaftel's message of "Thu, 23
 Jul 2020 19:29:48 -0400")
Message-ID: <87ft6dusmq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Zach Shaftel <zshaftel@HIDDEN> writes: > This patch adds
 the offset in a bytecode function's execution where an > error occurs to
 the *Backtrace* buffer,
 like this: > > Debugger entered--Lisp error: (wrong-type-argument
 stringp t) > string [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 42499
Cc: 42499 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Zach Shaftel <zshaftel@HIDDEN> writes:

> This patch adds the offset in a bytecode function's execution where an
> error occurs to the *Backtrace* buffer, like this:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp t)
>        string-match(t t nil)
>     13 test-condition-case()
>        load("/home/zach/.repos/bench-compare.el/test/test-debug...")
>     78 byte-recompile-file("/home/zach/.repos/bench-compare.el/test/test-debug..." nil 0 t)
>     35 emacs-lisp-byte-compile-and-load()
>        funcall-interactively(emacs-lisp-byte-compile-and-load)
>        call-interactively(emacs-lisp-byte-compile-and-load record nil)
>    101 command-execute(emacs-lisp-byte-compile-and-load record)
>
> If you disassemble one of the annotated functions, you can find the
> instruction where the error occured.

Sounds useful, but probably somewhat less so since Emacs is moving to
natively compiling Elisp in Emacs 28.  Does anybody else have an opinion
here?

> My copyright assignment is still pending so I assume this can't be
> merged until I hear back from copyright-clerk.

This was in July, and I can't see your name in the copyright assingment
file.  Did the assignment process stall?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42499; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Jul 2020 23:30:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 23 19:30:13 2020
Received: from localhost ([127.0.0.1]:46305 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jykf0-0003YP-3T
	for submit <at> debbugs.gnu.org; Thu, 23 Jul 2020 19:30:13 -0400
Received: from lists.gnu.org ([209.51.188.17]:40458)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zshaftel@HIDDEN>) id 1jykev-0003YE-RG
 for submit <at> debbugs.gnu.org; Thu, 23 Jul 2020 19:29:56 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42212)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <zshaftel@HIDDEN>)
 id 1jykev-0003ES-KQ
 for bug-gnu-emacs@HIDDEN; Thu, 23 Jul 2020 19:29:53 -0400
Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:37688)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <zshaftel@HIDDEN>)
 id 1jyket-0000cT-Kv
 for bug-gnu-emacs@HIDDEN; Thu, 23 Jul 2020 19:29:53 -0400
Received: by mail-qt1-x82d.google.com with SMTP id d27so5728993qtg.4
 for <bug-gnu-emacs@HIDDEN>; Thu, 23 Jul 2020 16:29:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=user-agent:from:to:subject:message-id:date:mime-version;
 bh=K/5X9Y0MkGonFxfpDOYPO+1IjT7XyMuLDmcoX1TjI9A=;
 b=POKEUg7fXSXvdLv4o8pKnDKHPLAmg8cod2D4iQXxhAo9ShtJS4k8FCBMtXkN6m3iQB
 UC6+pg4fp6bRXO28Z33oNUA3nOBM68Vi/12OvFeWp8tuU25d480BR2o66voxNg1rD011
 wEFUqCDNroo0u5pYEV1lLrxuGr/nYA4/63JU98WjVfOX6GjZKbYLvJ7RbJTecyg5vRb8
 O6XVTWpwuDp/1Xih8y8RSlzXxvm5j6SyQZnmVG7Xe0BBjd5+I9vu0SxxU7u02z7B3E5D
 0HjNr8lVFDhHj0OQwhNENFzhfpQk3mjrSlrBdzvUfvJj7tIbDGjC8uWzgnVEo+Fz0MaP
 CRug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:user-agent:from:to:subject:message-id:date
 :mime-version;
 bh=K/5X9Y0MkGonFxfpDOYPO+1IjT7XyMuLDmcoX1TjI9A=;
 b=gllIJ8BDGVxhqpXxqvKcyzRfuxdmI1lbgv3pxMSBgqKfwRhzjOyVa/CIr1DtCFcZvc
 5X8APgz4Ve5TXIU4zpZ+XAaldL7cW1qNGxn2RHgqRGiJ+r12jFc4fUOk3waWkB7ffpgQ
 ZmTFKcY36Oxk10c2pQ1esRoARALOF5Us1VHjGKPWHL8k17Q3YFhKCxKxdZd4SgWn1u1j
 h8CS48cfD9c0vtzf4+QiQKXTO4El4BEokrMdJIHXAXqXoWUZB97RjI1iKjBfG+pXGPHV
 lWwHd8h9FaqZxEsQZrkJ6ny5i/mIAUYniel5Y03VMELylJ/3chUsvbovscjg3b6S6nYP
 B6XQ==
X-Gm-Message-State: AOAM530fv0lQSpGMpb8Q0X/gx7tbdH1MOcFSsepAuyM4kM64kPWt7NVI
 e/+7ur31yxenORoXqxjOMvnEeUiffNc=
X-Google-Smtp-Source: ABdhPJy9EjV1PHoQWLVTleyMgbHBqdN1IoBAFL7ZwDhvG22s6ng81exsYv8aoLxJ4t7rxtvpo+7dhA==
X-Received: by 2002:ac8:5181:: with SMTP id c1mr6921661qtn.173.1595546989936; 
 Thu, 23 Jul 2020 16:29:49 -0700 (PDT)
Received: from arch-thinkpad ([2604:2000:2f41:2d00::1])
 by smtp.gmail.com with ESMTPSA id 84sm4513727qkf.136.2020.07.23.16.29.49
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 23 Jul 2020 16:29:49 -0700 (PDT)
User-agent: mu4e 1.4.10; emacs 28.0.50
From: Zach Shaftel <zshaftel@HIDDEN>
To: <bug-gnu-emacs@HIDDEN>
Subject: [PATCH] Add Bytecode Offset information to Backtrace
Message-ID: <87tuxxzucm.fsf@HIDDEN>
Date: Thu, 23 Jul 2020 19:29:48 -0400
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::82d;
 envelope-from=zshaftel@HIDDEN; helo=mail-qt1-x82d.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

This patch adds the offset in a bytecode function's execution where an
error occurs to the *Backtrace* buffer, like this:

Debugger entered--Lisp error: (wrong-type-argument stringp t)
       string-match(t t nil)
    13 test-condition-case()
       load("/home/zach/.repos/bench-compare.el/test/test-debug...")
    78 byte-recompile-file("/home/zach/.repos/bench-compare.el/test/test-debug..." nil 0 t)
    35 emacs-lisp-byte-compile-and-load()
       funcall-interactively(emacs-lisp-byte-compile-and-load)
       call-interactively(emacs-lisp-byte-compile-and-load record nil)
   101 command-execute(emacs-lisp-byte-compile-and-load record)


If you disassemble one of the annotated functions, you can find the
instruction where the error occured.

A 'bytecode_offset' field is added to the 'specbinding.bt' struct, which
holds the offset in the execution of that frame's bytecode function. The
offset for the function being executed is stored in a field of the
'thread_state' struct, and updated from within 'exec_byte_code' before a
funcall. Then 'record_in_backtrace', called by Ffuncall, finds the last
frame and stores the offset there. The frame's offset is added to the
FLAGS plist argument passed by 'mapbacktrace'.

See further discussion about the limitations of the attached
implementation here:
https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00365.html

My copyright assignment is still pending so I assume this can't be
merged until I hear back from copyright-clerk. The patch attached is a
simple diff without commit messages. I can add NEWS and Changelog
entries/commit messages if this ends up going through, but I may not be
able to get to that until next week.

-Zach


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=bytecode-offset-in-backtrace.patch

diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 37dad8db16..f67e1dd72a 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -257,7 +257,7 @@ backtrace-mode-map
     map)
   "Local keymap for `backtrace-mode' buffers.")
 
-(defconst backtrace--flags-width 2
+(defconst backtrace--flags-width 7
   "Width in characters of the flags for a backtrace frame.")
 
 ;;; Navigation and Text Properties
@@ -746,11 +746,16 @@ backtrace--print-flags
   "Print the flags of a backtrace FRAME if enabled in VIEW."
   (let ((beg (point))
         (flag (plist-get (backtrace-frame-flags frame) :debug-on-exit))
-        (source (plist-get (backtrace-frame-flags frame) :source-available)))
+        (source (plist-get (backtrace-frame-flags frame) :source-available))
+        (offset (plist-get (backtrace-frame-flags frame) :bytecode-offset))
+        ;; right justify and pad the offset (or the empty string)
+        (offset-format (format "%%%ds " (- backtrace--flags-width 3)))
+        (fun (ignore-errors (indirect-function (backtrace-frame-fun frame)))))
     (when (plist-get view :show-flags)
-      (when source (insert ">"))
-      (when flag (insert "*")))
-    (insert (make-string (- backtrace--flags-width (- (point) beg)) ?\s))
+      (insert (if source ">" " "))
+      (insert (if flag "*" " "))
+      (insert (format offset-format
+                      (or (and (byte-code-function-p fun) offset) ""))))
     (put-text-property beg (point) 'backtrace-section 'func)))
 
 (defun backtrace--print-func-and-args (frame _view)
diff --git a/src/bytecode.c b/src/bytecode.c
index 5ac30aa101..c6766a38cf 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -311,6 +311,10 @@ #define DISCARD(n) (top -= (n))
 
 #define TOP (*top)
 
+/* Update the thread's bytecode offset, just before NEXT. */
+
+#define UPDATE_OFFSET (backtrace_byte_offset = pc - bytestr_data - 1)
+
 DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
        doc: /* Function used internally in byte-compiled code.
 The first argument, BYTESTR, is a string of byte code;
@@ -618,6 +622,7 @@ #define DEFINE(name, value) LABEL (name) ,
 	  op -= Bcall;
 	docall:
 	  {
+	    UPDATE_OFFSET;
 	    DISCARD (op);
 #ifdef BYTE_CODE_METER
 	    if (byte_metering_on && SYMBOLP (TOP))
@@ -1448,7 +1453,7 @@ #define DEFINE(name, value) LABEL (name) ,
 	unbind_to (count, Qnil);
       error ("binding stack not balanced (serious byte compiler bug)");
     }
-
+  backtrace_byte_offset = -1;
   Lisp_Object result = TOP;
   SAFE_FREE ();
   return result;
diff --git a/src/eval.c b/src/eval.c
index 959adea646..e4451aa96c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -137,6 +137,13 @@ backtrace_args (union specbinding *pdl)
   return pdl->bt.args;
 }
 
+static int
+backtrace_bytecode_offset (union specbinding *pdl)
+{
+  eassert (pdl->kind == SPECPDL_BACKTRACE);
+  return pdl->bt.bytecode_offset;
+}
+
 static bool
 backtrace_debug_on_exit (union specbinding *pdl)
 {
@@ -2149,6 +2156,11 @@ record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs)
   specpdl_ptr->bt.function = function;
   current_thread->stack_top = specpdl_ptr->bt.args = args;
   specpdl_ptr->bt.nargs = nargs;
+  if (backtrace_byte_offset > 0) {
+    union specbinding *nxt = backtrace_top ();
+    if (backtrace_p (nxt) && nxt->kind == SPECPDL_BACKTRACE)
+      nxt->bt.bytecode_offset = backtrace_byte_offset;
+  }
   grow_specpdl ();
 
   return count;
@@ -3650,6 +3662,10 @@ backtrace_frame_apply (Lisp_Object function, union specbinding *pdl)
   if (backtrace_debug_on_exit (pdl))
     flags = list2 (QCdebug_on_exit, Qt);
 
+  int off = backtrace_bytecode_offset (pdl);
+  if (off > 0)
+    flags = Fcons (QCbytecode_offset, Fcons (make_fixnum (off), flags));
+
   if (backtrace_nargs (pdl) == UNEVALLED)
     return call4 (function, Qnil, backtrace_function (pdl), *backtrace_args (pdl), flags);
   else
@@ -4237,6 +4253,7 @@ syms_of_eval (void)
   defsubr (&Sfetch_bytecode);
   defsubr (&Sbacktrace_debug);
   DEFSYM (QCdebug_on_exit, ":debug-on-exit");
+  DEFSYM (QCbytecode_offset, ":bytecode-offset");
   defsubr (&Smapbacktrace);
   defsubr (&Sbacktrace_frame_internal);
   defsubr (&Sbacktrace_frames_from_thread);
diff --git a/src/lisp.h b/src/lisp.h
index 3442699088..e92300f4f7 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3230,6 +3230,7 @@ #define DEFVAR_KBOARD(lname, vname, doc)			\
       Lisp_Object function;
       Lisp_Object *args;
       ptrdiff_t nargs;
+      int bytecode_offset;
     } bt;
   };
 
diff --git a/src/thread.h b/src/thread.h
index a09929fa44..b5e3f0f9c5 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -103,6 +103,11 @@ #define specpdl (current_thread->m_specpdl)
   union specbinding *m_specpdl_ptr;
 #define specpdl_ptr (current_thread->m_specpdl_ptr)
 
+  /* The offset of the current op of the byte-code function being
+     executed. */
+  int m_backtrace_byte_offset;
+#define backtrace_byte_offset (current_thread->m_backtrace_byte_offset)
+
   /* Depth in Lisp evaluations and function calls.  */
   intmax_t m_lisp_eval_depth;
 #define lisp_eval_depth (current_thread->m_lisp_eval_depth)

--=-=-=--




Acknowledgement sent to Zach Shaftel <zshaftel@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#42499; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 18 Oct 2020 15:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.