GNU bug report logs - #59832
30.0.50; [TREESIT] Segfault in treesit_load_language

Previous Next

Package: emacs;

Reported by: German Pacenza <germanp82 <at> hotmail.com>

Date: Mon, 5 Dec 2022 09:57:01 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

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 59832 in the body.
You can then email your comments to 59832 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#59832; Package emacs. (Mon, 05 Dec 2022 09:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to German Pacenza <germanp82 <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 05 Dec 2022 09:57:01 GMT) Full text and rfc822 format available.

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

From: German Pacenza <germanp82 <at> hotmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 06:50:32 -0300
In release build emacs segfaults when loading a ts-mode for which
language definitions are unavailable.
Building with -g3 -O0 emacs shows a warning buffer instead of crashing.



In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2022-12-05 built on KRONOS
Repository revision: 4fa37dc426184811e39ce113f6af7f5b308f116b
Repository branch: master
System Description: Manjaro Linux

Configured using:
 'configure --without-modules --without-libotf --without-m17n-flt
 --without-gconf --with-pgtk --with-sound=no --without-gpm
 --with-native-compilation --without-gsettings --without-libsystemd
 --without-sqlite3 --without-xim --with-xwidgets
 --without-compress-install --prefix=/home/german/.local/emacs'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2
LIBXML2 NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP THREADS
TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: es_AR.UTF-8
  value of $LC_NUMERIC: es_AR.UTF-8
  value of $LC_TIME: es_AR.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  savehist-mode: t
  popper-mode: t
  electric-pair-mode: t
  vertico-mode: t
  minibuffer-depth-indicate-mode: t
  delete-selection-mode: t
  global-so-long-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/german/.emacs.d/elpa/transient-0.3.7/transient hides /home/german/.local/emacs/share/emacs/30.0.50/lisp/transient

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils orderless
savehist popper comp comp-cstr subr-x rx cl-seq cl-macs gv cl-extra
help-mode bytecomp byte-compile elec-pair vertico mb-depth delsel
xah-fly-keys g3r-dark-theme info vertico-autoloads orderless-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
aircon-theme-autoloads popper-autoloads helpful-autoloads f-autoloads
rainbow-mode-autoloads elisp-refs-autoloads s-autoloads compat-autoloads
magit-autoloads magit-section-autoloads git-commit-autoloads
with-editor-autoloads transient-autoloads dash-autoloads warnings icons
so-long cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal dbusbind
inotify dynamic-setting font-render-setting cairo gtk pgtk lcms2
multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 102467 63599)
 (symbols 48 8610 7)
 (strings 32 29434 9285)
 (string-bytes 1 892462)
 (vectors 16 16750)
 (vector-slots 8 343188 133003)
 (floats 8 51 306)
 (intervals 56 558 67)
 (buffers 992 11))

-- 
German Pacenza




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Mon, 05 Dec 2022 11:45:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: 59832 <at> debbugs.gnu.org
Cc: German Pacenza <germanp82 <at> hotmail.com>
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 12:44:37 +0100
What version of tree-sitter do you have installed on your system?

Some time between 20.3 and 20.7 there was a bug causing similar crashes.
Could you try updating to a new version of tree-sitter, or provide some
more information about the crash?

Thanks,

Theo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Mon, 05 Dec 2022 12:51:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 14:49:56 +0200
> From: German Pacenza <germanp82 <at> hotmail.com>
> Date: Mon, 05 Dec 2022 06:50:32 -0300
> 
> 
> In release build emacs segfaults when loading a ts-mode for which
> language definitions are unavailable.

Please run Emacs under GDB and when it crashes, type

  (gdb) thread apply all bt

and post here everything this produces.

> Building with -g3 -O0 emacs shows a warning buffer instead of crashing.

Please show the text in the warning buffer.

It is very hard to investigate this problem without the data I described
above.  Please try providing it.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Mon, 05 Dec 2022 14:33:02 GMT) Full text and rfc822 format available.

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

From: German Pacenza <germanp82 <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 11:31:53 -0300
Eli Zaretskii <eliz <at> gnu.org> writes:

