GNU bug report logs - #26047
26.0.50; emacs crash by cl-caff2

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Fri, 10 Mar 2017 10:02:02 UTC

Severity: normal

Tags: confirmed, fixed

Found in version 26.0.50

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26047 in the body.
You can then email your comments to 26047 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Fri, 10 Mar 2017 10:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Liu <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 10 Mar 2017 10:02:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; emacs crash by cl-caff2
Date: Fri, 10 Mar 2017 18:01:04 +0800
1. Compile the following t.el file:

(require 'cl-lib)

(put 's 'buf "abcd")
(cl-callf2 cl-concatenate 'string (get 's 'buf) "efg")

(provide 't)

2. Load the compiled t.elc file

Crash on centos7:

Fatal error 11: Segmentation fault
Backtrace:
emacs[0x80e40be]
emacs[0x80ccbfd]
emacs[0x80e2c67]
emacs[0x80e2ebe]
emacs[0x80e2ee6]
[0xf77e0410]
emacs[0x813a17a]
emacs[0x816bffe]
emacs[0x816ddc7]
emacs[0x8139908]
emacs[0x815afc8]
emacs[0x815b42e]
emacs[0x813b1f4]
emacs[0x813a2ac]
emacs[0x816bffe]
emacs[0x8139ebb]
emacs[0x813a22b]
emacs[0x816bffe]
emacs[0x8139ebb]
emacs[0x813a22b]
emacs[0x816bffe]
emacs[0x8139ebb]
emacs[0x813a22b]
emacs[0x81364fb]
emacs[0x813a2ac]
emacs[0x8136e9f]
emacs[0x813a2ac]
emacs[0x816bffe]
emacs[0x8139fdd]
emacs[0x813a22b]
emacs[0x813a387]
emacs[0x80d9b72]
emacs[0x8138afe]
emacs[0x80ccfa4]
emacs[0x8138abb]
emacs[0x80ccf61]
emacs[0x80d116e]
emacs[0x80d146c]
emacs[0x804cc03]
/lib/libc.so.6(__libc_start_main+0xf3)[0xf75869a3]
emacs[0x804db03]
...
Segmentation fault




Added tag(s) confirmed. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 10 Mar 2017 18:04:02 GMT) Full text and rfc822 format available.

Added indication that bug 26047 blocks24655 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 10 Mar 2017 18:04:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Fri, 10 Mar 2017 20:58:02 GMT) Full text and rfc822 format available.

Message #12 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 26047 <at> debbugs.gnu.org
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Fri, 10 Mar 2017 21:56:45 +0100
Below is a slightly simpler test-case and a full back-trace.

Looks like the function byte-compile-inline-expand, which is the value
of cl-concatenate's byte-optimizer property, creates bad byte-code;
because this bug does not occur after setting this property to nil.


#+BEGIN_SRC emacs-lisp
  (require 'cl-lib)
  (cl-concatenate 'string "abcd" "efg")
  (provide 'foo)
#+END_SRC

Save this to foo.el, byte-compile it and start emacs like this

$ emacs -Q -l foo.elc

Thread 1 "emacs" received signal SIGSEGV, Segmentation fault.
Ffuncall (nargs=2, args=) at eval.c:2761

(gdb) bt
#0  Ffuncall (nargs=2, args=) at eval.c:2761
#1  exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=)
    at bytecode.c:641
#2  Fbyte_code (bytestr=..., vector=..., maxdepth=...) at bytecode.c:321
#3  eval_sub (form=...) at eval.c:2247
#4  readevalloop (readcharfun=..., stream=, sourcename=..., printflag=false, unibyte=..., readfun=..., start=..., end=...) at lread.c:1927
#5  Fload (file=..., noerror=..., nomessage=..., nosuffix=..., must_suffix=...) at lread.c:1332
#6  funcall_subr (subr=<Sload>, numargs=4, args=) at eval.c:2852
#7  Ffuncall (nargs=5, args=) at eval.c:2765
#8  exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=)
    at bytecode.c:641
#9  funcall_lambda (fun=..., nargs=1, arg_vector=) at eval.c:2965
#10 apply_lambda (fun=..., args=..., count=37) at eval.c:2902
#11 eval_sub (form=...) at eval.c:2286
#12 readevalloop_eager_expand_eval (val=..., macroexpand=...) at lread.c:1757
#13 readevalloop (readcharfun=..., stream=, sourcename=..., printflag=false, unibyte=..., readfun=..., start=..., end=...) at lread.c:1925
#14 Feval_buffer (buffer=..., printflag=..., filename=..., unibyte=..., do_allow_print=...)
    at lread.c:1991
#15 funcall_subr (subr=<Seval_buffer>, numargs=5, args=) at eval.c:2852
#16 Ffuncall (nargs=6, args=) at eval.c:2765
#17 exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=)
    at bytecode.c:641
#18 funcall_lambda (fun=..., nargs=4, arg_vector=<pure+196493>) at eval.c:3043
#19 Ffuncall (nargs=5, args=) at eval.c:2767
#20 call4 (fn=..., arg1=..., arg2=..., arg3=..., arg4=...) at eval.c:2652
#21 Fload (file=..., noerror=..., nomessage=..., nosuffix=..., must_suffix=...) at lread.c:1276
#22 funcall_subr (subr=<Sload>, numargs=3, args=) at eval.c:2852
#23 Ffuncall (nargs=4, args=) at eval.c:2765
#24 exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=)
    at bytecode.c:641
#25 funcall_lambda (fun=..., nargs=1, arg_vector=) at eval.c:2965
#26 Ffuncall (nargs=2, args=) at eval.c:2767
#27 exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=)
    at bytecode.c:641
#28 funcall_lambda (fun=..., nargs=0, arg_vector=) at eval.c:2965
#29 Ffuncall (nargs=1, args=) at eval.c:2767
#30 exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=)
    at bytecode.c:641
#31 funcall_lambda (fun=..., nargs=0, arg_vector=) at eval.c:2965
#32 apply_lambda (fun=..., args=..., count=4) at eval.c:2902
#33 eval_sub (form=...) at eval.c:2286
#34 Feval (form=..., lexical=...) at eval.c:2063
#35 top_level_2 () at keyboard.c:1121
#36 internal_condition_case (bfun=<top_level_2>, handlers=..., hfun=<cmd_error>) at eval.c:1324
#37 top_level_1 (ignore=...) at keyboard.c:1129
#38 internal_catch (tag=..., func=<top_level_1>, arg=...) at eval.c:1091
#39 command_loop () at keyboard.c:1090
#40 recursive_edit_1 () at keyboard.c:697
#41 Frecursive_edit () at keyboard.c:768
#42 main (argc=4, argv=) at emacs.c:1688

Lisp Backtrace:
Cannot access memory at address 0x800000dd5608
(gdb) pp args[0]
#<INVALID_LISP_OBJECT 0x7fffffff9cf0>
(gdb) pp args[1]
#<INVALID_LISP_OBJECT 0x0068b154>

-ap




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Tue, 14 Mar 2017 18:09:02 GMT) Full text and rfc822 format available.

Message #15 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 26047 <at> debbugs.gnu.org, vibhavp <at> gmail.com
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Tue, 14 Mar 2017 19:07:58 +0100
Using git bisect, I narrowed the cause of this down to the following
list of commits, all of which deal with handling byte-code and have a
single author.

----
commit 19cb3985a3795539b51d70625904e95a6e581eef
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 01:00:41 2017 +0530

    * lisp/emacs-lisp/bytecomp.el:Use correct size for switch jump-table
commit 4e6140b28324a9a63d54084c920206d00aed094e
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 01:02:16 2017 +0530

    * lisp/emacs-lisp/disass.el: Display jump tables for switch.
commit c52a9b6ddd9166571e6bc8bb9426b0267874f9fa
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 00:58:36 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Simplify b-c-cond-valid-obj2-p
commit 6a82d19db18f8480342cc4c1a0ad76c75df41941
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 14:28:23 2017 +0530

    * lisp/emacs-lisp/disass.el: Fix spacing while showing jump tables
commit 8189b97e5ca12aff8ea34617431a868010643b5b
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 00:57:10 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Fix byte-switch codegen with symbols.
commit 0d3c57dcf3187864c0b6fd6115ee80ad33faf553
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 00:54:59 2017 +0530

    * lisp/emacs-lisp/byte-opt.el: Add support for decompiling switch
    
    * lisp/emacs-lisp/byte-opt.el: (byte-decompile-bytecode-1) When the
      constant encountered precedes a byte-switch op, replace all the
      addresses in the jump table with tags.
commit a7e4870f165e9fd36d5cfcabb19b215b94373602
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 14:31:16 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Use correct function to push nil
    
    * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-jump-table) Use
      byte-compile-constant instead of byte-compile-form to push nil.
commit 23a130ee0d61fc39cee157921679809017a02b39
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sat Jan 21 11:37:20 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Remove unused debugging statements.
commit 25d38a06eceb0853190a2d9acf53d85686f524bd
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 26 23:03:02 2017 +0530

    * lisp/emacs-lisp/bytecomp.el:(bc-cond-jump-table-info)add docstring
commit bf7f7c0d82a56ed1b76358657e74ca2833b19fe2
Merge: 25d38a06ec 9c4dfdd1af
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Mon Jan 30 18:35:43 2017 +0530

    Merge remote-tracking branch 'origin/master' into feature/byte-switch
commit fbe6b90b0ced594cf74d5fd0dc9a32666f0d7d38
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 19 23:13:53 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Fix errors with matching quoted forms
    
    * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-jump-table-info)
      eval obj2 to avoid quoted forms being stored as is.
commit 5f3379b33866ff7dc16856b6c29712eae860af0e
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 19 23:13:13 2017 +0530

    lisp/emacs-lisp/bytecomp.el: Use byte-switch only for quoted symbols
commit f441451658ecb8d0d8ba386d9fd3eebf3b17d549
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Mon Jan 30 19:22:09 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Create jump tables with :purecopy t
commit 46193d5209780d21b848374d8c377fb6c8896d1b
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 19 23:12:09 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Add default-case for last cond clause.
    
    * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-jump-table) Add
    default-case for last cond clause.
