[Webkit-unassigned] [Bug 25837] New: Crash after calling -[WebView close] in webView:plugInFailedWithError:dataSource:

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 16 12:17:20 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25837

           Summary: Crash after calling -[WebView close] in
                    webView:plugInFailedWithError:dataSource:
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
               URL: http://world.kbs.co.kr/aod/aod_ch03_skin_e.htm
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: opendarwin at lapcatsoftware.com


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].


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list