all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vibhav Pant <vibhavp@gmail.com>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: Mark Oteiza <mvoteiza@udel.edu>, 25716@debbugs.gnu.org
Subject: bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
Date: Tue, 14 Feb 2017 20:48:51 +0530	[thread overview]
Message-ID: <CA+T2Sh3s_A11vzNCSfcJh_w1zyKzvurw1XSv=2h9rQ511z4gDw@mail.gmail.com> (raw)
In-Reply-To: <CA+T2Sh3SmeV=QwxWA_=poU2JkFVO8Ngh7unM6s5ujSV6M-O1BQ@mail.gmail.com>

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

On Tue, Feb 14, 2017 at 6:31 PM, Vibhav Pant <vibhavp@gmail.com> 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 <tino.calancha@gmail.com> wrote:
>> Mark Oteiza <mvoteiza@udel.edu> 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: --> <deleted>
       ;;
       ((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))

[-- Attachment #2: fix-merged-tags.diff --]
[-- Type: text/plain, Size: 1182 bytes --]

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: --> <deleted>
 	      ;;
 	      ((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))

  reply	other threads:[~2017-02-14 15:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14  4:28 bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30 Mark Oteiza
2017-02-14  6:50 ` Tino Calancha
2017-02-14 13:01   ` Vibhav Pant
2017-02-14 15:18     ` Vibhav Pant [this message]
2017-02-14 15:47       ` Tino Calancha
2017-02-14 17:40         ` Vibhav Pant
2017-02-14 17:45           ` Mark Oteiza
2017-02-14 20:16           ` Eli Zaretskii
2017-02-15 15:45             ` Vibhav Pant
2017-02-15 16:52               ` 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

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

  git send-email \
    --in-reply-to='CA+T2Sh3s_A11vzNCSfcJh_w1zyKzvurw1XSv=2h9rQ511z4gDw@mail.gmail.com' \
    --to=vibhavp@gmail.com \
    --cc=25716@debbugs.gnu.org \
    --cc=mvoteiza@udel.edu \
    --cc=tino.calancha@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.