all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: gerd.moellmann@gmail.com
Cc: eller.helmut@gmail.com, emacs-devel@gnu.org
Subject: Re: Building the igc branch on MS-Windows
Date: Sat, 27 Apr 2024 09:58:00 +0300	[thread overview]
Message-ID: <868r0zxpfr.fsf@gnu.org> (raw)
In-Reply-To: <86il03xrlz.fsf@gnu.org> (message from Eli Zaretskii on Sat, 27 Apr 2024 09:11:04 +0300)

> Date: Sat, 27 Apr 2024 09:11:04 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org
> 
>   *** MPS GC start: Client requests: immediate full collection.
> 
>   Thread 1 received signal SIGSEGV, Segmentation fault.
>   XCAR (c=0xb2c6f33) at lisp.h:751
>   751       return lisp_h_XLP (o);
>   (gdb) bt
>   #0  XCAR (c=0xb2c6f33) at lisp.h:751
>   #1  assoc_no_quit (key=<optimized out>, alist=0xb2c6f33) at fns.c:2032
>   #2  0x0100c20d in font_list_entities (f=0xaa1c478, spec=0xa8217a5)
>       at font.c:2795

The crash is here:

  for (; driver_list; driver_list = driver_list->next)
    if (driver_list->on
	&& (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
      {
	Lisp_Object cache = font_get_cache (f, driver_list->driver);

	ASET (scratch_font_spec, FONT_TYPE_INDEX, driver_list->driver->type);
	val = assoc_no_quit (scratch_font_spec, XCDR (cache));

And font_get_cache does this on MS-Windows:

  Lisp_Object
  w32font_get_cache (struct frame *f)
  {
    struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);

    return (dpyinfo->name_list_element);
  }

dpyinfo on MS-Windows is a single global variable
one_w32_display_info, so I made this change:

diff --git a/src/w32term.c b/src/w32term.c
index 7afd130..96f8530 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -7812,6 +7812,9 @@ #define LOAD_PROC(lib, fn) pfn##fn = (void *) GetProcAddress (lib, #fn)
 void
 syms_of_w32term (void)
 {
+  one_w32_display_info.name_list_element = Qnil;
+  staticpro (&one_w32_display_info.name_list_element);
+
   DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
 
   DEFSYM (Qadded, "added");

(Is this correct? should all Lisp members of global variables be
similarly staticpro'd?)

With this change, scrolling through xdisp.c now works (yay!), with the
following messages output several times to stderr:

  *** MPS GC start: Generation 0 of a chain has reached capacity: start a minor collection.
  *** MPS GC start: Opportunism: client predicts plenty of idle time, so start full collection.

(Btw, it would be nice to have these go to echo-area messages
instead.)

But the original Helmut's recipe still crashes, albeit with a
different backtrace:

  *** MPS GC start: Client requests: immediate full collection.

  Thread 1 received signal SIGSEGV, Segmentation fault.
  gui_produce_glyphs (it=0xbfa6b0) at xdisp.c:32587
  32587         boff = font->baseline_offset;
  (gdb) bt
  #0  gui_produce_glyphs (it=0xbfa6b0) at xdisp.c:32587
  #1  0x01030e47 in display_line (it=it@entry=0xbfa6b0,
      cursor_vpos=cursor_vpos@entry=1) at xdisp.c:25389
  #2  0x01037611 in try_window (window=<optimized out>, window@entry=0xc0007b5,
      pos=..., flags=<optimized out>, flags@entry=1) at xdisp.c:21139
  #3  0x01059947 in redisplay_window (window=window@entry=0xc0007b5,
      just_this_one_p=just_this_one_p@entry=false) at xdisp.c:20533
  #4  0x0105cb44 in redisplay_window_0 (window=0xc0007b5) at xdisp.c:18018
  #5  0x011729bb in internal_condition_case_1 (
      bfun=bfun@entry=0x105cb0f <redisplay_window_0>, arg=arg@entry=0xc0007b5,
      handlers=0x1a3e10c3, hfun=hfun@entry=0x1006297 <redisplay_window_error>)
      at eval.c:1568
  #6  0x01001eed in redisplay_windows (window=0xc0007b5) at xdisp.c:17987
  #7  0x01040f5f in redisplay_internal () at xdisp.c:17387
  #8  0x010424b3 in redisplay () at xdisp.c:16565
  #9  0x010e61a8 in read_char (commandflag=<optimized out>, commandflag@entry=1,
      map=<optimized out>, map@entry=0xa82060b, prev_event=<optimized out>,
      used_mouse_menu=<optimized out>, used_mouse_menu@entry=0xbff7fb,
      end_time=<optimized out>, end_time@entry=0x0) at keyboard.c:2678
  #10 0x010e97dd in read_key_sequence (keybuf=keybuf@entry=0xbff8d8,
      prompt=prompt@entry=0x0,
      dont_downcase_last=dont_downcase_last@entry=false,
      can_return_switch_frame=<optimized out>,
      can_return_switch_frame@entry=true, fix_current_buffer=<optimized out>,
      fix_current_buffer@entry=true, prevent_redisplay=<optimized out>,
      prevent_redisplay@entry=false, disable_text_conversion_p=false)
      at keyboard.c:10727
  #11 0x010eb36b in command_loop_1 () at lisp.h:1179
  #12 0x0117291d in internal_condition_case (
      bfun=bfun@entry=0x10eb1b0 <command_loop_1>, handlers=handlers@entry=0x48,
      hfun=hfun@entry=0x10de4f6 <cmd_error>) at eval.c:1544
  #13 0x010d480b in command_loop_2 (handlers=0x48) at keyboard.c:1168
  #14 0x01172837 in internal_catch (tag=tag@entry=0x87a8,
      func=func@entry=0x10d47eb <command_loop_2>, arg=arg@entry=0x48)
      at eval.c:1224
  #15 0x010d47ab in command_loop () at lisp.h:1179
  #16 0x010de0b1 in recursive_edit_1 () at keyboard.c:754
  #17 0x010de3a1 in Frecursive_edit () at keyboard.c:837
  #18 0x01317d3f in main (argc=<optimized out>, argv=<optimized out>)
      at emacs.c:2626
  (gdb) p font
  $1 = (struct font *) 0xad2fce0
  (gdb) p *$
  Cannot access memory at address 0xad2fce0