commit bfa88520136dd6b187ba101e6db5a5f8f0d5e874
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Wed Feb 1 18:15:59 2017 +0530

    Use maphash instead of cl-loop.
    
    * lisp/emacs-lisp/bytecomp.el: (byte-compile-lapcode) Use maphash
      instead of cl-loop
commit 522f16dac945eee351cefb066af40f0d1a683f38
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 19 18:35:46 2017 +0530

    Add type checking for Bswitch, when enabled at compile time.
    
    * src/bytecode.c: (exec_byte_code) If BYTE_CODE_SAFE is enabled at
      compile time, use CHECK_TYPE to verify that the jump table is a hash table.
commit de456d1e4a1d7e34be6d040e0d8a04c42b14e62e
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Fri Feb 3 23:23:28 2017 +0530

    Revert "Use maphash instead of cl-loop."
    
    This reverts commit bfa88520136dd6b187ba101e6db5a5f8f0d5e874.
commit 1fcbd352f8116aca1ecdb62e84f3d86b89bc446f
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Thu Jan 19 18:02:40 2017 +0530

    Use byte-switch for all symbols.
    
    * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-valid-obj2-p) Return
      t for all symbols (instead for just keywords)
commit 44c95c58b26b7b9d75965a83930ec3d77ffae28f
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Feb 5 15:37:43 2017 +0530

    bytecomp.el: Don't store non-keyword symbols in jump-tables.
    
    * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-valid-obj2-p) return
      nil when OBJ is a non-keyword symbol (i.e a variable), as the jump
      table can only be used when comparing variables with constant values.
