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

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

bug#3659: FW: 23.0.95; crash on set-frame-font


From: Kenichi Handa
Subject: bug#3659: FW: 23.0.95; crash on set-frame-font
Date: Tue, 28 Jul 2009 11:08:47 +0900

Hi, Simon.  Your investigation helps a lot, thank you.  I've
just installed a fix to the branch and the trunk.  Could you
please try the latest code?

---
Kenichi Handa
address@hidden

In article <address@hidden>, "Marshall, Simon" <address@hidden> writes:

> > > #7  0x003337c4 in xfont_chars_supported (chars=9656829,
> xfont=0xbf4200,
> > > encoding=0x369f30, 
> > >     repertory=0x0) at xfont.c:238
> > > #8  0x0033458c in xfont_supported_scripts (display=0xa0e000,
> > > fontname=0xc83dfb "--------0------", 
> > >     props=5454596, encoding=0x369f30) at xfont.c:328
> > 
> > Your previous backtrace didn't show that
> > xfont_supported_scripts is called.  It may be because the
> > previous backtrace was made by the emacs compiled with -O2.
> > 
> > Anyway, the above fontname has a strange format.  For such a
> > fontname, xfont_supported_scripts should not be called from
> > xfont_list_pattern.
> > 
> > > #9  0x00334e30 in xfont_list_pattern (display=0xa0e000, 
> > >     pattern=0xffbeca84 "-*-*-*-*-*-*-*-*-*-*-*-*-*-*",
> registry=5314561,
> > > script=5314561)
> > >     at xfont.c:466
> > 
> > Please set the breakpoint at xfont.c:414 with conditional:
> >   buf[1]=='-' && buf[2]=='-' && buf[3]=='-' && buf[4]=='-'
> > (I think that is enough for matching with "--------0------")
> > 
> > When emacs stops at that breakpoint, execute the code one
> > line by one (by "n" command) until the line 466 (i.e. the
> > call of xfont_supported_scripts) while checking why none of
> > "if" conditions that leads to "continue" aren't satisfied.

> Ok, font_parse_xlfd() returns -1 from font.c:1107, though the return
> value is ignored.  After xfont.c:414 we have:

> (gdb) list
> 410             if (i > 0 && xstrcasecmp (indices[i - 1], indices[i])
> == 0)
> 411               continue;
> 412             entity = font_make_entity ();
> 413             xfont_decode_coding_xlfd (indices[i], -1, buf);
> 414             font_parse_xlfd (buf, entity);
> 415             ASET (entity, FONT_TYPE_INDEX, Qx);
> 416             /* Avoid auto-scaled fonts.  */
> 417             if (XINT (AREF (entity, FONT_DPI_INDEX)) != 0
> 418                 && XINT (AREF (entity, FONT_AVGWIDTH_INDEX)) == 0)
> 419               continue;
> (gdb) pp entity
> #<font-entity nil   nil nil nil nil nil nil nil nil nil nil>

> And as expected after the 415 we have:

> (gdb) pp entity
> #<font-entity x   nil nil nil nil nil nil nil nil nil nil>

> The condition at 423 is true:

