Description: If you call -[WebView close] in the WebResourceLoadDelegate method, webView:plugInFailedWithError:dataSource:, it can cause a crash. Steps to Reproduce: 1) Boot Mac OS X 10.5.7. 2) Unzip, build, and run the attached sample Xcode project "MiniBrowser.zip". Notes: The MiniBrowser project is from /Developer/Examples/WebKit installed by Xcode 3.1.2. I made two modifications to that project: (1) I load http://world.kbs.co.kr/aod/aod_ch03_skin_e.htm rather than http://www.apple.com (2) I added the following method: - (void)webView:(WebView *)sender plugInFailedWithError:(NSError *)error dataSource:(WebDataSource *)dataSource { [sender close]; // This causes a crash. } By the way, you may see 3 build warnings "warning: 'WebView' may not respond to '-close'", but this is apparently just because the method -[WebView close] is available in 10.4.11 and later, but the deployment target of the project is set to 10.4. If you set the SDK and deployment target to 10.5., these warnings go away. The crash occurs with stock 10.5.7 WebKit. It also occurs with WebKit revision 43755 from svn. However, r43755 needs to be modified slightly for the crash to occur. This is apparently because the plugin detection code has changed somehow, and WebKit now detects a plugin for the web page, so webView:plugInFailedWithError:dataSource: doesn't even get called anymore. My modification, which is attached as the file "diff.txt", simply guarantees that no plugin is found and the WebResourceLoadDelegate method will get called. The backtrace for the crash with r43755 is attached as the file "backtrace.txt". The crash does not occur if I call [sender performSelector:@selector(close) withObject:nil afterDelay:0.0] rather than [sender close]. There's nothing in the documentation for -[WebView close] that says it's not safe to call in a delegate method. It's desirable to call -[WebView close] on failures such as webView:plugInFailedWithError:dataSource:, because it stops all activity in the WebView. This is analogous to -[NSURLConnection cancel].
Created attachment 30414 [details] crash backtrace
Created attachment 30415 [details] sample Xcode project
Created attachment 30416 [details] svn diff
Created attachment 30417 [details] crash log
I've been told that this crash can be reproduced by some people with unmodified TOT WebKit. I can reproduce it with unmodified WebKit prior to http://trac.webkit.org/changeset/39115/trunk It would seem that I have a plugin or plugins detected by r39115 but not prior to that revision.
I can now reproduce this crash with svn r43816 without having to modify the source at all.
The page http://world.kbs.co.kr/aod/aod_ch03_skin_e.htm appears to use the Flip4Mac WMV plug-in, so to reproduce the bug, you may have to uninstall that. With TOT svn r56311, I now get an unrecoverable hang rather than a crash. I can provide logs and/or more info, but I'd like someone to confirm this bug first.