commit 086c4eaf9d4ecc5074088115fa01c0b2fb061246
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Wed Jan 18 22:40:50 2017 +0530

    * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch
    
    Fgethash type checks the provided table object, which is unnecessary
    for compiled bytecode.
commit 84eef501554324b22c7a838aabed77aa79315121
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Feb 5 18:49:24 2017 +0530

    byte-opt.el: Replace jump tables while decompiling correctly.
    
    * lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
      Don't make a copy of the constant vector, as it isn't used with
      the decompiled lapcode.
      Make sure that the correct lapcode pair/list is being modified while
      replacing the jump table.
commit 37956463d67795819fe7d8fe02d6249388364783
Merge: 309b46420e fd6b829d91
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Mon Jan 16 19:49:24 2017 +0530

    update branch
commit fea1ad36a0f7b1538984ab0f077095a53c570aa4
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Feb 5 18:55:45 2017 +0530

    ; * byte-opt.el (byte-decompile-bytecode-1): Add more documentation.
commit 309b46420e83826ed1e0b947f98a47e8525e3c36
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Jan 15 21:38:31 2017 +0530

    * lisp/emacs-lisp/byte-opt.el: Optimize how tags are checked for use.
    
    * byte-opt.el: (byte-optimize-lapcode): Return nil instantly on
      finding the tag in a jump table.
