emacs-devel
[Top][All Lists]
Advanced

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

bug in display_string?


From: Kenichi Handa
Subject: bug in display_string?
Date: Thu, 26 Sep 2002 22:09:54 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.1.30 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

Emacs crashed when started as below:
% emacs -fn -*-*-*-*-*-*-*-*-*-*-*-*-iso8859-1
With this, my X server find some unusual font in that the
width of `-' glyph is zero.

The crash happened as below, and a possible fix is also
attached at the tail.  But, I'm not sure it's a correct fix.
Gerd, could you please confirm it?

(gdb) bt
#0  0x40302581 in kill () from /lib/libc.so.6
#1  0x080db36a in abort () at emacs.c:412
#2  0x0807a915 in display_string (string=0x0, lisp_string=942570044, 
    face_string=405492356, face_string_pos=0, start=0, it=0xbfffed24, 
    field_width=0, precision=1, max_x=984, multibyte=0) at xdisp.c:15073
#3  0x080780be in display_mode_element (it=0xbfffed24, depth=2, field_width=0, 
    precision=0, elt=942570044, props=405492356, risky=0) at xdisp.c:13882
#4  0x080786a7 in display_mode_element (it=0xbfffed24, depth=1, field_width=0, 
    precision=0, elt=1479427468, props=405492356, risky=0) at xdisp.c:14107
#5  0x08077abc in display_mode_line (w=0x84efe88, face_id=MODE_LINE_FACE_ID, 
    format=1479427468) at xdisp.c:13689
#6  0x08077936 in display_mode_lines (w=0x84efe88) at xdisp.c:13646
#7  0x0807773d in redisplay_mode_lines (window=1213136520, force=0)
    at xdisp.c:13604
#8  0x08068a00 in echo_area_display (update_frame_p=1) at xdisp.c:7161
#9  0x08066a8c in message3_nolog (m=944328852, nbytes=19, multibyte=0)
    at xdisp.c:6058
#10 0x0806683c in message3 (m=944328852, nbytes=19, multibyte=0)
    at xdisp.c:5999
#11 0x08066d24 in message_with_string (m=0x8189955 "Loading %s...", 
    string=942608956, log=1) at xdisp.c:6144
#12 0x081447d3 in Fload (file=942608956, noerror=405492356, 
    nomessage=405492356, nosuffix=405492356, must_suffix=405492404)
    at lread.c:876
#13 0x0813246f in do_autoload (fundef=1479320972, funname=406139068)
    at eval.c:1937
#14 0x081332ee in Ffuncall (nargs=2, args=0xbffff294) at eval.c:2793
#15 0x0815a39c in Fbyte_code (bytestr=941880444, vector=1210317156, maxdepth=6)
    at bytecode.c:709
#16 0x08133711 in funcall_lambda (fun=1210315876, nargs=0, 
    arg_vector=0xbffff3a8) at eval.c:2920
#17 0x081332d1 in Ffuncall (nargs=1, args=0xbffff3a4) at eval.c:2790
#18 0x0815a39c in Fbyte_code (bytestr=941875880, vector=1210311480, maxdepth=5)
    at bytecode.c:709
#19 0x08133711 in funcall_lambda (fun=1210311312, nargs=0, 
    arg_vector=0xbffff464) at eval.c:2920
#20 0x08133414 in apply_lambda (fun=1210311312, args=405492356, eval_flag=1)
    at eval.c:2842
#21 0x081329ce in Feval (form=1480492956) at eval.c:2150
#22 0x080ddbec in top_level_2 () at keyboard.c:1282
#23 0x081317a9 in internal_condition_case (bfun=0x80ddbd8 <top_level_2>, 
    handlers=405588940, hfun=0x80dd904 <cmd_error>) at eval.c:1348
#24 0x080ddc1b in top_level_1 () at keyboard.c:1290
#25 0x0813133d in internal_catch (tag=405550244, func=0x80ddbf0 <top_level_1>, 
    arg=405492356) at eval.c:1108
#26 0x080ddb5a in command_loop () at keyboard.c:1251
#27 0x080dd6c0 in recursive_edit_1 () at keyboard.c:968
#28 0x080dd7f0 in Frecursive_edit () at keyboard.c:1024
#29 0x080dc673 in main (argc=3, argv=0xbffffab4, envp=0xbffffac4)
    at emacs.c:1641
#30 0x402f20bf in __libc_start_main () from /lib/libc.so.6
(gdb) up 2
#2  0x080713d5 in display_string (string=0x0, lisp_string=942530652, 
    face_string=405452964, face_string_pos=0, start=0, it=0xbfffed14, 
    field_width=0, precision=1, max_x=984, multibyte=0) at xdisp.c:15073
(gdb) list
15068               }
15069             else
15070               {
15071                 /* Glyph is off the left margin of the display area.
15072                    Should not happen.  */
15073                 abort ();
15074               }
15075   
15076             row->ascent = max (row->ascent, it->max_ascent);
15077             row->height = max (row->height, it->max_ascent + 
it->max_descent);
(gdb) p i
$1 = 0
(gdb) p nglyphs
$2 = 1
(gdb) p *glyph
$3 = {
  charpos = 0, 
  object = 942570044, 
  pixel_width = 0, 
  voffset = 0, 
  type = 0, 
  multibyte_p = 0, 
  left_box_line_p = 0, 
  right_box_line_p = 0, 
  overlaps_vertically_p = 0, 
  padding_p = 0, 
  glyph_not_available_p = 0, 
  face_id = 1, 
  u = {
    ch = 45, 
    cmp_id = 45, 
    img_id = 45, 
    stretch = {
      height = 45, 
      ascent = 0
    }, 
    val = 45
  }
}
(gdb) p glyph->object
$8 = 942570044
(gdb) pr
#("-" 0 1 (help-echo "mouse-1: select (drag to resize), mouse-2: delete others, 
mouse-3: delete"))
(gdb) p it->truncate_lines_p
$4 = 1
(gdb) p x
$5 = 0
(gdb) p max_x
$6 = 984
(gdb) p it->first_visible_x
$7 = 0

Possible fix.

*** xdisp.c.~1.786.~    Thu Sep 12 22:11:21 2002
--- xdisp.c     Thu Sep 26 22:07:34 2002
***************
*** 15059,15067 ****
                }
              break;
            }
!         else if (x + glyph->pixel_width > it->first_visible_x)
            {
!             /* Glyph is at least partially visible.  */
              ++it->hpos;
              if (x < it->first_visible_x)
                it->glyph_row->x = x - it->first_visible_x;
--- 15059,15070 ----
                }
              break;
            }
!         else if (glyph->pixel_width == 0
!                  ? x >= it->first_visible_x
!                  : x + glyph->pixel_width > it->first_visible_x)
            {
!             /* Glyph is at least partially visible, or the glyph has
!                zero width.  */
              ++it->hpos;
              if (x < it->first_visible_x)
                it->glyph_row->x = x - it->first_visible_x;

---
Ken'ichi HANDA
address@hidden





reply via email to

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