<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>8677</bug_id>
          
          <creation_ts>2006-05-01 00:13:18 -0700</creation_ts>
          <short_desc>REGRESSION: wkSetUpFontCache() may be called before the SPIs are connected.</short_desc>
          <delta_ts>2006-05-02 17:16:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>EasyFix, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rosyna">webkit-bugs</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>darin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>40796</commentid>
    <comment_count>0</comment_count>
    <who name="Rosyna">webkit-bugs</who>
    <bug_when>2006-05-01 00:13:18 -0700</bug_when>
    <thetext>If a menu (such as the bookmarks menu) is opened before a WebViewFrame is created, then wkSetUpFontCache will be a NULL pointer. As the menu rendering calls +[WebStringTruncator centerTruncateString:toWidth:] which then calls +[WebTextRendererFactory sharedFactory] the wkSetUpFontCache pointer won&apos;t have a chance to be &quot;connected&quot; and thus will cause a crash.

Thread 0 Crashed:
0   &lt;&lt;00000000&gt;&gt; 	0x00000000 0 + 0
1   com.apple.WebCore              	0x01b19068 +[WebTextRendererFactory sharedFactory] + 124 (WebTextRendererFactory.mm:236)
2   com.apple.WebCore              	0x01b0f404 truncateString(NSString*, float, NSFont*, unsigned (*)(NSString*, unsigned, unsigned, unsigned short*)) + 520 (WebCoreStringTruncator.mm:119)
3   com.apple.WebCore              	0x01b0fa34 +[WebCoreStringTruncator centerTruncateString:toWidth:] + 72 (WebCoreStringTruncator.mm:207)
4   com.apple.WebKit               	0x00319448 +[WebStringTruncator centerTruncateString:toWidth:] + 92 (WebStringTruncator.m:37)
5   com.apple.Safari               	0x00012948 0x1000 + 72008
6   com.apple.Safari               	0x00049344 0x1000 + 295748
7   com.apple.Safari               	0x00049fd0 0x1000 + 298960
8   com.apple.Safari               	0x00049448 0x1000 + 296008
9   com.apple.Safari               	0x00049fd0 0x1000 + 298960
10  com.apple.Safari               	0x00049f18 0x1000 + 298776
11  com.apple.Safari               	0x00049d5c 0x1000 + 298332
12  com.apple.Safari               	0x00049c44 0x1000 + 298052
13  com.apple.AppKit               	0x93818dac -[NSMenu _populate:] + 120
14  com.apple.AppKit               	0x93818990 AppKitMenuEventHandler + 512</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40864</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-05-02 09:40:59 -0700</bug_when>
    <thetext>Hyatt has a fix for this on his machine. We just need to set up the connection in the &quot;WebStringTruncator&quot; APIs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40865</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-05-02 09:41:45 -0700</bug_when>
    <thetext>I&apos;m not sure this bug can be reproduced without some kind of hack installed in Safari. As far as I know, normally there&apos;s no way to bring up the Bookmarks menu before the first WebFrameView is created.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40885</commentid>
    <comment_count>3</comment_count>
    <who name="Rosyna">webkit-bugs</who>
    <bug_when>2006-05-02 12:38:39 -0700</bug_when>
    <thetext>In certain circumstances it is possible to reproduce this with accessibility.

Although I wonder if that matters since this is both a regression and &quot;easy fix&quot;. Especially since hyatt has the fix already.

But I ultimately wonder why the menus are using WebStringTruncator at all.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>