From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.bugs Subject: bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30 Date: Tue, 14 Feb 2017 20:48:51 +0530 Message-ID: References: <8760kdz98r.fsf@holos> <87zihps1ur.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=94eb2c07d0b40d3eb305487f161b X-Trace: blaine.gmane.org 1487085616 21206 195.159.176.226 (14 Feb 2017 15:20:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 15:20:16 +0000 (UTC) Cc: Mark Oteiza , 25716@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 14 16:20:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdetm-0004wk-1n for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 16:20:10 +0100 Original-Received: from localhost ([::1]:35451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdetr-0005pR-PZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 10:20:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdeti-0005mL-Ub for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 10:20:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdete-0006PM-S0 for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 10:20:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdete-0006P9-Nk for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 10:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cdete-0007Gw-Ct for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2017 10:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vibhav Pant Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2017 15:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25716 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25716-submit@debbugs.gnu.org id=B25716.148708555927894 (code B ref 25716); Tue, 14 Feb 2017 15:20:02 +0000 Original-Received: (at 25716) by debbugs.gnu.org; 14 Feb 2017 15:19:19 +0000 Original-Received: from localhost ([127.0.0.1]:40000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdesw-0007Fq-Pn for submit@debbugs.gnu.org; Tue, 14 Feb 2017 10:19:19 -0500 Original-Received: from mail-yw0-f193.google.com ([209.85.161.193]:35350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdesv-0007Fb-Ah for 25716@debbugs.gnu.org; Tue, 14 Feb 2017 10:19:17 -0500 Original-Received: by mail-yw0-f193.google.com with SMTP id l16so9831211ywb.2 for <25716@debbugs.gnu.org>; Tue, 14 Feb 2017 07:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/AJe5SgF2nxJ3uNuf5CHkvpLIPzxbsiv3buMZhOzrsI=; b=Lm7SwVPJA44z3vTyRdeOGtz2dfEGvTFBE44T3g6lIptSVi1NHKd8AvmZn4/ZDZdNey BP8eK7ScHT6++kUmQfb6pXpWmLbdfpZ8gngjl4XrzTGRfAHcGfPR8oORgxGlJxMiF+Sd xEUpwDoIarkC6TLYo0ri0xRtGMGEHDPWTJUT1Bb15wOHgfK9ipHjvdd3H887Eu6QUBlq 8aFmuLOiYUgGMAc+rSIg6Q6VopUz2u5z4wWrLDxRrgK05hb9gHhLB3uGIPjSCpCxyoCk LMnl8v/NGsmmaXUHtbvHzpa1/1mbG4j0+yG6J49ShEAOusLXGFyDh9oRNWKG+lTqXeJH e9tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/AJe5SgF2nxJ3uNuf5CHkvpLIPzxbsiv3buMZhOzrsI=; b=bA1FW8FUdTz2/fh5/0t471/FyfNaAgWP3yUIFM6S1tjxk/VPapQCIhHEQT20h+rjYd 1+1uuVCaevH/Hds3ry/cYrt0SWQzH7nFGEhxIZvmhg8yJ9waM51R+xqUhzNcdOCnt6Ny dJ9+KS7bHCKRYhglMiScF9LEePl9KV8hIUUXYf9erH1jglEvqH8CSZrt8FriA1R6H4Ab qtE1uKh8IDL6JonDXR6/3lqV4GeEn9P7PxVxsUQPXdSJzDcTO0VtQgxG+6xP7QU+Zg+B KBtP/9BlOgXCXoq1Dc3uQ80tpifU+zpYlz1SgIfD+ssjDs8GZnnbciUR7HW4IRdvCwZm tRWA== X-Gm-Message-State: AMke39mMU+VgnxTf8au2F3QbXBIIEofXOOHBg4UammCLJ8RvuqQ7g3P0ViauHdsViYIQM79Tcdz1dP3aGZOpKQ== X-Received: by 10.13.224.4 with SMTP id j4mr23638328ywe.139.1487085551536; Tue, 14 Feb 2017 07:19:11 -0800 (PST) Original-Received: by 10.129.153.77 with HTTP; Tue, 14 Feb 2017 07:18:51 -0800 (PST) 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:129351 Archived-At: --94eb2c07d0b40d3eb305487f161b Content-Type: text/plain; charset=UTF-8 On Tue, Feb 14, 2017 at 6:31 PM, Vibhav Pant wrote: > Sorry about that, this seems to be caused by bytecomp.el not > generating correct jump addresses for some tags in the jump table. > I'll try pushing a fix ASAP. > > On Tue, Feb 14, 2017 at 12:20 PM, Tino Calancha wrote: >> Mark Oteiza writes: >> >>>>>From -Q: >>> >>> 1. C-x C-f some/patch.diff RET >>> 2. M-n >>> >>> Error running timer: (error "Invalid byte opcode: op=0, ptr=30") >>> >>> In GNU Emacs 26.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) >>> of 2017-02-13 built on logos >>> Repository revision: fffd4ffd747fe46bb7849a874e4ae265b6eda54e >> it might be cause by the new switch byte-code >> (commit 88549ec38e9bb30e338a9985d0de4e6263b40fb7) >> >> Save the definition of `diff-refine-hunk' >> in a file: >> /tmp/diff-refine-hunk.el >> >> I) >> M-: (load "/tmp/diff-refine-hunk.el") RET >> ;; `diff-hunk-next' works as expected, i.e. with auto refinement. >> II) >> M-: (byte-compile-file "/tmp/diff-refine-hunk.el") RET >> M-: (load "/tmp/diff-refine-hunk.elc") RET >> ;; `diff-hunk-next' doesn't auto refine and it shows >> ;; error "Variable binding depth exceeds max-specpdl-size". >> >> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >> In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.7) >> of 2017-02-14 built on calancha-pc >> Repository revision: 31b4d9a13741caae2422636d4944212e702b19c3 Correction, this was because of the peephole optimizer not replacing the old tag in jump tables while merging adjacent tags. The following patch should fix this issue. Could you test this and see if there are any other related problems? Thanks, Vibhav -- Vibhav Pant vibhavp@gmail.com diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 38f5dcc993..c44cf71674 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1752,12 +1752,21 @@ byte-optimize-lapcode (setcdr tmp2 lap1) (setq tmp3 (cdr (memq tmp2 tmp3)))) (setq lap (delq lap0 lap) - keep-going t)) + keep-going t) + ;; replace references to tag in jump tables, if any + (dolist (table byte-compile-jump-tables) + (catch 'break + (maphash #'(lambda (value tag) + (when (equal tag lap0) + (puthash value lap1 table) + (throw 'break nil))) + table)))) ;; ;; unused-TAG: --> ;; ((and (eq 'TAG (car lap0)) (not (rassq lap0 lap)) + ;; make sure this tag isn't used in a jump-table (cl-loop for table in byte-compile-jump-tables when (member lap0 (hash-table-values table)) return nil finally return t)) --94eb2c07d0b40d3eb305487f161b Content-Type: text/plain; charset=US-ASCII; name="fix-merged-tags.diff" Content-Disposition: attachment; filename="fix-merged-tags.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iz5oc3d20 ZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC9ieXRlLW9wdC5lbCBiL2xpc3AvZW1hY3MtbGlz cC9ieXRlLW9wdC5lbAppbmRleCAzOGY1ZGNjOTkzLi5jNDRjZjcxNjc0IDEwMDY0NAotLS0gYS9s aXNwL2VtYWNzLWxpc3AvYnl0ZS1vcHQuZWwKKysrIGIvbGlzcC9lbWFjcy1saXNwL2J5dGUtb3B0 LmVsCkBAIC0xNzUyLDEyICsxNzUyLDIxIEBAIGJ5dGUtb3B0aW1pemUtbGFwY29kZQogCQkgKHNl dGNkciB0bXAyIGxhcDEpCiAJCSAoc2V0cSB0bXAzIChjZHIgKG1lbXEgdG1wMiB0bXAzKSkpKQog CSAgICAgICAoc2V0cSBsYXAgKGRlbHEgbGFwMCBsYXApCi0JCSAgICAga2VlcC1nb2luZyB0KSkK KwkJICAgICBrZWVwLWdvaW5nIHQpCisgICAgICAgICAgICAgICA7OyByZXBsYWNlIHJlZmVyZW5j ZXMgdG8gdGFnIGluIGp1bXAgdGFibGVzLCBpZiBhbnkKKyAgICAgICAgICAgICAgIChkb2xpc3Qg KHRhYmxlIGJ5dGUtY29tcGlsZS1qdW1wLXRhYmxlcykKKyAgICAgICAgICAgICAgICAgKGNhdGNo ICdicmVhaworICAgICAgICAgICAgICAgICAgIChtYXBoYXNoICMnKGxhbWJkYSAodmFsdWUgdGFn KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAod2hlbiAoZXF1YWwgdGFnIGxhcDAp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHB1dGhhc2ggdmFsdWUgbGFwMSB0 YWJsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGhyb3cgJ2JyZWFrIG5p bCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhYmxlKSkpKQogCSAgICAgIDs7CiAJ ICAgICAgOzsgdW51c2VkLVRBRzogLS0+IDxkZWxldGVkPgogCSAgICAgIDs7CiAJICAgICAgKChh bmQgKGVxICdUQUcgKGNhciBsYXAwKSkKIAkJICAgIChub3QgKHJhc3NxIGxhcDAgbGFwKSkKKyAg ICAgICAgICAgICAgICAgICAgOzsgbWFrZSBzdXJlIHRoaXMgdGFnIGlzbid0IHVzZWQgaW4gYSBq dW1wLXRhYmxlCiAgICAgICAgICAgICAgICAgICAgIChjbC1sb29wIGZvciB0YWJsZSBpbiBieXRl LWNvbXBpbGUtanVtcC10YWJsZXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hlbiAo bWVtYmVyIGxhcDAgKGhhc2gtdGFibGUtdmFsdWVzIHRhYmxlKSkKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcmV0dXJuIG5pbCBmaW5hbGx5IHJldHVybiB0KSkK --94eb2c07d0b40d3eb305487f161b--