commit cadb044fc2e69266308cdcabe6181be0f624b484
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Feb 5 19:23:53 2017 +0530

    bytecomp.el: Inline lapcode containing `byte-switch' correctly.
    
    * lisp/emacs-lisp/bytecomp.el (byte-compile-inline-lapcode):
      Restore value of byte-compile-depth after emitting a jump to a tag
      in a jump table, or default/done tags.
      Set the depth of final tags for byte-switch to nil after emitting
      any jumps to them.
commit 490fc5a5029c0d8e527a0c7f423ba83fd6afda60
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Feb 5 21:48:27 2017 +0530

    ; bytecomp.el (-inline-lapcode): Fix incorrect parenthesis, refactor
commit 8c0f326ea237e8acd03c51c1b3a44d237c044562
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Jan 15 19:36:26 2017 +0530

    * lisp/emacs-lisp/bytecomp.el: Add documentation, remove code duplication
commit 382f6603ad4ba2a69b3961bdc68580ce77d222f9
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Feb 5 21:51:05 2017 +0530

    ; Fix typo.
    
    * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-jump-table-info): Fix
      typo in docstring.
commit 88549ec38e9bb30e338a9985d0de4e6263b40fb7
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Jan 15 01:26:04 2017 +0530

    Add new 'switch' byte-code.
    
    'switch' takes two arguments from the stack: the variable to test, and
    a jump table (implemented as a hash-table with the appropriate :test
    function). By looking up the value of the variable in the hash table,
    the interpreter can jump to the label pointed to by the value, if any.
    This implementation can only be used for `cond' forms of the type
    `(cond ((test x 'foo) 'bar) ...)`, such that the function `test` and
    variable `x` is same for all clauses.
    
    * lisp/emacs-lisp/bytecomp.el:
    
      * Add (byte-compile-cond-valid-obj2-p), (byte-compile-cond-vars),
        (byte-compile-cond-jump-table-info), (byte-compile-jump-table-add-tag),
        (byte-compile-cond-jump-table), byte-compile-jump-tables.
    
      * Add defcustom `byte-compile-cond-use-jump-table'.
    
      * (byte-compile-cond): Use them.
    
      * (byte-compile-lapcode): Patch tags present in jump tables, if any.
    
    * lisp/emacs-lisp//byte-opt.el: (byte-optimize-lapcode): Add checks to
      some peephole optimizations to prevent them from messing up any code
      involving `byte-switch`.
    
    * src/bytecode.c: (exec_byte_code): Add bytecode Bswitch.
commit 74a3423b0b92b80d84f6de62d1f2d61c21e4bd90
Author: Vibhav Pant <vibhavp <at> gmail.com>
Date:   Sun Feb 5 22:10:22 2017 +0530

    * byte-opt.el (byte-decompile-bytecode-1): Use eq instead of =.

----
-ap




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Tue, 14 Mar 2017 18:20:01 GMT) Full text and rfc822 format available.

Message #18 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Vibhav Pant <vibhavp <at> gmail.com>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 26047 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Tue, 14 Mar 2017 23:48:44 +0530
Yes, I've been investigating for some time. For now, a workaround
would be to set byte-compile-cond-use-jump-table to nil before
compiling.

Thanks,
Vibhav

On Tue, Mar 14, 2017 at 11:37 PM, Andreas Politz
<politza <at> hochschule-trier.de> wrote:
>
> Using git bisect, I narrowed the cause of this down to the following
> list of commits, all of which deal with handling byte-code and have a
> single author.
>
> ----
> commit 19cb3985a3795539b51d70625904e95a6e581eef
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 01:00:41 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el:Use correct size for switch jump-table
> commit 4e6140b28324a9a63d54084c920206d00aed094e
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 01:02:16 2017 +0530
>
>     * lisp/emacs-lisp/disass.el: Display jump tables for switch.
> commit c52a9b6ddd9166571e6bc8bb9426b0267874f9fa
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 00:58:36 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Simplify b-c-cond-valid-obj2-p
> commit 6a82d19db18f8480342cc4c1a0ad76c75df41941
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 14:28:23 2017 +0530
>
>     * lisp/emacs-lisp/disass.el: Fix spacing while showing jump tables
> commit 8189b97e5ca12aff8ea34617431a868010643b5b
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 00:57:10 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Fix byte-switch codegen with symbols.
> commit 0d3c57dcf3187864c0b6fd6115ee80ad33faf553
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 00:54:59 2017 +0530
>
>     * lisp/emacs-lisp/byte-opt.el: Add support for decompiling switch
>
>     * lisp/emacs-lisp/byte-opt.el: (byte-decompile-bytecode-1) When the
>       constant encountered precedes a byte-switch op, replace all the
>       addresses in the jump table with tags.
> commit a7e4870f165e9fd36d5cfcabb19b215b94373602
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 14:31:16 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Use correct function to push nil
>
>     * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-jump-table) Use
>       byte-compile-constant instead of byte-compile-form to push nil.
> commit 23a130ee0d61fc39cee157921679809017a02b39
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sat Jan 21 11:37:20 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Remove unused debugging statements.
> commit 25d38a06eceb0853190a2d9acf53d85686f524bd
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 26 23:03:02 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el:(bc-cond-jump-table-info)add docstring
> commit bf7f7c0d82a56ed1b76358657e74ca2833b19fe2
> Merge: 25d38a06ec 9c4dfdd1af
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Mon Jan 30 18:35:43 2017 +0530
>
>     Merge remote-tracking branch 'origin/master' into feature/byte-switch
> commit fbe6b90b0ced594cf74d5fd0dc9a32666f0d7d38
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 19 23:13:53 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Fix errors with matching quoted forms
>
>     * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-jump-table-info)
>       eval obj2 to avoid quoted forms being stored as is.
> commit 5f3379b33866ff7dc16856b6c29712eae860af0e
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 19 23:13:13 2017 +0530
>
>     lisp/emacs-lisp/bytecomp.el: Use byte-switch only for quoted symbols
> commit f441451658ecb8d0d8ba386d9fd3eebf3b17d549
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Mon Jan 30 19:22:09 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Create jump tables with :purecopy t
> commit 46193d5209780d21b848374d8c377fb6c8896d1b
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 19 23:12:09 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Add default-case for last cond clause.
>
>     * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-jump-table) Add
>     default-case for last cond clause.
> commit bfa88520136dd6b187ba101e6db5a5f8f0d5e874
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Wed Feb 1 18:15:59 2017 +0530
>
>     Use maphash instead of cl-loop.
>
>     * lisp/emacs-lisp/bytecomp.el: (byte-compile-lapcode) Use maphash
>       instead of cl-loop
> commit 522f16dac945eee351cefb066af40f0d1a683f38
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 19 18:35:46 2017 +0530
>
>     Add type checking for Bswitch, when enabled at compile time.
>
>     * src/bytecode.c: (exec_byte_code) If BYTE_CODE_SAFE is enabled at
>       compile time, use CHECK_TYPE to verify that the jump table is a hash table.
> commit de456d1e4a1d7e34be6d040e0d8a04c42b14e62e
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Fri Feb 3 23:23:28 2017 +0530
>
>     Revert "Use maphash instead of cl-loop."
>
>     This reverts commit bfa88520136dd6b187ba101e6db5a5f8f0d5e874.
> commit 1fcbd352f8116aca1ecdb62e84f3d86b89bc446f
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Thu Jan 19 18:02:40 2017 +0530
>
>     Use byte-switch for all symbols.
>
>     * lisp/emacs-lisp/bytecomp.el: (byte-compile-cond-valid-obj2-p) Return
>       t for all symbols (instead for just keywords)
> commit 44c95c58b26b7b9d75965a83930ec3d77ffae28f
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Feb 5 15:37:43 2017 +0530
>
>     bytecomp.el: Don't store non-keyword symbols in jump-tables.
>
>     * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-valid-obj2-p) return
>       nil when OBJ is a non-keyword symbol (i.e a variable), as the jump
>       table can only be used when comparing variables with constant values.
> commit 086c4eaf9d4ecc5074088115fa01c0b2fb061246
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Wed Jan 18 22:40:50 2017 +0530
>
>     * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch
>
>     Fgethash type checks the provided table object, which is unnecessary
>     for compiled bytecode.
> commit 84eef501554324b22c7a838aabed77aa79315121
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Feb 5 18:49:24 2017 +0530
>
>     byte-opt.el: Replace jump tables while decompiling correctly.
>
>     * lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
>       Don't make a copy of the constant vector, as it isn't used with
>       the decompiled lapcode.
>       Make sure that the correct lapcode pair/list is being modified while
>       replacing the jump table.
> commit 37956463d67795819fe7d8fe02d6249388364783
> Merge: 309b46420e fd6b829d91
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Mon Jan 16 19:49:24 2017 +0530
>
>     update branch
> commit fea1ad36a0f7b1538984ab0f077095a53c570aa4
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Feb 5 18:55:45 2017 +0530
>
>     ; * byte-opt.el (byte-decompile-bytecode-1): Add more documentation.
> commit 309b46420e83826ed1e0b947f98a47e8525e3c36
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Jan 15 21:38:31 2017 +0530
>
>     * lisp/emacs-lisp/byte-opt.el: Optimize how tags are checked for use.
>
>     * byte-opt.el: (byte-optimize-lapcode): Return nil instantly on
>       finding the tag in a jump table.
> commit cadb044fc2e69266308cdcabe6181be0f624b484
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Feb 5 19:23:53 2017 +0530
>
>     bytecomp.el: Inline lapcode containing `byte-switch' correctly.
>
>     * lisp/emacs-lisp/bytecomp.el (byte-compile-inline-lapcode):
>       Restore value of byte-compile-depth after emitting a jump to a tag
>       in a jump table, or default/done tags.
>       Set the depth of final tags for byte-switch to nil after emitting
>       any jumps to them.
> commit 490fc5a5029c0d8e527a0c7f423ba83fd6afda60
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Feb 5 21:48:27 2017 +0530
>
>     ; bytecomp.el (-inline-lapcode): Fix incorrect parenthesis, refactor
> commit 8c0f326ea237e8acd03c51c1b3a44d237c044562
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Jan 15 19:36:26 2017 +0530
>
>     * lisp/emacs-lisp/bytecomp.el: Add documentation, remove code duplication
> commit 382f6603ad4ba2a69b3961bdc68580ce77d222f9
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Feb 5 21:51:05 2017 +0530
>
>     ; Fix typo.
>
>     * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-jump-table-info): Fix
>       typo in docstring.
> commit 88549ec38e9bb30e338a9985d0de4e6263b40fb7
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Jan 15 01:26:04 2017 +0530
>
>     Add new 'switch' byte-code.
>
>     'switch' takes two arguments from the stack: the variable to test, and
>     a jump table (implemented as a hash-table with the appropriate :test
>     function). By looking up the value of the variable in the hash table,
>     the interpreter can jump to the label pointed to by the value, if any.
>     This implementation can only be used for `cond' forms of the type
>     `(cond ((test x 'foo) 'bar) ...)`, such that the function `test` and
>     variable `x` is same for all clauses.
>
>     * lisp/emacs-lisp/bytecomp.el:
>
>       * Add (byte-compile-cond-valid-obj2-p), (byte-compile-cond-vars),
>         (byte-compile-cond-jump-table-info), (byte-compile-jump-table-add-tag),
>         (byte-compile-cond-jump-table), byte-compile-jump-tables.
>
>       * Add defcustom `byte-compile-cond-use-jump-table'.
>
>       * (byte-compile-cond): Use them.
>
>       * (byte-compile-lapcode): Patch tags present in jump tables, if any.
>
>     * lisp/emacs-lisp//byte-opt.el: (byte-optimize-lapcode): Add checks to
>       some peephole optimizations to prevent them from messing up any code
>       involving `byte-switch`.
>
>     * src/bytecode.c: (exec_byte_code): Add bytecode Bswitch.
> commit 74a3423b0b92b80d84f6de62d1f2d61c21e4bd90
> Author: Vibhav Pant <vibhavp <at> gmail.com>
> Date:   Sun Feb 5 22:10:22 2017 +0530
>
>     * byte-opt.el (byte-decompile-bytecode-1): Use eq instead of =.
>
> ----
> -ap



-- 
Vibhav Pant
vibhavp <at> gmail.com




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Tue, 14 Mar 2017 18:43:01 GMT) Full text and rfc822 format available.

