Bug 5541 - REGRESSION: crash on importing bookmarks
Summary: REGRESSION: crash on importing bookmarks
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
: 4351 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-29 02:25 PDT by Alexey Proskuryakov
Modified: 2005-11-01 13:42 PST (History)
1 user (show)

See Also:


Attachments
proposed patch (783 bytes, patch)
2005-10-29 02:40 PDT, Alexey Proskuryakov
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2005-10-29 02:25:37 PDT
HTMLNames constants are not yet initialized at Safari startup, when bookmarks are imported, which 
surely causes a crash as soon as they are used (which happens to be in Decoder::decode()).

Steps to reproduce:
1. Launch MSIE at least once, to make it write out its bookmarks
2. defaults write com.apple.Safari IEFavoritesWereImported 0
3. run-safari

Results: Safari crashes

Crash log (as reported by erickt on IRC):
#0  0x019432a8 in DOM::AtomicString::equal (a=@0xbfffeae0, b=@0x8) at /unencrypted/erickt/
Projects/WebKit/WebCore/khtml/xml/dom_atomicstring.h:80
#1  0x016a51b4 in khtml::Decoder::decode (this=0x6999b0, data=0xf02e000 "<HTML>\r<!DOCTYPE 
NETSCAPE-Bookmark-file-1>\r<!Created by Microsoft Internet Explorer 4.0 >\r<META HTTP-EQUIV=
\"Content-Type\" CONTENT=\"text/html; charset=x-mac-roman\">\r<TITLE>Favorites</TITLE>
\r<H1 WINDOW_"..., len=1092) at /unencrypted/erickt/Projects/WebKit/WebCore/khtml/misc/
decoder.cpp:556
#2  0x01709c1c in +[WebCoreEncodings decodeData:] (self=0xbfffeae0, _cmd=0x8, data=0xec32da0) 
at /unencrypted/erickt/Projects/WebKit/WebCore/kwq/WebCoreEncodings.mm:36
#3  0x0009d238 in ?? ()
#4  0x0005b224 in ?? ()
#5  0x0005b2bc in ?? ()
#6  0x00005d54 in ?? ()
#7  0x00002d38 in ?? ()
#8  0x90b05408 in -[NSSet makeObjectsPerformSelector:] ()
#9  0x9f664f94 in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] ()
#10 0x9f73bbdc in old_loadNib ()
#11 0x9f650df0 in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] ()
#12 0x9f6a805c in +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] ()
#13 0x9f737e10 in +[NSBundle(NSNibLoading) loadNibNamed:owner:] ()
#14 0x9f737bb0 in NSApplicationMain ()
#15 0x000021e8 in ?? ()
#16 0x00056e28 in ?? ()
Comment 1 Alexey Proskuryakov 2005-10-29 02:40:56 PDT
Created attachment 4518 [details]
proposed patch
Comment 2 Darin Adler 2005-10-31 19:45:17 PST
*** Bug 4351 has been marked as a duplicate of this bug. ***
Comment 3 Timothy Hatcher 2005-11-01 09:34:36 PST
Landed this.

Checking in kwq/WebCoreEncodings.mm;
/cvs/root/WebCore/kwq/WebCoreEncodings.mm,v  <--  WebCoreEncodings.mm
new revision: 1.8; previous revision: 1.7