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

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

bug#14272: 24.3.50; crash on loading theme


From: Eli Zaretskii
Subject: bug#14272: 24.3.50; crash on loading theme
Date: Fri, 26 Apr 2013 10:51:39 +0300

> From: Yagnesh Raghava Yakkala <address@hidden>
> Cc: address@hidden
> Date: Fri, 26 Apr 2013 16:18:29 +0900
> 
> Backtrace is attached.
> 
> backtrace:
> #0  0x000000000067c13d in compute_fringe_widths (f=0x11c1418, redraw=1) at 
> fringe.c:1368
>         left_wid = 8
>         right_wid = 8
>         font_wid = 0
>         conf_wid = 16
>         cols = 0
>         real_wid = 12846194
>         o_left = 11
>         o_right = 11
>         o_cols = 2
>         left_fringe = 12846194
>         right_fringe = 12846194
>         left_fringe_width = 8
>         right_fringe_width = 8
> #1  0x0000000000506e83 in x_new_font (f=0x11c1418, font_object=19256893, 
> fontset=23) at xterm.c:7913
>         font = 0x125d638

The crash is caused by division by zero, here:

      int font_wid = FRAME_COLUMN_WIDTH (f);
      int cols = (left_wid + right_wid + font_wid-1) / font_wid; <<<<<<<<

most probably because font->average_width is zero, because
FRAME_COLUMN_WIDTH gets its value for font's average_width.

Please do this, after Emacs crashes under GD:

 (gdb) frame 1
 (gdb) p *font
 (gdb) pp font_object

If the "pp" command doesn't work, type

 (gdb) source /path/to/emacs/src/.gdbinit

and then try the "pp" command again.

Also, if it is possible to reconfigure Emacs with --enable-checking
and rebuild, please try this recipe in that build.  I get assertion
violation here:

  static int
  set_lface_from_font (struct frame *f, Lisp_Object lface,
                       Lisp_Object font_object, int force_p)
  {
    Lisp_Object val;
    struct font *font = XFONT_OBJECT (font_object);

    /* Set attributes only if unspecified, otherwise face defaults for
       new frames would never take effect.  If the font doesn't have a
       specific property, set a normal value for that.  */

    if (force_p || UNSPECIFIEDP (LFACE_FAMILY (lface)))
      {
        Lisp_Object family = AREF (font_object, FONT_FAMILY_INDEX);

        ASET (lface, LFACE_FAMILY_INDEX, SYMBOL_NAME (family));
      }

    if (force_p || UNSPECIFIEDP (LFACE_FOUNDRY (lface)))
      {
        Lisp_Object foundry = AREF (font_object, FONT_FOUNDRY_INDEX);

        ASET (lface, LFACE_FOUNDRY_INDEX, SYMBOL_NAME (foundry));
      }

    if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface)))
      {
        int pt = PIXEL_TO_POINT (font->pixel_size * 10, FRAME_RES_Y (f));

        eassert (pt > 0);  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        ASET (lface, LFACE_HEIGHT_INDEX, make_number (pt));
      }


because font->pixel_size is zero, something that Emacs cannot possibly
tolerate.  For the record, the value of lface I get is this:

  [face "Arial" "outline" normal 1 normal normal nil nil "#e8e8d3" "#151515" 
nil nil nil nil #<font-spec nil outline Arial sans iso8859-1 normal normal nil 
0 nil 0 nil ((:format . opentype) (:script nko arabic hebrew cyrillic greek 
latin) (user-spec . "Courier New-10"))> nil 
"-outline-Arial-normal-normal-normal-sans-13-*-*-*-p-*-fontset-auto1"]

However, I'm not sure my font setup is similar enough to yours, so it
would be important to know if you get the same assertion violation.

In any case, the problem seems to be with font specification, so I
hope someone who knows more than I do about that will chime in.





reply via email to

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