Message #21 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Vibhav Pant <vibhavp <at> gmail.com>
Cc: 26047 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Tue, 14 Mar 2017 19:42:13 +0100
Vibhav Pant <vibhavp <at> gmail.com> writes:

> Yes, I've been investigating for some time.

OK, thank you.

-ap




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Thu, 16 Mar 2017 19:46:02 GMT) Full text and rfc822 format available.

Message #24 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Vibhav Pant <vibhavp <at> gmail.com>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 26047 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Fri, 17 Mar 2017 01:15:03 +0530
[Message part 1 (text/plain, inline)]
Could you apply this patch, and see if the issue is fixed?

Thanks,
Vibhav

On Wed, Mar 15, 2017 at 12:12 AM, Andreas Politz
<politza <at> hochschule-trier.de> wrote:
> Vibhav Pant <vibhavp <at> gmail.com> writes:
>
>> Yes, I've been investigating for some time.
>
> OK, thank you.
>
> -ap



-- 
Vibhav Pant
vibhavp <at> gmail.com
[fix-inline.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Fri, 17 Mar 2017 10:18:02 GMT) Full text and rfc822 format available.

Message #27 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Vibhav Pant <vibhavp <at> gmail.com>
Cc: 26047 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Fri, 17 Mar 2017 11:17:29 +0100
Vibhav Pant <vibhavp <at> gmail.com> writes:

