unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@protonmail.com>
To: Eval Exec <execvy@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [MPS-test] scratch/igc branch (commit: 42731228d24) crashed
Date: Mon, 05 Aug 2024 16:20:21 +0000	[thread overview]
Message-ID: <87plqnuekc.fsf@protonmail.com> (raw)
In-Reply-To: <CAKfPJDp=qUcah_KwQpfosQqV=2G84qYwZ4AoAowSS2B-pxUVQw@mail.gmail.com>

"Eval Exec" <execvy@gmail.com> writes:

> I wanted to help test the scratch/igc branch, so I compiled it from
> commit 42731228d24.

Thank you for doing that!

> Then I build it by
> ```bash
> make extraclean
> ./autogen.sh \
>   && ./configure \
>   --prefix=$(realpath ../emacs-build)\
>   --with-mps \
>   --with-imagemagick \
>   --with-modules --with-x-toolkit=lucid --without-compress-install \
>   --without-toolkit-scroll-bars --with-native-compilation  --with-mailutils\
>   --with-tree-sitter --with-xinput2  \
>   --with-dbus  --with-native-compilation=aot \
>   --with-file-notification=inotify\
>   && make -j20 install

Like Eli, I'm suspecting the Lucid widget code...

> It works perfectly for the first hour, but then it crashes, and I
> don't know how to reproduce the issue.
>
> I think the crash is caused by "window size adjustments"
> ```
> (gdb) bt
> #0  0x00007f47afea2efc in __pthread_kill_implementation () from
> /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
> #1  0x00007f47afe52e86 in raise () from
> /nix/store/dbcw19dshdwnxdv5q2g6wldj6syyvq7l-glibc-2.39-52/lib/libc.so.6
> #2  0x00000000004243a4 in terminate_due_to_signal (sig=sig@entry=8,
> backtrace_limit=backtrace_limit@entry=40) at emacs.c:470
> #3  0x00000000004248fc in handle_fatal_signal (sig=sig@entry=8) at sysdep.c:1800
> #4  0x000000000056f568 in deliver_thread_signal (sig=8,
> handler=0x4248f1 <handle_fatal_signal>) at sysdep.c:1792
> #5  0x000000000056f669 in deliver_fatal_thread_signal (sig=<optimized
> out>) at sysdep.c:1812
> #6  <signal handler called>
> #7  0x000000000069e35e in pixel_to_char_size
> (pixel_width=pixel_width@entry=482,
> pixel_height=pixel_height@entry=76,
> char_width=char_width@entry=0x7ffced20da38,
> char_height=char_height@entry=0x7ffced20da3c,
>     ew=<optimized out>) at widget.c:172

That code reads:

static void
pixel_to_char_size (EmacsFrame ew, Dimension pixel_width,
		    Dimension pixel_height, int *char_width, int *char_height)
{
  struct frame *f = ew->emacs_frame.frame;

  *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width);
  *char_height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (int) pixel_height);
}

Which gets a frame pointer from a structure (ew) that MPS doesn't know
about; but frames can move, so that explains the bug, because MPS
doesn't know to update the pointer in the EmacsFrame structure.

Unfortunately, the structure is allocated by XtCreateWidget, which calls
malloc(), IIUC. So it's not immediately obvious (to me) how to fix it.
My best idea so far is to create an ambiguous root covering the frame
pointer and store that in the structure instead.

Pip




  parent reply	other threads:[~2024-08-05 16:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05 15:00 [MPS-test] scratch/igc branch (commit: 42731228d24) crashed Eval Exec
2024-08-05 15:12 ` Gerd Möllmann
2024-08-05 15:18   ` Eval Exec
2024-08-05 15:34     ` Gerd Möllmann
2024-08-05 15:20   ` Eval Exec
2024-08-05 15:45     ` Gerd Möllmann
2024-08-05 15:48       ` Eval Exec
2024-08-05 15:55         ` Eval Exec
2024-08-05 16:14       ` Eval Exec
2024-08-05 15:29 ` Eli Zaretskii
2024-08-05 15:33   ` Eval Exec
2024-08-05 15:47   ` Gerd Möllmann
2024-08-05 15:54     ` Eli Zaretskii
2024-08-05 16:01       ` Gerd Möllmann
2024-08-05 16:20 ` Pip Cet [this message]
2024-08-05 16:40   ` Pip Cet
2024-08-05 16:50     ` Eval Exec
2024-08-05 17:45     ` Eli Zaretskii
2024-08-05 18:00       ` Pip Cet
2024-08-05 18:19         ` Eli Zaretskii
2024-08-08 16:56     ` Eval Exec

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=87plqnuekc.fsf@protonmail.com \
    --to=pipcet@protonmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=execvy@gmail.com \
    /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).