> Please run Emacs under GDB and when it crashes, type
>
>   (gdb) thread apply all bt
>
> and post here everything this produces.
>
>> Building with -g3 -O0 emacs shows a warning buffer instead of crashing.
>
> Please show the text in the warning buffer.
>
> It is very hard to investigate this problem without the data I described
> above.  Please try providing it.
>
> Thanks.

The message in debug build is:

⛔ Warning (treesit): Cannot activate tree-sitter, because language definition for c is unavailable (symbol-error): src/emacs: undefined symbol: tree_sitter_c


Backtrace of the release build:
(gdb) thread apply all bt

Thread 5 (Thread 0x7fffdd3fb6c0 (LWP 1794) "dconf worker"):
#0  0x00007fffeef140bf in poll () at /usr/lib/libc.so.6
#1  0x00007ffff70e81ff in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7090132 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007fffdf592fde in  () at /usr/lib/gio/modules/libdconfsettings.so
#4  0x00007ffff70bee05 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007fffeee9f8fd in  () at /usr/lib/libc.so.6
#6  0x00007fffeef21a60 in  () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7fffddbfc6c0 (LWP 1793) "gdbus"):
#0  0x00007fffeef140bf in poll () at /usr/lib/libc.so.6
#1  0x00007ffff70e81ff in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7090ddf in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff72e637c in  () at /usr/lib/libgio-2.0.so.0
#4  0x00007ffff70bee05 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007fffeee9f8fd in  () at /usr/lib/libc.so.6
#6  0x00007fffeef21a60 in  () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7fffdebfe6c0 (LWP 1791) "gmain"):
#0  0x00007fffeef140bf in poll () at /usr/lib/libc.so.6
#1  0x00007ffff70e81ff in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7090132 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff7090182 in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff70bee05 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007fffeee9f8fd in  () at /usr/lib/libc.so.6
#6  0x00007fffeef21a60 in  () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7fffea480940 (LWP 1788) "emacs"):
#0  treesit_load_language (language_symbol=<optimized out>, signal_symbol=0x7fffffffd348, signal_data=0x7fffffffd350) at treesit.c:565
#1  0x00005555557e7e74 in Ftreesit_langauge_available_p (language=0x3d80, detail=0x30) at treesit.c:628
#2  0x0000555555759756 in Ffuncall (nargs=3, args=0x7fffffffd3f0) at eval.c:2995
#3  0x00007fffcfbe3219 in F747265657369742d72656164792d70_treesit_ready_p_0 () at /home/german/.emacs.d/eln-cache/30.0.50-f7873392/treesit-37439c61-1dbc135d.eln
#4  0x000055555579e890 in exec_byte_code (fun=<optimized out>, args_template=<optimized out>, nargs=<optimized out>, args=<optimized out>) at bytecode.c:809
#5  0x0000555555759756 in Ffuncall (nargs=nargs <at> entry=1, args=args <at> entry=0x7fffffffd6e8) at eval.c:2995
#6  0x000055555575562e in Ffuncall_interactively (nargs=1, args=0x7fffffffd6e8) at callint.c:248
#7  0x0000555555759756 in Ffuncall (nargs=2, args=0x7fffffffd6e0) at eval.c:2995
#8  0x0000555555759b28 in Fapply (nargs=nargs <at> entry=3, args=args <at> entry=0x7fffffffd6e0) at eval.c:2619
#9  0x0000555555756ec2 in Fcall_interactively (function=0x2aaa8a451450, record_flag=0xd5f0, keys=0x555556efaf25) at callint.c:340
#10 0x00007fffe10b73e5 in F636f6d6d616e642d65786563757465_command_execute_0 () at /home/german/.local/emacs/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-f7873392/preloaded/simple-fab5b0cf-fe41d9a7.eln
#11 0x0000555555759756 in Ffuncall (nargs=3, args=0x7fffffffd8d0) at eval.c:2995
#12 0x00007fffe10b60c9 in F657865637574652d657874656e6465642d636f6d6d616e64_execute_extended_command_0 () at /home/german/.local/emacs/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-f7873392/preloaded/simple-fab5b0cf-fe41d9a7.eln
#13 0x0000555555759756 in Ffuncall (nargs=nargs <at> entry=4, args=args <at> entry=0x7fffffffda18) at eval.c:2995
--Type <RET> for more, q to quit, c to continue without paging--c
#14 0x000055555575562e in Ffuncall_interactively (nargs=4, args=0x7fffffffda18) at callint.c:248
#15 0x0000555555759756 in Ffuncall (nargs=5, args=0x7fffffffda10) at eval.c:2995
#16 0x0000555555759970 in Fapply (nargs=nargs <at> entry=3, args=args <at> entry=0x7fffffffdb80) at eval.c:2666
#17 0x0000555555756ec2 in Fcall_interactively (function=0x2aaa89fc8af8, record_flag=0x0, keys=0x7fffe0627a1d) at callint.c:340
#18 0x00007fffe10b73e5 in F636f6d6d616e642d65786563757465_command_execute_0 () at /home/german/.local/emacs/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-f7873392/preloaded/simple-fab5b0cf-fe41d9a7.eln
#19 0x0000555555759756 in Ffuncall (nargs=nargs <at> entry=2, args=args <at> entry=0x7fffffffdd30) at eval.c:2995
#20 0x00005555556dc549 in call1 (arg1=<optimized out>, fn=0x49b0) at /home/german/repos/emacs/src/lisp.h:3247
#21 command_loop_1 () at keyboard.c:1495
#22 0x0000555555757e37 in internal_condition_case (bfun=bfun <at> entry=0x5555556dc150 <command_loop_1>, handlers=handlers <at> entry=0x90, hfun=hfun <at> entry=0x5555556cf1a0 <cmd_error>) at eval.c:1474
#23 0x00005555556c7c66 in command_loop_2 (handlers=handlers <at> entry=0x90) at keyboard.c:1125
#24 0x0000555555757d91 in internal_catch (tag=tag <at> entry=0xfa50, func=func <at> entry=0x5555556c7c40 <command_loop_2>, arg=arg <at> entry=0x90) at eval.c:1197
#25 0x00005555556c7c01 in command_loop () at keyboard.c:1103
#26 0x00005555556ced22 in recursive_edit_1 () at keyboard.c:712
#27 0x00005555556cf0b0 in Frecursive_edit () at keyboard.c:795
#28 0x00005555555e0a66 in main (argc=<optimized out>, argv=0x7fffffffe1f8) at emacs.c:2523


