Bug 7884

Summary: REGRESSION: Selecting a custom style sheet crashes 20/3 nightly
Product: WebKit Reporter: musti <mustiman>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Blocker CC: alice.barraclough, bdakin, c.petersen87, ggaren
Priority: P1 Keywords: InRadar, Regression
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch
darin: review+
Rename the function that sets the location darin: review+

Description musti 2006-03-20 21:42:54 PST
Steps to reproduce when WebKit nightly is open and NO custom style sheet is selected via Safari beforehand:

1. Select a custom style sheet in Preferences --> Advanced --> Style Sheet
2. reload the current page

Steps to reproduce when a custom style sheet is selected via Safari before launching WebKit nightly

1. Launch WebKit nightly.
2. Crashes upon launch, even when trying to load the WebKit start page.

Part of crash log

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xbf7fffdc

Thread 0 Crashed:
0   com.apple.JavaScriptCore 	0x001763a8 KXMLCore::fastMalloc(unsigned long) + 8
1   com.apple.WebCore        	0x01367b50 KXMLCore::Vector<char, (unsigned long)4096>::reserveCapacity(unsigned long) + 64
2   com.apple.WebCore        	0x01367c04 KXMLCore::Vector<char, (unsigned long)4096>::expandCapacity(unsigned long) + 84
3   com.apple.WebCore        	0x01367c54 KXMLCore::Vector<char, (unsigned long)4096>::resize(unsigned long) + 52
4   com.apple.WebCore        	0x012be808 KURL::parse(char const*, DeprecatedString const*) + 1176
5   com.apple.WebCore        	0x012c0584 KURL::KURL[in-charge](KURL const&, DeprecatedString const&, WebCore::TextEncoding const&) + 1860
6   com.apple.WebCore        	0x011608fc WebCore::Document::completeURL(DeprecatedString const&) + 428
7   com.apple.WebCore        	0x011807c0 WebCore::Cache::requestStyleSheet(WebCore::DocLoader*, WebCore::String const&, bool, long, DeprecatedString const&) + 112
8   com.apple.WebCore        	0x0113b7d4 WebCore::Frame::setUserStyleSheet(KURL const&) + 260
9   com.apple.WebCore        	0x01348814 WebCore::UserStyleSheetLoader::setStyleSheet(WebCore::String const&, WebCore::String const&) + 52
10  com.apple.WebCore        	0x0113b7fc WebCore::Frame::setUserStyleSheet(KURL const&) + 300
11  com.apple.WebCore        	0x01348814 WebCore::UserStyleSheetLoader::setStyleSheet(WebCore::String const&, WebCore::String const&) + 52
12  com.apple.WebCore        	0x0113b7fc WebCore::Frame::setUserStyleSheet(KURL const&) + 300
13  com.apple.WebCore        	0x01348814 WebCore::UserStyleSheetLoader::setStyleSheet(WebCore::String const&, WebCore::String const&) + 52
14  com.apple.WebCore        	0x0113b7fc WebCore::Frame::setUserStyleSheet(KURL const&) + 300
15  com.apple.WebCore        	0x01348814 WebCore::UserStyleSheetLoader::setStyleSheet(WebCore::String const&, WebCore::String const&) + 52
16  com.apple.WebCore        	0x0113b7fc WebCore::Frame::setUserStyleSheet(KURL const&) + 300
17  com.apple.WebCore        	0x01348814 WebCore::UserStyleSheetLoader::setStyleSheet 

snip snip snip

507 com.apple.WebCore        	0x01348814 WebCore::UserStyleSheetLoader::setStyleSheet(WebCore::String const&, WebCore::String const&) + 52
508 com.apple.WebCore        	0x0113b7fc WebCore::Frame::setUserStyleSheet(KURL const&) + 300
Comment 1 Chris Petersen 2006-03-20 23:24:57 PST
I ran into this issue starting with the March 21 build (WebKit-SVN-r13404). You can reproduce by simply applying any external stylesheet to Safari (even a empty stylesheet file) when running Webkit WebKit-SVN-r13404.
Comment 2 Alice Liu 2006-03-21 09:21:45 PST
<rdar://problem/4485448>
Comment 3 mitz 2006-03-21 12:12:10 PST
When I have this page open and I change the user style sheet, Safari tries to load the URL http://bugzilla.opendarwin.org/<contents of the style sheet I selected>. When that fails, it starts loading http://bugzilla.opendarwin.org/<contents of the error page from the previous attempt> and when that fails, it repeats.
Comment 4 mitz 2006-03-21 12:41:52 PST
Created attachment 7220 [details]
Patch
Comment 5 mitz 2006-03-21 13:19:59 PST
Comment on attachment 7220 [details]
Patch

Better just rename one of the functions.
Comment 6 Darin Adler 2006-03-21 13:41:36 PST
Comment on attachment 7220 [details]
Patch

It would be even better to rename the one that takes a URL to setStyleSheetLocation, but this is good.
Comment 7 mitz 2006-03-21 13:54:14 PST
Created attachment 7221 [details]
Rename the function that sets the location
Comment 8 Darin Adler 2006-03-21 14:47:53 PST
Comment on attachment 7221 [details]
Rename the function that sets the location

Great, lets do this.
Comment 9 Eric Seidel (no email) 2006-03-22 01:13:47 PST
Sorry about this.  I noticed it last night, but didn't get a fix ready in time.  :(  I actually had made the exact same fix locally.