Subject: bug#76004: 31.0.50; feature/igc crashed on Linux, wayland (with full gdb debug info)

From: Pip Cet <[email-masked]>
Date: Sun, 02 Feb 2025 09:02:15 +0000

"Eval EXEC" <[email-masked]> writes:

> Hello,
>
> I'm helping to test feature/igc branch, and I got a crash, with full gdb
> debug info.
>
> I build this emacs executable with:
> ```bash
> set -ex
>
> make extraclean
>
> BRANCH_NAME=$(git branch --show-current | sed 's/\//_/g')
> COMMIT_ID=$(git rev-parse HEAD)
> BUILD_DIR=${BRANCH_NAME}-${COMMIT_ID}-gdb
> INSTALL_PREFIX=$(realpath ../emacs-build/${BUILD_DIR})
>
> ./autogen.sh
> ./configure  CFLAGS='-g -ggdb -march=native' \
>   --prefix=${INSTALL_PREFIX} \
>   --with-imagemagick  \
>   --with-mps=yes \
>   --with-xwidgets \
>   --with-modules \
>   --with-cairo --with-cairo-xcb \
>   --without-compress-install \
>   --with-mailutils\
>   --enable-link-time-optimization \
>   --with-tree-sitter --with-xinput2 \
>   --with-dbus \
>   --with-native-compilation=aot \
>   --with-file-notification=inotify\
>   && make -j20 install
> ```
>
> What should I do to help you to investigate this crash?

Could you also print the address of lispsym:

p &lispsym

as well as provide the mapped memory ranges; if you have a corefile,

objdump -h <core>

from the shell prompt will work.  If you don't, run "gcore" from gdb to
generate one.

I'm very confused about

         binding = XIL(0x7f6c2ae81440)

Lisp symbols aren't represented as pointers to their structs, there's an
offset in there, by the address of &lispsym (so the 0 word corresponds
to &lispsym[0] rather than a NULL pointer).

On my system, I've never seen the address of &lispsym be so small that
binding would remain in the valid 47-bit address range once we add the
lispsym offset.  This would explain the segfault (though not why GDB
makes inaccurate claims).

Pip