-- 
German Pacenza




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Mon, 05 Dec 2022 14:58:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 16:57:20 +0200
> From: German Pacenza <germanp82 <at> hotmail.com>
> Cc: 59832 <at> debbugs.gnu.org
> Date: Mon, 05 Dec 2022 11:31:53 -0300
> 
> Thread 1 (Thread 0x7fffea480940 (LWP 1788) "emacs"):
> #0  treesit_load_language (language_symbol=<optimized out>, signal_symbol=0x7fffffffd348, signal_data=0x7fffffffd350) at treesit.c:565
> #1  0x00005555557e7e74 in Ftreesit_langauge_available_p (language=0x3d80, detail=0x30) at treesit.c:628

Thanks.  Please show the output of the following:

  (gdb) frame 0
  (gdb) print XCAR(tail)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Mon, 05 Dec 2022 15:07:02 GMT) Full text and rfc822 format available.

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

From: German Pacenza <germanp82 <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 12:06:13 -0300
Eli Zaretskii <eliz <at> gnu.org> writes:


> Thanks.  Please show the output of the following:
>
>   (gdb) frame 0
>   (gdb) print XCAR(tail)

Running that after it crashes shows:

(gdb) frame 0
#0  treesit_load_language (language_symbol=<optimized out>, signal_symbol=0x7fffffffd2f8, 
    signal_data=0x7fffffffd300) at treesit.c:565
565	     char *library_name = SSDATA (XCAR (tail));
(gdb) print XCAR(tail)
No symbol "XCAR" in current context.
(gdb) 