So this is progress, but now the font structure of a face is invalid,
so some other protection is missing somewhere.  Any ideas?



  reply	other threads:[~2024-04-27  6:58 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 15:06 Building the igc branch on MS-Windows Eli Zaretskii
2024-04-24 15:20 ` Gerd Möllmann
2024-04-24 16:07   ` Eli Zaretskii
2024-04-24 16:48     ` Gerd Möllmann
2024-04-24 16:59       ` Gerd Möllmann
2024-04-24 19:09       ` Eli Zaretskii
2024-04-24 19:44         ` Gerd Möllmann
2024-04-25  5:38           ` Eli Zaretskii
2024-04-25  6:17             ` Gerd Möllmann
2024-04-25  4:54 ` Helmut Eller
2024-04-25  5:30   ` Eli Zaretskii
2024-04-25  6:38     ` Helmut Eller
2024-04-25  7:39       ` Gerd Möllmann
2024-04-25 10:34         ` Eli Zaretskii
2024-04-25 11:09           ` Eli Zaretskii
2024-04-25 11:16             ` Eli Zaretskii
2024-04-25 11:59             ` Gerd Möllmann
2024-04-25 13:22               ` Eli Zaretskii
2024-04-25 13:29                 ` Gerd Möllmann
2024-04-25 11:55           ` Gerd Möllmann
2024-04-25 13:29             ` Eli Zaretskii
2024-04-25 14:00               ` Gerd Möllmann
2024-04-25 14:34                 ` Eli Zaretskii
2024-04-25 14:40                   ` Gerd Möllmann
2024-04-25 12:35           ` Helmut Eller
2024-04-25 12:40             ` Gerd Möllmann
2024-04-26  7:18               ` Helmut Eller
2024-04-26  7:38                 ` Gerd Möllmann
2024-04-26  7:41                 ` Eli Zaretskii
2024-04-26  8:11                   ` Gerd Möllmann
2024-04-26  9:13                     ` Helmut Eller
2024-04-26  9:31                       ` Gerd Möllmann
2024-04-26 10:55                       ` Eli Zaretskii
2024-04-26 11:27                         ` Po Lu
2024-04-26 13:04                           ` Gerd Möllmann
2024-04-26 13:42                             ` Po Lu
2024-04-26 13:46                               ` Gerd Möllmann
2024-04-26 14:35                               ` Gerd Möllmann
2024-04-26 10:35                     ` Eli Zaretskii
2024-04-26 10:56                       ` Gerd Möllmann
2024-04-26 11:25                         ` Eli Zaretskii
2024-04-26 11:38                           ` Po Lu
2024-04-26 12:58                             ` Gerd Möllmann
2024-04-26 14:49                             ` Eli Zaretskii
2024-04-26 14:53                               ` Gerd Möllmann
2024-04-27  0:21                               ` Po Lu
2024-04-27  6:13                                 ` Eli Zaretskii
2024-04-27  6:48                                   ` Gerd Möllmann
2024-04-27  7:13                                     ` Eli Zaretskii
2024-04-26 12:58                           ` Gerd Möllmann
2024-04-26 15:11                             ` Eli Zaretskii
2024-04-26 15:27                               ` Gerd Möllmann
2024-04-26 11:32                         ` Eli Zaretskii
2024-04-26 13:09                           ` Gerd Möllmann
2024-04-26 13:12                             ` Gerd Möllmann
2024-04-26 15:01                             ` Helmut Eller
2024-04-26 15:30                               ` Gerd Möllmann
2024-04-26 15:39                               ` Eli Zaretskii
2024-04-26 17:03                                 ` Gerd Möllmann
2024-04-26 18:24                                   ` Helmut Eller
2024-04-26 18:37                                     ` Gerd Möllmann
2024-04-26 16:57                               ` Gerd Möllmann
2024-04-26 18:11                                 ` Helmut Eller
2024-04-26 18:30                                   ` Gerd Möllmann
2024-04-26 20:45                                     ` Helmut Eller
2024-04-27  4:22                                       ` Gerd Möllmann
2024-04-27  5:18                                         ` Ihor Radchenko
2024-04-27  5:26                                           ` Gerd Möllmann
2024-04-27  5:54                                             ` Ihor Radchenko
2024-04-27  6:07                                               ` Gerd Möllmann
2024-04-27  6:31                                                 ` Gerd Möllmann
2024-04-27  6:22                                             ` Eli Zaretskii
2024-04-27  6:29                                               ` Ihor Radchenko
2024-04-27  7:11                                                 ` Eli Zaretskii
2024-04-27  7:40                                                   ` Ihor Radchenko
2024-04-27  6:45                                               ` Gerd Möllmann
2024-04-27  6:11                                       ` Eli Zaretskii
2024-04-27  6:58                                         ` Eli Zaretskii [this message]
2024-04-27  7:17                                           ` Eli Zaretskii
2024-04-27  8:38                                             ` Gerd Möllmann
2024-04-27 11:15                                               ` Eli Zaretskii
2024-04-27 12:09                                                 ` Gerd Möllmann
2024-04-27 12:33                                                   ` Eli Zaretskii
2024-04-27 12:37                                                   ` Eli Zaretskii
2024-04-27 13:26                                                     ` Gerd Möllmann
2024-04-27 14:54                                                       ` Eli Zaretskii
2024-04-27 15:25                                                         ` Gerd Möllmann
2024-04-27 15:40                                                           ` Eli Zaretskii
2024-04-27 15:47                                                             ` Helmut Eller
2024-04-27 15:48                                                             ` Gerd Möllmann
2024-04-27  7:23                                           ` Gerd Möllmann
2024-04-27  7:33                                             ` Eli Zaretskii
2024-04-27  9:04                                               ` Gerd Möllmann
2024-04-27 11:44                                                 ` Eli Zaretskii
2024-04-27 12:07                                                   ` Eli Zaretskii
2024-04-27 12:41                                                     ` Gerd Möllmann
2024-04-27 13:23                                                     ` Gerd Möllmann
2024-04-27 12:32                                                   ` Gerd Möllmann
2024-04-27 14:11                                                   ` Gerd Möllmann
2024-04-27 14:47                                                     ` Eli Zaretskii
2024-04-27 15:09                                                       ` Gerd Möllmann
2024-04-27 15:15                                                         ` Helmut Eller
2024-04-27 15:29                                                           ` Gerd Möllmann
2024-04-27 15:38                                                             ` Eli Zaretskii
2024-04-27 15:42                                                               ` Gerd Möllmann
2024-04-27 16:37                                                                 ` Gerd Möllmann
2024-04-27 15:23                                                         ` Gerd Möllmann
2024-04-28  6:31                                                 ` Eli Zaretskii
2024-04-28  6:44                                                   ` Gerd Möllmann
2024-04-27  7:17                                         ` Gerd Möllmann
2024-04-27 12:11                                         ` Helmut Eller
2024-04-27 12:32                                           ` Eli Zaretskii
2024-04-27 13:41                                             ` Helmut Eller
2024-04-26  8:12                   ` Helmut Eller
2024-04-26  8:57                     ` Gerd Möllmann
2024-04-26 10:39                     ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=868r0zxpfr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.