unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 59703@debbugs.gnu.org
Subject: bug#59703: 29.0.50; Emacs crashes when turning treesit-explore-mode on with some C++ code
Date: Wed, 30 Nov 2022 00:06:03 +0100	[thread overview]
Message-ID: <m1h6yhuzs4.fsf@yahoo.es> (raw)
In-Reply-To: m1h6yhuzs4.fsf.ref@yahoo.es


Steps to reproduce the problem:

emacs -Q
C-x b sample.cpp RET

Paste the following code:

class OFFICE_EXPORT Sample : public Base, public WeakObservable<SampleObserver> {
public:    
   void getFoo();
private:
   mutable std::weak_ptr<Foo> m_Foo;
};

M-x c++-ts-mode RET
M-x treesit-explore-mode RET
M-<

Emacs crashes with the following backtrace:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x100100005530847)
  * frame #0: 0x0000000101365fc8 libtree-sitter.0.dylib`ts_node_field_name_for_child + 24
    frame #1: 0x00000001003b0a8c emacs`Ftreesit_node_field_name_for_child(node=0x00000001059f7575, n=(EMACS_INT) $329 = 0) at treesit.c:1868:7
    frame #2: 0x00000001002c2cd4 emacs`funcall_subr(subr=0x00000001005028c8, numargs=2, args=(struct Lisp_Symbol *) $332 = 0x0000000100b32ec0) at eval.c:3036:15
    frame #3: 0x000000010033bde4 emacs`exec_byte_code(fun=(struct Lisp_Vector *) $337 = 0x0000000103872e98, args_template=513, nargs=1, args=(struct Lisp_Symbol *) $340 = 0x0000000100b32ec0) at bytecode.c:809:14
    frame #4: 0x00000001002c8054 emacs`fetch_and_exec_byte_code(fun=(struct Lisp_Vector *) $345 = 0x0000000135009550, args_template=0, nargs=0, args=(struct Lisp_Symbol *) $348 = 0x0000000100b32ec0) at eval.c:3081:10
    frame #5: 0x00000001002c3300 emacs`funcall_lambda(fun=(struct Lisp_Vector *) $353 = 0x0000000135009550, nargs=0, arg_vector=(struct Lisp_Symbol *) $356 = 0x0000000100b32ec0) at eval.c:3153:9
    frame #6: 0x00000001002c2914 emacs`funcall_general(fun=(struct Lisp_Vector *) $361 = 0x0000000135009550, numargs=0, args=(struct Lisp_Symbol *) $364 = 0x0000000100b32ec0) at eval.c:2945:12
    frame #7: 0x00000001002bc8e0 emacs`Ffuncall(nargs=1, args=(struct Lisp_Symbol *) $367 = 0x0000000100b32ec0) at eval.c:2995:21
    frame #8: 0x00000001002c1224 emacs`Fapply(nargs=2, args=(struct Lisp_Symbol *) $370 = 0x0000000100b32ec0) at eval.c:2619:12
    frame #9: 0x00000001002c2e9c emacs`funcall_subr(subr=0x00000001004fca48, numargs=2, args=(struct Lisp_Symbol *) $373 = 0x0000000100b32ec0) at eval.c:3059:9
    frame #10: 0x000000010033bde4 emacs`exec_byte_code(fun=(struct Lisp_Vector *) $378 = 0x00000001044e6b58, args_template=257, nargs=1, args=(struct Lisp_Symbol *) $381 = 0x0000000100b32ec0) at bytecode.c:809:14
    frame #11: 0x00000001002c8054 emacs`fetch_and_exec_byte_code(fun=(struct Lisp_Vector *) $386 = 0x0000000104ae6e70, args_template=257, nargs=1, args=(struct Lisp_Symbol *) $389 = 0x0000000100b32ec0) at eval.c:3081:10
    frame #12: 0x00000001002c3300 emacs`funcall_lambda(fun=(struct Lisp_Vector *) $394 = 0x0000000104ae6e70, nargs=1, arg_vector=(struct Lisp_Symbol *) $397 = 0x0000000100b32ec0) at eval.c:3153:9
    frame #13: 0x00000001002c2914 emacs`funcall_general(fun=(struct Lisp_Vector *) $402 = 0x0000000104ae6e70, numargs=1, args=(struct Lisp_Symbol *) $405 = 0x0000000100b32ec0) at eval.c:2945:12
    frame #14: 0x00000001002bc8e0 emacs`Ffuncall(nargs=2, args=(struct Lisp_Symbol *) $408 = 0x0000000100b32ec0) at eval.c:2995:21
    frame #15: 0x00000001001a6da0 emacs`call1(fn=(struct Lisp_Symbol *) $411 = 0x0000000100b41f20, arg1=(struct Lisp_Vector *) $415 = 0x000000013500bc20) at lisp.h:3247:10
    frame #16: 0x00000001001b058c emacs`timer_check_2(timers=(struct Lisp_Cons *) $417 = 0x0000000105972560, idle_timers=(struct Lisp_Cons *) $419 = 0x0000000105972570) at keyboard.c:4681:8
    frame #17: 0x00000001001afc58 emacs`timer_check at keyboard.c:4747:18
    frame #18: 0x00000001001ac6b4 emacs`readable_events(flags=1) at keyboard.c:3524:5
    frame #19: 0x00000001001afae4 emacs`get_input_pending(flags=1) at keyboard.c:7367:42
    frame #20: 0x00000001001aac68 emacs`detect_input_pending_run_timers(do_display=true) at keyboard.c:10897:5
    frame #21: 0x0000000100350bec emacs`wait_reading_process_output(time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=(struct Lisp_Symbol *) $422 = 0x0000000100b32ec0, wait_proc=0x0000000000000000, just_wait_proc=0) at process.c:5779:8
    frame #22: 0x000000010000c54c emacs`sit_for(timeout=(EMACS_INT) $424 = 30, reading=true, display_option=1) at dispnew.c:6252:7
    frame #23: 0x00000001001a8a74 emacs`read_char(commandflag=1, map=(struct Lisp_Cons *) $426 = 0x000000010595beb0, prev_event=(struct Lisp_Symbol *) $429 = 0x0000000100b32ec0, used_mouse_menu=0x000000016fdfe837, end_time=0x0000000000000000) at keyboard.c:2872:11
    frame #24: 0x00000001001a3a6c emacs`read_key_sequence(keybuf=(struct Lisp_Symbol *) $432 = 0x0000000100b32ec0, prompt=(struct Lisp_Symbol *) $435 = 0x0000000100b32ec0, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:10074:12
    frame #25: 0x00000001001a1d84 emacs`command_loop_1 at keyboard.c:1376:15
    frame #26: 0x00000001002bdfd0 emacs`internal_condition_case(bfun=(emacs`command_loop_1 at keyboard.c:1270), handlers=(struct Lisp_Symbol *) $438 = 0x0000000100b32f50, hfun=(emacs`cmd_error at keyboard.c:928)) at eval.c:1474:25
    frame #27: 0x00000001001a1850 emacs`command_loop_2(handlers=(struct Lisp_Symbol *) $441 = 0x0000000100b32f50) at keyboard.c:1125:11
    frame #28: 0x00000001002bd1e8 emacs`internal_catch(tag=(struct Lisp_Symbol *) $444 = 0x0000000100b421f0, func=(emacs`command_loop_2 at keyboard.c:1121), arg=(struct Lisp_Symbol *) $447 = 0x0000000100b32f50) at eval.c:1197:25
    frame #29: 0x00000001001a0844 emacs`command_loop at keyboard.c:1103:2
    frame #30: 0x00000001001a0694 emacs`recursive_edit_1 at keyboard.c:712:9
    frame #31: 0x00000001001a0c68 emacs`Frecursive_edit at keyboard.c:795:3
    frame #32: 0x000000010019d420 emacs`main(argc=2, argv=0x000000016fdff3a0) at emacs.c:2523:3
    frame #33: 0x0000000100d3108c dyld`start + 520