-- 
German Pacenza




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Mon, 05 Dec 2022 15:43:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 17:42:14 +0200
> From: German Pacenza <germanp82 <at> hotmail.com>
> Cc: 59832 <at> debbugs.gnu.org
> Date: Mon, 05 Dec 2022 12:06:13 -0300
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> 
> > Thanks.  Please show the output of the following:
> >
> >   (gdb) frame 0
> >   (gdb) print XCAR(tail)
> 
> Running that after it crashes shows:
> 
> (gdb) frame 0
> #0  treesit_load_language (language_symbol=<optimized out>, signal_symbol=0x7fffffffd2f8, 
>     signal_data=0x7fffffffd300) at treesit.c:565
> 565	     char *library_name = SSDATA (XCAR (tail));
> (gdb) print XCAR(tail)
> No symbol "XCAR" in current context.
> (gdb) 

That's because your build is without -g3.  Can you rebuild with

  CFLAGS='-O2 -g3' ./configure ...

?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Mon, 05 Dec 2022 20:48:01 GMT) Full text and rfc822 format available.

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

From: German Pacenza <germanp82 <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Mon, 05 Dec 2022 17:47:43 -0300
The crash happens when compiling with '--without-modules', if I remove
it emacs doesn't crash.


Eli Zaretskii <eliz <at> gnu.org> writes:

>> Running that after it crashes shows:
>> 
>> (gdb) frame 0
>> #0  treesit_load_language (language_symbol=<optimized out>, signal_symbol=0x7fffffffd2f8, 
>>     signal_data=0x7fffffffd300) at treesit.c:565
>> 565	     char *library_name = SSDATA (XCAR (tail));
>> (gdb) print XCAR(tail)
>> No symbol "XCAR" in current context.
>> (gdb) 
>
> That's because your build is without -g3.  Can you rebuild with
>
>   CFLAGS='-O2 -g3' ./configure ...
>
> ?

I get the same result.

-- 
German Pacenza




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Tue, 06 Dec 2022 12:04:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 06 Dec 2022 14:02:57 +0200
> From: German Pacenza <germanp82 <at> hotmail.com>
> Cc: 59832 <at> debbugs.gnu.org
> Date: Mon, 05 Dec 2022 17:47:43 -0300
> 
> 
> The crash happens when compiling with '--without-modules', if I remove
> it emacs doesn't crash.
> 
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Running that after it crashes shows:
> >> 
> >> (gdb) frame 0
> >> #0  treesit_load_language (language_symbol=<optimized out>, signal_symbol=0x7fffffffd2f8, 
> >>     signal_data=0x7fffffffd300) at treesit.c:565
> >> 565	     char *library_name = SSDATA (XCAR (tail));
> >> (gdb) print XCAR(tail)
> >> No symbol "XCAR" in current context.
> >> (gdb) 
> >
> > That's because your build is without -g3.  Can you rebuild with
> >
> >   CFLAGS='-O2 -g3' ./configure ...
> >
> > ?
> 
> I get the same result.

Strange, it shouldn't have happened.  How is CFLAGS set on src/Makefile?  It
should be something like this:

  CFLAGS = -O2 -g3

Also, please try printing the value of the full list of the candidate
libraries:

  (gdb) source .gdbinit
  (gdb) pp path_candidates

The file .gdbinit is in the src directory of the Emacs source tree, so if
you start GDB not from that directory, you will need to type the full
absolute file name of .gdbinit in the "source" command.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Tue, 06 Dec 2022 13:07:01 GMT) Full text and rfc822 format available.

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

From: German Pacenza <germanp82 <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 06 Dec 2022 10:06:24 -0300
Eli Zaretskii <eliz <at> gnu.org> writes:

> Strange, it shouldn't have happened.  How is CFLAGS set on src/Makefile?  It
> should be something like this:
>
>   CFLAGS = -O2 -g3

git clean -fxd
./autogen.sh
CFLAGS="-O2 -g3" ./configure --without-modules ...

Inside src/Makefile is CFLAGS = -O2 -g3

I also tried ggdb3 with the same result

file src/emacs:
src/emacs: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=3cc057b3a7d0f18ff7c819c55a4da8d7ac355846, for GNU/Linux 4.4.0, with debug_info, not stripped

>
> Also, please try printing the value of the full list of the candidate
> libraries:
>
>   (gdb) source .gdbinit
>   (gdb) pp path_candidates
>
> The file .gdbinit is in the src directory of the Emacs source tree, so if
> you start GDB not from that directory, you will need to type the full
> absolute file name of .gdbinit in the "source" command.

