bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70495: 29.3.50; M-x lsp leads to assertion failed: pdl->kind == SPEC


From: Eli Zaretskii
Subject: bug#70495: 29.3.50; M-x lsp leads to assertion failed: pdl->kind == SPECPDL_BACKTRACE
Date: Sun, 21 Apr 2024 13:52:30 +0300

> Date: Sun, 21 Apr 2024 12:41:05 +0300
> From: andrei.elkin--- via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> How to reproduce
> ================
> 
> 0. Have lsp-mode and lsp-ui installed with up-to-now (21.4.2024 12.23.26 
> +0300)
>    versions
> 
>    lsp-mode-20240317.1845
>    lsp-ui-20240421.24
> 
> 1  Open a c++ file (compile_commands.json is not needed)
> 2. do a few lsp commands like M-. to end up with
> 
> xdisp.c:23978: Emacs fatal error: assertion failed: it->method == 
> GET_FROM_BUFFER || it->method == GET_FROM_DISPLAY_VECTOR || it->method == 
> GET_FROM_STRING || it->method == GET_FROM_IMAGE
> Fatal error 6: Aborted

Sorry, I cannot afford installing lsp-mode and lsp-ui (which in this
case will need to also install clang for the LSP server, right?), and
I don't know how to use it anyway.  So I need you to tell me what's in
the buffer at that position when this happens: how does
lsp-mode/lsp-ui set the line-prefix or wrap-prefix, etc.  If you can
come up with a Lisp recipe that doesn't need lsp-* to be installed and
still reproduces the problem, this would be the best, as I could debug
this on my machine.

Alternatively, give me an ssh login on your machine and give
instructions for reproducing the problem (hopefully, it can be
reproduced in a -nw session, i.e. without GUI frames), so I could look
around and see what went wrong.

As the minimum meaningful data for now, please type these GDB commands
and tell what they produce:

  (gdb) frame 11
  (gdb) print it->method
  (gdb) print it->sp

> #11 0x000055555559cd88 in push_prefix_prop (prop=Python Exception <class 
> 'gdb.error'> value has been optimized out: 
> , it=0x7fffffff6c60) at xdisp.c:23978

I don't understand the above call-stack frame: it lists the arguments
of push_prefix_prop in reverse order.  The source code is this:

  static bool
  push_prefix_prop (struct it *it, Lisp_Object prop)

so it's first 'it', then 'prop', whereas the backtrace above shows
them in reverse order.  It could be the problem with your optimized
build, so please see if the problem can be reproduced in an
unoptimized build (with the -O0 compiler switch), and post the
backtrace from that build if it also aborts.

Also, start GDB from a directory other than the Emacs 'src' directory,
because it looks like the Python commands in src/.gdbinit cause
trouble to your installation of GDB.

> Configured using:
>  'configure --with-x-toolkit=gtk --with-json
>  --enable-checking=yes,glyphs --enable-check-lisp-object-type
>  'CFLAGS=-ggdb3 -O3' LDFLAGS=-ggdb3 'CXXFLAGS=-ggdb3 -O3''

Building Emacs with -O3 optimization switch is not a good idea:
depending on your GCC version, this could produce invalid code due to
all kinds of aggressive optimizations by GCC.  So I'd be interested to
know whether this abort happens with -O0 and -O2 optimization switches
instead.

(And if you do need to use -O3 for some reason, why on earth are you
also using --enable-checking=yes,glyphs --enable-check-lisp-object-type,
which add all kinds of run-time checks to Emacs, and are intended to
be used by the Emacs developers when debugging Emacs?)

What version of GCC are you using to build Emacs, btw?

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]