Lisp backtrace:

(unsigned char *) data = 0x00000001004d0dc3 "treesit-node-field-name-for-child"
(unsigned char *) data = 0x0000000103967dc8 "treesit-node-field-name"
(unsigned char *) data = 0x000000010396a700 "treesit--explorer-draw-node"
(unsigned char *) data = 0x000000010396a700 "treesit--explorer-draw-node"
(unsigned char *) data = 0x000000010396a700 "treesit--explorer-draw-node"
(unsigned char *) data = 0x000000010396a700 "treesit--explorer-draw-node"
(unsigned char *) data = 0x000000010396a6b8 "treesit--explorer-refresh"
(unsigned char *) data = 0x00000001004b51f2 "apply"
(unsigned char *) data = 0x00000001004c04f2 "timer-event-handler"





       reply	other threads:[~2022-11-29 23:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1h6yhuzs4.fsf.ref@yahoo.es>
2022-11-29 23:06 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-11-30  8:51   ` bug#59703: 29.0.50; Emacs crashes when turning treesit-explore-mode on with some C++ code Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-30 10:44     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-30 10:52       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-30 12:45         ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-30 13:04           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-30 14:13       ` Eli Zaretskii
2022-11-30 10:13   ` Yuan Fu

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m1h6yhuzs4.fsf@yahoo.es \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59703@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /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 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).