unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
@ 2017-02-14  4:28 Mark Oteiza
  2017-02-14  6:50 ` Tino Calancha
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Oteiza @ 2017-02-14  4:28 UTC (permalink / raw)
  To: 25716


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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Tino Calancha @ 2017-02-14  6:50 UTC (permalink / raw)
  To: Mark Oteiza; +Cc: 25716, Vibhav Pant, tino.calancha

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  2017-02-14  6:50 ` Tino Calancha
@ 2017-02-14 13:01   ` Vibhav Pant
  2017-02-14 15:18     ` Vibhav Pant
  0 siblings, 1 reply; 10+ messages in thread
From: Vibhav Pant @ 2017-02-14 13:01 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Mark Oteiza, 25716

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



-- 
Vibhav Pant
vibhavp@gmail.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  2017-02-14 13:01   ` Vibhav Pant
@ 2017-02-14 15:18     ` Vibhav Pant
  2017-02-14 15:47       ` Tino Calancha
  0 siblings, 1 reply; 10+ messages in thread
From: Vibhav Pant @ 2017-02-14 15:18 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Mark Oteiza, 25716

[-- 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))

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  2017-02-14 15:18     ` Vibhav Pant
@ 2017-02-14 15:47       ` Tino Calancha
  2017-02-14 17:40         ` Vibhav Pant
  0 siblings, 1 reply; 10+ messages in thread
From: Tino Calancha @ 2017-02-14 15:47 UTC (permalink / raw)
  To: Vibhav Pant; +Cc: Mark Oteiza, 25716, Tino Calancha



On Tue, 14 Feb 2017, Vibhav Pant wrote:

> 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?

Thank you very much for your fast action.
I have tested your patch and fix the problem.
By the way, thanks for implementing the switch: it's a nice job.

Regards,
Tino





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  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
  0 siblings, 2 replies; 10+ messages in thread
From: Vibhav Pant @ 2017-02-14 17:40 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Mark Oteiza, 25716

On Tue, Feb 14, 2017 at 9:17 PM, Tino Calancha <tino.calancha@gmail.com> wrote:
> Thank you very much for your fast action.
> I have tested your patch and fix the problem.
> By the way, thanks for implementing the switch: it's a nice job.

Thanks, I've pushed the fix to master (how does one close bugs in debbugs?).


-- 
Vibhav Pant
vibhavp@gmail.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  2017-02-14 17:40         ` Vibhav Pant
@ 2017-02-14 17:45           ` Mark Oteiza
  2017-02-14 20:16           ` Eli Zaretskii
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Oteiza @ 2017-02-14 17:45 UTC (permalink / raw)
  To: Vibhav Pant; +Cc: 25716-done, Tino Calancha

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

On Feb 14, 2017 12:40 PM, "Vibhav Pant" <vibhavp@gmail.com> wrote:

On Tue, Feb 14, 2017 at 9:17 PM, Tino Calancha <tino.calancha@gmail.com>
wrote:
> Thank you very much for your fast action.
> I have tested your patch and fix the problem.
> By the way, thanks for implementing the switch: it's a nice job.

Thanks, I've pushed the fix to master (how does one close bugs in debbugs?).


One way is to reply to NNNNN-done@debbugs.gnu.org, as I have done. Thanks
for the fix!

[-- Attachment #2: Type: text/html, Size: 996 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2017-02-14 20:16 UTC (permalink / raw)
  To: Vibhav Pant; +Cc: 25716

> From: Vibhav Pant <vibhavp@gmail.com>
> Date: Tue, 14 Feb 2017 23:10:35 +0530
> Cc: Mark Oteiza <mvoteiza@udel.edu>, 25716@debbugs.gnu.org
> 
> Thanks, I've pushed the fix to master

Thank you.

Would it be possible to add a test based on this bug?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  2017-02-14 20:16           ` Eli Zaretskii
@ 2017-02-15 15:45             ` Vibhav Pant
  2017-02-15 16:52               ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Vibhav Pant @ 2017-02-15 15:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25716

On Wed, Feb 15, 2017 at 1:46 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Vibhav Pant <vibhavp@gmail.com>
>> Date: Tue, 14 Feb 2017 23:10:35 +0530
>> Cc: Mark Oteiza <mvoteiza@udel.edu>, 25716@debbugs.gnu.org
>>
>> Thanks, I've pushed the fix to master
>
> Thank you.
>
> Would it be possible to add a test based on this bug?


Yes, I've added some more tests for this to bytecomp-tests.el

-- 
Vibhav Pant
vibhavp@gmail.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#25716: 26.0.50; Invalid byte opcode: op=0, ptr=30
  2017-02-15 15:45             ` Vibhav Pant
@ 2017-02-15 16:52               ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2017-02-15 16:52 UTC (permalink / raw)
  To: Vibhav Pant; +Cc: 25716

> From: Vibhav Pant <vibhavp@gmail.com>
> Date: Wed, 15 Feb 2017 21:15:53 +0530
> Cc: 25716@debbugs.gnu.org
> 
> > Would it be possible to add a test based on this bug?
> 
> 
> Yes, I've added some more tests for this to bytecomp-tests.el

Great, thanks.





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-15 16:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).