> (gdb) list
> 418                 && XINT (AREF (entity, FONT_AVGWIDTH_INDEX)) == 0)
> 419               continue;
> 420             /* Avoid not-allowed scalable fonts.  */
> 421             if (NILP (Vscalable_fonts_allowed))
> 422               {
> 423                 if (XINT (AREF (entity, FONT_SIZE_INDEX)) == 0)
> 424                   continue;
> 425               }
> 426             else if (CONSP (Vscalable_fonts_allowed))
> 427               {

> So we make the continue at 424 which jumps us to 443:

> (gdb) list
> 438                 if (! CONSP (tail))
> 439                   continue;
> 440               }
> 441   
> 442             /* Update encoding and repertory if necessary.  */
> 443             if (! EQ (registry, AREF (entity,
> FONT_REGISTRY_INDEX)))
> 444               {
> 445                 registry = AREF (entity, FONT_REGISTRY_INDEX);
> 446                 if (font_registry_charsets (registry, &encoding,
> &repertory) < 0)
> 447                   encoding = NULL;

> (gdb) pp registry
> nil
> (gdb) pp entity
> #<font-entity x   nil nil nil nil nil nil nil nil nil nil>

> The condition at 443 is false which jumps us to 449:

> (gdb) list
> 444               {
> 445                 registry = AREF (entity, FONT_REGISTRY_INDEX);
> 446                 if (font_registry_charsets (registry, &encoding,
> &repertory) < 0)
> 447                   encoding = NULL;
> 448               }
> 449             if (! encoding)
> 450               /* Unknown REGISTRY, not supported.  */
> 451               continue;
> 452             if (repertory)
> 453               {

> (gdb) p encoding
> $3 = (struct charset *) 0x369f78
> (gdb) p *encoding
> $4 = {
>   id = 707602944, 
>   hash_index = 0, 
>   dimension = 707592192, 
>   code_space = {0, 757727232, 0, 754974720, 0, -1074790400, 0,
> 1076101120, 0, 0, 0, 704643072, 0, 628305194, 0, 628304429}, 
>   code_space_mask = 0x2a000000 <Address 0x2a000000 out of bounds>, 
>   code_linear_p = 627322154, 
>   iso_chars_96 = 0, 
>   iso_final = 707601764, 
>   iso_revision = 0, 
>   emacs_mule_id = 627322149, 
>   ascii_compatible_p = 1677721600, 
>   supplementary_p = 1828716544, 
>   compact_codes_p = 0, 
>   method = 1660944384, 
>   min_code = 0, 
>   max_code = 1677721600, 
>   char_index_offset = 0, 
>   min_char = 1879048192, 
>   max_char = 0, 
>   invalid_code = 627310592, 
>   fast_map =
> "\000\000\000\000-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s\000\000\000\000\000\0
> address@hidden
> 0\000\000\000\000mono\000\000\000\000proportional\000\000\000\000pixelsi
> ze\000\000\000\000\000\000\000Ultra-Light\000\000\000\000\000Light\000\0
> 00\000Semi-Bold\000\000\000\000\000\000\000Bold\000\000\000\000Italic\00
> 0\000Oblique\000weight\000\000sl", 
>   code_offset = 1946157056, 
>   unified_p = 2003395700
> }
> (gdb) p repertory
> $5 = (struct charset *) 0x0

> So both of those conditions are false, so we reach 459:

> (gdb) list
> 454                 if (NILP (script)
> 455                     || xfont_chars_supported (chars, NULL,
> encoding, repertory))
> 456                   list = Fcons (entity, list);
> 457                 continue;
> 458               }
> 459             if (memcmp (props, &(AREF (entity,
> FONT_FOUNDRY_INDEX)),
> 460                         sizeof (Lisp_Object) * 7)
> 461                 || ! EQ (AREF (entity, FONT_SPACING_INDEX),
> props[7]))
> 462               {
> 463                 memcpy (props, &(AREF (entity,
> FONT_FOUNDRY_INDEX)),
> (gdb) pp xfont_scratch_props
> [nil nil nil nil nil nil nil nil]
> (gdb) pp props[0]
> nil
> (gdb) pp props[1]
> nil
> (gdb) pp props[2]
> nil
> (gdb) pp props[3]
> nil
> (gdb) pp props[4]
> nil
> (gdb) pp props[5]
> nil
> (gdb) pp props[6]
> nil
> (gdb) pp props[7]
> nil
> (gdb) pp entity
> #<font-entity x   nil nil nil nil nil nil nil nil nil nil>

> The condition at 459 is true so we go to 463.  at the call on 466:

> (gdb) p indices[i]
> $7 = 0xc7adfb "--------0------"
> (gdb) pp xfont_scratch_props
> [  nil nil nil nil nil nil]
> (gdb) p *encoding
> $8 = {
>   id = 707602944, 
>   hash_index = 0, 
>   dimension = 707592192, 
>   code_space = {0, 757727232, 0, 754974720, 0, -1074790400, 0,
> 1076101120, 0, 0, 0, 704643072, 0, 628305194, 0, 628304429}, 
>   code_space_mask = 0x2a000000 <Address 0x2a000000 out of bounds>, 
>   code_linear_p = 627322154, 
>   iso_chars_96 = 0, 
>   iso_final = 707601764, 
>   iso_revision = 0, 
>   emacs_mule_id = 627322149, 
>   ascii_compatible_p = 1677721600, 
>   supplementary_p = 1828716544, 
>   compact_codes_p = 0, 
>   method = 1660944384, 
>   min_code = 0, 
>   max_code = 1677721600, 
>   char_index_offset = 0, 
>   min_char = 1879048192, 
>   max_char = 0, 
>   invalid_code = 627310592, 
>   fast_map =
> "\000\000\000\000-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s\000\000\000\000\000\0
> address@hidden
> 0\000\000\000\000mono\000\000\000\000proportional\000\000\000\000pixelsi
> ze\000\000\000\000\000\000\000Ultra-Light\000\000\000\000\000Light\000\0
> 00\000Semi-Bold\000\000\000\000\000\000\000Bold\000\000\000\000Italic\00
> 0\000Oblique\000weight\000\000sl", 
>   code_offset = 1946157056, 
>   unified_p = 2003395700
> }

> Hope this helps!  Let me know what else you would like me to do.

> Simon.


> "Misys" is the trade name for Misys plc (registered in England and Wales). 
> Registration Number: 01360027. Registered office: One Kingdom Street, London 
> W2 6BL, United Kingdom. For a list of Misys group operating companies please 
> go to http://www.misys.com/corp/About_Us/misys_operating_companies.html. This 
> email and any attachments have been scanned for known viruses using multiple 
> scanners. This email message is intended for the named recipient only. It may 
> be privileged and/or confidential. If you are not the named recipient of this 
> email please notify us immediately and do not copy it or use it for any 
> purpose, nor disclose its contents to any other person. This email does not 
> constitute the commencement of legal relations between you and Misys plc. 
> Please refer to the executed contract between you and the relevant member of 
> the Misys group for the identity of the contracting party with which you are 
> dealing. 






reply via email to

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