Subject: Re: bug#75725: SIGSEGV in emacs 30.0.93

From: Eli Zaretskii <[email-masked]>
Date: Tue, 21 Jan 2025 16:18:33 +0200

> Date: Tue, 21 Jan 2025 14:13:38 +0100
> From: Florian Franzmann <[email-masked]>
> Cc: [email-masked]
> 
> On Di 2025-01-21 14:31:00 +0200, Eli Zaretskii wrote:
> > > Date: Tue, 21 Jan 2025 09:15:30 +0100
> > > From: Florian Franzmann <[email-masked]>
> > > 
> > > I'm experiencing a segmentation violation in emacs 30.0.93 when linked against GTK.
> > > The crash does not happen in the TUI version of emacs (which, obviously, is not
> > > linked against GTK).
> > > 
> > > Backtrace:
> > > 
> > > #0  normal_char_ascent_descent (font=0x0, c=c@entry=-1, ascent=ascent@entry=0x7fffffff2ad0, descent=descent@entry=0x7fffffff2ad4)
> > >     at xdisp.c:30407
> > > #1  0x000000000043b18b in normal_char_height (font=<optimized out>, c=c@entry=-1) at xdisp.c:30443
> > > #2  0x0000000000455cdf in handle_single_display_spec (it=it@entry=0x7fffffff3150, spec=<optimized out>, spec@entry=0x28266e3,
> > >     object=<optimized out>, object@entry=0x28dc604, overlay=overlay@entry=0x0, position=position@entry=0x7fffffff32b8,
> > >     bufpos=bufpos@entry=0, display_replaced=0, frame_window_p=true, enable_eval_p=true) at xdisp.c:6114
> > > #3  0x00000000004567de in handle_display_spec (it=it@entry=0x7fffffff3150, spec=<optimized out>, spec@entry=0x28266e3,
> > >     object=object@entry=0x28dc604, overlay=0x0, position=position@entry=0x7fffffff32b8, bufpos=bufpos@entry=0, frame_window_p=true)
> > >     at xdisp.c:5862
> > 
> > Thanks, I installed a trivial fix.  You may not like the results, but
> > at least Emacs should not crash.
> Thanks, that fixed the crash.

Thanks for testing.  Does the resulting display look reasonable (it's
somewhere on your mode line)?

> However, I think it would make sense to output some kind of useful
> information somewhere to help with debugging such issues. Right now
> it's just a silent error.

I don't know what to say in the message, sorry.  Saying "font is NULL"
will not be helpful for most users, I'm afraid.

Also, Emacs has similar protection against a face's font being NULL in
quite a few places.  I didn't invent any new technique.

I could try help you understand what causes this, if you can show me
your font-related customizations, in particular for what is on the
mode line.