> Could you apply this patch, and see if the issue is fixed?

I'm afraid not.  

Debugger entered--Lisp error: (void-function s)
  s(buf string "abcdefg")
  byte-code("\300\301!\210\302\303\304\305#\210\302\303\304\306\303\304N\307D.\310\267\2027.\311\312.\"\262.\202=.\311\313.\"\262.\202=.\311\314\211.\315\"\"\262.\202=.\316\317.\"\266\205#\210\320\321!\207" [require cl-lib put s buf "abcd" string "efg" #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (vector 25 string 34 list 43)) apply vconcat concat append (nil) error "Not a sequence type name: %S" provide byte-code-bug] 12)

-ap




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Fri, 17 Mar 2017 11:40:02 GMT) Full text and rfc822 format available.

Message #30 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Vibhav Pant <vibhavp <at> gmail.com>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 26047 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Fri, 17 Mar 2017 17:09:25 +0530
This is possibly to do with byte-compile-inline-lapcode inlining some
byte-switch lapcode incorrectly. I'll send another patch as soon as I
rewrite it.

Thanks,
Vibhav

On Fri, Mar 17, 2017 at 3:47 PM, Andreas Politz
<politza <at> hochschule-trier.de> wrote:
> Vibhav Pant <vibhavp <at> gmail.com> writes:
>
>> Could you apply this patch, and see if the issue is fixed?
>
> I'm afraid not.
>
> Debugger entered--Lisp error: (void-function s)
>   s(buf string "abcdefg")
>   byte-code("\300\301!\210\302\303\304\305#\210\302\303\304\306\303\304N\307D.\310\267\2027.\311\312.\"\262.\202=.\311\313.\"\262.\202=.\311\314\211.\315\"\"\262.\202=.\316\317.\"\266\205#\210\320\321!\207" [require cl-lib put s buf "abcd" string "efg" #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (vector 25 string 34 list 43)) apply vconcat concat append (nil) error "Not a sequence type name: %S" provide byte-code-bug] 12)
>
> -ap



-- 
Vibhav Pant
vibhavp <at> gmail.com




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Fri, 17 Mar 2017 15:46:02 GMT) Full text and rfc822 format available.

Message #33 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Politz <politza <at> hochschule-trier.de>
To: Vibhav Pant <vibhavp <at> gmail.com>
Cc: 26047 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Fri, 17 Mar 2017 16:44:56 +0100
Here is a test case.

(ert-deftest byte-code-optimzier-1 ()
  (let* ((el-file (make-temp-file "test" nil ".el"))
         (elc-file (concat (file-name-sans-extension el-file) ".elc")))
    (unwind-protect
        (let ((byte-compile-warnings t))
          (with-temp-file el-file
            (dolist (form '((require 'cl-lib)
                            (put 's 'buf "abcd")
                            (cl-callf2 cl-concatenate 'string (get 's 'buf) "efg")
                            (provide 't)))
              (insert (prin1-to-string form))
              (insert "\n")))
          (byte-compile-file el-file)
          (should (progn (load-file elc-file) t)))
      (when (file-exists-p el-file)
        (delete-file el-file))
      (when (file-exists-p elc-file)
        (delete-file elc-file)))))

-ap




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26047; Package emacs. (Thu, 18 May 2017 03:19:01 GMT) Full text and rfc822 format available.

Message #36 received at 26047 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 26047 <at> debbugs.gnu.org, Leo Liu <sdl.web <at> gmail.com>,
 Vibhav Pant <vibhavp <at> gmail.com>
Subject: Re: bug#26047: 26.0.50; emacs crash by cl-caff2
Date: Wed, 17 May 2017 23:19:53 -0400
tags 26047 fixed
close 26047 
quit

Andreas Politz <politza <at> hochschule-trier.de> writes:

> Here is a test case.
>
> (ert-deftest byte-code-optimzier-1 ()
>   (let* ((el-file (make-temp-file "test" nil ".el"))
>          (elc-file (concat (file-name-sans-extension el-file) ".elc")))
>     (unwind-protect
>         (let ((byte-compile-warnings t))
>           (with-temp-file el-file
>             (dolist (form '((require 'cl-lib)
>                             (put 's 'buf "abcd")
>                             (cl-callf2 cl-concatenate 'string (get 's 'buf) "efg")
>                             (provide 't)))
>               (insert (prin1-to-string form))
>               (insert "\n")))
>           (byte-compile-file el-file)
>           (should (progn (load-file elc-file) t)))
>       (when (file-exists-p el-file)
>         (delete-file el-file))
>       (when (file-exists-p elc-file)
>         (delete-file elc-file)))))
>
> -ap

This seems to be fixed now, I guess by [1: b389379c87].

[1: b389379c87]: 2017-04-20 21:23:08 +0530
  bytecomp: Don't inline functions that use byte-switch (Bug#26518)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b389379c87481b6bc647ceb4d323f861281cad72




Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Thu, 18 May 2017 03:19:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 26047 <at> debbugs.gnu.org and Leo Liu <sdl.web <at> gmail.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Thu, 18 May 2017 03:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 15 Jun 2017 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 159 days ago.

Previous Next


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