Running from src directory:

gdb ./emacs
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./emacs...
SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
DISPLAY = :0
WAYLAND_DISPLAY = wayland-0
TERM = foot
Breakpoint 1 at 0x46a18: file emacs.c, line 426.
(gdb) source .gdbinit 
SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
Redefine command "xgetptr"? (y or n) [answered Y; input not from terminal]
Redefine command "xgetint"? (y or n) [answered Y; input not from terminal]
Redefine command "xgettype"? (y or n) [answered Y; input not from terminal]
Redefine command "xgetsym"? (y or n) [answered Y; input not from terminal]
Redefine command "xsymname"? (y or n) [answered Y; input not from terminal]
Redefine command "pr"? (y or n) [answered Y; input not from terminal]
Redefine command "pp"? (y or n) [answered Y; input not from terminal]
Redefine command "pv"? (y or n) [answered Y; input not from terminal]
Redefine command "xfmt"? (y or n) [answered Y; input not from terminal]
Redefine command "ppt"? (y or n) [answered Y; input not from terminal]
Redefine command "pitmethod"? (y or n) [answered Y; input not from terminal]
Redefine command "pitx"? (y or n) [answered Y; input not from terminal]
Redefine command "pit"? (y or n) [answered Y; input not from terminal]
Redefine command "prowx"? (y or n) [answered Y; input not from terminal]
Redefine command "prow"? (y or n) [answered Y; input not from terminal]
Redefine command "pcursorx"? (y or n) [answered Y; input not from terminal]
Redefine command "pcursor"? (y or n) [answered Y; input not from terminal]
Redefine command "pwinx"? (y or n) [answered Y; input not from terminal]
Redefine command "pwin"? (y or n) [answered Y; input not from terminal]
Redefine command "pbiditype"? (y or n) [answered Y; input not from terminal]
Redefine command "pgx"? (y or n) [answered Y; input not from terminal]
Redefine command "pg"? (y or n) [answered Y; input not from terminal]
Redefine command "pgi"? (y or n) [answered Y; input not from terminal]
Redefine command "pgn"? (y or n) [answered Y; input not from terminal]
--Type <RET> for more, q to quit, c to continue without paging--c
Redefine command "pgrowx"? (y or n) [answered Y; input not from terminal]
Redefine command "pgrow"? (y or n) [answered Y; input not from terminal]
Redefine command "pgrowit"? (y or n) [answered Y; input not from terminal]
Redefine command "prowlims"? (y or n) [answered Y; input not from terminal]
Redefine command "pmtxrows"? (y or n) [answered Y; input not from terminal]
Redefine command "xtype"? (y or n) [answered Y; input not from terminal]
Redefine command "pvectype"? (y or n) [answered Y; input not from terminal]
Redefine command "xvectype"? (y or n) [answered Y; input not from terminal]
Redefine command "pvecsize"? (y or n) [answered Y; input not from terminal]
Redefine command "xvecsize"? (y or n) [answered Y; input not from terminal]
Redefine command "xint"? (y or n) [answered Y; input not from terminal]
Redefine command "xptr"? (y or n) [answered Y; input not from terminal]
Redefine command "xmarker"? (y or n) [answered Y; input not from terminal]
Redefine command "xoverlay"? (y or n) [answered Y; input not from terminal]
Redefine command "xsymwithpos"? (y or n) [answered Y; input not from terminal]
Redefine command "xsymbol"? (y or n) [answered Y; input not from terminal]
Redefine command "xstring"? (y or n) [answered Y; input not from terminal]
Redefine command "xvector"? (y or n) [answered Y; input not from terminal]
Redefine command "xprocess"? (y or n) [answered Y; input not from terminal]
Redefine command "xframe"? (y or n) [answered Y; input not from terminal]
Redefine command "xcompiled"? (y or n) [answered Y; input not from terminal]
Redefine command "xwindow"? (y or n) [answered Y; input not from terminal]
Redefine command "xwinconfig"? (y or n) [answered Y; input not from terminal]
Redefine command "xsubr"? (y or n) [answered Y; input not from terminal]
Redefine command "xchartable"? (y or n) [answered Y; input not from terminal]
Redefine command "xsubchartable"? (y or n) [answered Y; input not from terminal]
Redefine command "xboolvector"? (y or n) [answered Y; input not from terminal]
Redefine command "xbuffer"? (y or n) [answered Y; input not from terminal]
Redefine command "xhashtable"? (y or n) [answered Y; input not from terminal]
Redefine command "xcons"? (y or n) [answered Y; input not from terminal]
Redefine command "nextcons"? (y or n) [answered Y; input not from terminal]
Redefine command "xcar"? (y or n) [answered Y; input not from terminal]
Redefine command "xcdr"? (y or n) [answered Y; input not from terminal]
Redefine command "xlist"? (y or n) [answered Y; input not from terminal]
Redefine command "xfloat"? (y or n) [answered Y; input not from terminal]
Redefine command "xscrollbar"? (y or n) [answered Y; input not from terminal]
Redefine command "xpr"? (y or n) [answered Y; input not from terminal]
Redefine command "xprintstr"? (y or n) [answered Y; input not from terminal]
Redefine command "xprintsym"? (y or n) [answered Y; input not from terminal]
Redefine command "xcoding"? (y or n) [answered Y; input not from terminal]
Redefine command "xcharset"? (y or n) [answered Y; input not from terminal]
Redefine command "xfontset"? (y or n) [answered Y; input not from terminal]
Redefine command "xfont"? (y or n) [answered Y; input not from terminal]
Redefine command "xbacktrace"? (y or n) [answered Y; input not from terminal]
Redefine command "xprintbytestr"? (y or n) [answered Y; input not from terminal]
Redefine command "xwhichsymbols"? (y or n) [answered Y; input not from terminal]
Redefine command "hookpost-backtrace"? (y or n) [answered Y; input not from terminal]
Redefine command "ff"? (y or n) [answered Y; input not from terminal]
DISPLAY = :0
WAYLAND_DISPLAY = wayland-0
TERM = foot
Breakpoint 2 at 0x46a18: file emacs.c, line 426.
(gdb) pp path_candidates
No symbol "path_candidates" in current context.
(gdb) run
Starting program: /home/german/repos/emacs-test/src/emacs 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffee7fe6c0 (LWP 71788)]
[New Thread 0x7fffedffd6c0 (LWP 71789)]
[New Thread 0x7fffed7fc6c0 (LWP 71790)]
[New Thread 0x7fffecffb6c0 (LWP 71791)]
[Detaching after vfork from child process 71792]
[Detaching after vfork from child process 71796]

