Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8342393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:45:29+00:00 2026-06-09T05:45:29+00:00

I’ve got a pretty gnarly technical problem and I’m hoping that there might be

  • 0

I’ve got a pretty gnarly technical problem and I’m hoping that there might be some Webkit experts around. I’m working on an iOS application for a client. Most of the application is HTML5 content served up in UIWebView controllers.

About a week ago, the QA team started reporting that the application crashes. We’ve been getting about 1 crash report a day for the last week. Unfortunately, they’re the kind of crash where no clear set of steps can be determined that consistently reproduce the crash. Strangely, some of those crash reports have been using old versions of the iOS code base — code that’s run successfully for months without anyone noticing this crash behaviour.

But what all the crash situations have in common is that they’re all running against an updated back-end serving up the latest version of the HTML web app pages. So it pretty-much seems that we’ve done something new on the server side that’s triggering something in the iOS code to crash.

The crash logs have been pretty consistent. Here’s the symbolicated log:

0   WebCore    0x33147ab0 WebCore::FrameLoader::cancelledError(WebCore::ResourceRequest const&) const + 4
1   WebCore    0x33070fbe WebCore::ResourceLoader::init(WebCore::ResourceRequest const&) + 166
2   WebCore    0x33070e66 WebCore::SubresourceLoader::startLoading() + 14
3   WebCore    0x33070c4e WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadScheduler::HostInformation*, WebCore::ResourceLoadPriority) + 46
4   WebCore    0x33076508 WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadPriority) + 36
5   WebCore    0x32fd38c8 WebCore::ThreadTimers::sharedTimerFiredInternal() + 92

(Most questions that discuss crashes in the WebCore are answered with a suggestion that you set the webview.delegate to nil in the dealloc method. That doesn’t seem to be our problem).

Now I have one theory (which I’ll talk about in a moment), but what I don’t have is clear evidence. So I grabbed the source from webkit.org and am trying to read enough of it to understand what the WebKit was doing at the time that it crashed. I don’t think I’m using quite the same version of WebKit source as in the iOS devices (we’ve seen this in 5.0.1 and 5.1.1 devices), the key methods seem to appear to reference downloading resources (like CSS and images) but there seems to be a null URL involved, so we end up calling cancelledError method.

The FrameLoader then does this:

ResourceError FrameLoader::cancelledError(const ResourceRequest& request) const
{
    ResourceError error = m_client->cancelledError(request);
    error.setIsCancellation(true);
    return error;
}

and it’s in this method that the app crashes with:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000008

which suggests to me that the m_client isn’t pointing at something valid.

Now, I do have a theory about what’s happening, just based on gut feel and circumstantial evidence.

Our UIWebView has a delegate that evaluates the URLs being loaded into the web view. In certain circumstances, we decide to launch new URLs in a separate ViewController, like so:

- (BOOL)webView:(UIWebView *)source shouldStartLoadWithRequest:(NSURLRequest *)request  navigationType:(UIWebViewNavigationType)navigationType 
{
    ...

    if ([self.popupStrategy shouldPopupURL:[request URL] fromCurrent:[source.request URL]]) {

        PopupTransitionViewController *popController = [self createPopupController:request];
        ... push it onto the navigation controller ...

    }
    ...
}

One of the key conditions that causes this popup strategy to return true occurs during a cross-domain link. That is to say, if the user taps on a link/icon and the target of that link is hosted by a third-party site, the app launches the new content in a different ViewController (for various reasons, including being able to get a nice native transition on cross-domain links).

One of the server-side changes that happened a few weeks ago is that the link href has been updated — the link now calls our main server, which sends back an HTTP redirect sending the client to the third-party site.

What I see in this case is that our popupStrategy gets called twice. The first time, it’s evaluating the URL to our main server, and the second time, it evaluates the third-party URL. In the second case, the strategy tells the UIWebView to load the request in a new ViewController. My thinking is that something in the Webkit code doesn’t always like that, and through some oddities of timing or whatnot, this somehow leads to a crash at some point.

This theory sticks with me because it’s based on new web loading behaviour that didn’t previously exist in our server code base, which conveniently fits the symptoms. My read of the Webkit code is that, in some of the methods referenced, Webkit seems to be doing some special processing when it sees cross-origin requests. But the crash has been impossible to reproduce on cue, so we don’t have a lot more to go on. But if the theory is true, I know a reasonable fix.

My hope is that someone has some familiarity with Webkit’s internals and can suggest:

a) how well this theory is supported by the Webkit stack-trace?

b) are there any other insights that anyone can see that are suggested by the stack trace I’m getting?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:45:31+00:00Added an answer on June 9, 2026 at 5:45 am

    I ended up making code changes, rooted in the theory I described, above. After those changes were made, I didn’t see a recurrence of the crash. So the original theory looks to have been correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I know there's a lot of other questions out there that deal with this
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.