Thread 1 "emacs" received signal SIGSEGV, Segmentation fault.
treesit_load_language (language_symbol=<optimized out>, signal_symbol=0x7fffffffd4e8, signal_data=0x7fffffffd4f0) at treesit.c:565
565	     char *library_name = SSDATA (XCAR (tail));
(gdb) pp path_candidates
[Thread 0x7fffedffd6c0 (LWP 71789) exited]
nil
(gdb) 

-- 
German Pacenza




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Tue, 06 Dec 2022 14:41:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 06 Dec 2022 16:39:54 +0200
> From: German Pacenza <germanp82 <at> hotmail.com>
> Cc: 59832 <at> debbugs.gnu.org
> Date: Tue, 06 Dec 2022 10:06:24 -0300
> 
> (gdb) pp path_candidates
> [Thread 0x7fffedffd6c0 (LWP 71789) exited]
> nil

It's nil??  What is the value of dynamic-library-suffixes in your Emacs?
What does the below show inside "emacs -Q"?

  M-: dynamic-library-suffixes RET

And what does the below produce from a shell prompt in the Emacs src
directory:

 $ grep DYNAMIC_LIB_ config.h





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Tue, 06 Dec 2022 15:02:01 GMT) Full text and rfc822 format available.

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

From: German Pacenza <germanp82 <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 06 Dec 2022 12:01:39 -0300
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: German Pacenza <germanp82 <at> hotmail.com>
>> Cc: 59832 <at> debbugs.gnu.org
>> Date: Tue, 06 Dec 2022 10:06:24 -0300
>> 
>> (gdb) pp path_candidates
>> [Thread 0x7fffedffd6c0 (LWP 71789) exited]
>> nil
>
> It's nil??  What is the value of dynamic-library-suffixes in your Emacs?
> What does the below show inside "emacs -Q"?
>
>   M-: dynamic-library-suffixes RET
>

In emacs compiled with "--without-modules" (The one that crashes):

Debugger entered--Lisp error: (void-variable dynamic-library-suffixes)
  eval-expression(dynamic-library-suffixes nil nil 127)
  funcall-interactively(eval-expression dynamic-library-suffixes nil nil 127)
  command-execute(eval-expression)

Without "--without-modules" (Working version):
(".so" "")

> And what does the below produce from a shell prompt in the Emacs src
> directory:
>
>  $ grep DYNAMIC_LIB_ config.h
>

#define DYNAMIC_LIB_SECONDARY_SUFFIX ""
#define DYNAMIC_LIB_SUFFIX ".so"

-- 
German Pacenza




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Tue, 06 Dec 2022 15:23:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 06 Dec 2022 17:22:07 +0200
> From: German Pacenza <germanp82 <at> hotmail.com>
> Cc: 59832 <at> debbugs.gnu.org
> Date: Tue, 06 Dec 2022 12:01:39 -0300
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > It's nil??  What is the value of dynamic-library-suffixes in your Emacs?
> > What does the below show inside "emacs -Q"?
> >
> >   M-: dynamic-library-suffixes RET
> >
> 
> In emacs compiled with "--without-modules" (The one that crashes):
> 
> Debugger entered--Lisp error: (void-variable dynamic-library-suffixes)
>   eval-expression(dynamic-library-suffixes nil nil 127)
>   funcall-interactively(eval-expression dynamic-library-suffixes nil nil 127)
>   command-execute(eval-expression)
> 
> Without "--without-modules" (Working version):
> (".so" "")

Thanks, now everything is clear.  Should be fixed on the release branch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Tue, 06 Dec 2022 15:32:02 GMT) Full text and rfc822 format available.

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

From: German Pacenza <germanp82 <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59832 <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 06 Dec 2022 12:31:37 -0300
Eli Zaretskii <eliz <at> gnu.org> writes:

> Thanks, now everything is clear.  Should be fixed on the release branch.

Just tested emacs-29 and confirm it is working now.
Thanks.
-- 
German Pacenza




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Tue, 06 Dec 2022 15:45:02 GMT) Full text and rfc822 format available.

Notification sent to German Pacenza <germanp82 <at> hotmail.com>:
bug acknowledged by developer. (Tue, 06 Dec 2022 15:45:02 GMT) Full text and rfc822 format available.

Message #49 received at 59832-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: German Pacenza <germanp82 <at> hotmail.com>
Cc: 59832-done <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 06 Dec 2022 17:43:47 +0200
> From: German Pacenza <germanp82 <at> hotmail.com>
> Cc: 59832 <at> debbugs.gnu.org
> Date: Tue, 06 Dec 2022 12:31:37 -0300
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Thanks, now everything is clear.  Should be fixed on the release branch.
> 
> Just tested emacs-29 and confirm it is working now.
> Thanks.

Thanks for testing, I'm therefore closing the bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59832; Package emacs. (Tue, 06 Dec 2022 21:13:02 GMT) Full text and rfc822 format available.

Message #52 received at 59832-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: German Pacenza <germanp82 <at> hotmail.com>, 59832-done <at> debbugs.gnu.org
Subject: Re: bug#59832: 30.0.50; [TREESIT] Segfault in treesit_load_language
Date: Tue, 6 Dec 2022 13:12:11 -0800

> On Dec 6, 2022, at 7:43 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: German Pacenza <germanp82 <at> hotmail.com>
>> Cc: 59832 <at> debbugs.gnu.org
>> Date: Tue, 06 Dec 2022 12:31:37 -0300
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>>> Thanks, now everything is clear.  Should be fixed on the release branch.
>> 
>> Just tested emacs-29 and confirm it is working now.
>> Thanks.
> 
> Thanks for testing, I'm therefore closing the bug.
> 

Thanks Eli, I’ve been following this thread but didn’t have much help to offer :-)

Yuan



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Jan 2023 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 113 days ago.

Previous Next


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