DoSomethingArchive / LetsDoThis-iOS

:iphone: iOS source code for DoSomething: Take Action on the News
http://app.dosomething.org
MIT License
2 stars 0 forks source link

EXC_BAD_ACCESS KERN_INVALID_ADDRESS #1013

Closed aaronschachter closed 8 years ago

aaronschachter commented 8 years ago

Sadness crash on RCTImageView.m line 178. Seems to always happen on the News Feed right away for users who are already authenticated -- haven't seen this happen yet. Curious if large loading times in https://github.com/DoSomething/LetsDoThis-News/issues/1 could be causing, but haven't dug in just yet.

Crash report: https://fabric.io/do-something/ios/apps/org.dosomething.letsdothis/issues/57191ca6ffcdc04250ec54c0

screen shot 2016-05-10 at 9 19 51 pm
aaronschachter commented 8 years ago

I can replicate this crash! Only when testing on iPhone 5 simulator though.

It will occur upon registering for a new account without an avatar, on iPhone 5, and then upon each subsequent app start. Seems like that RCTImageView crash is always occurring when loading a non existent Avatar image.

So far the crashes (which have affected 551 users 😿 ) only occur on iPhone 5 and iPhone 4.

screen shot 2016-05-17 at 8 21 04 pm

cc @lkpttn

lkpttn commented 8 years ago

So weird. I wonder why it's not loading the default avatar like it does for the other devices.

aaronschachter commented 8 years ago

Still debugging, I believe the no avatar was a red herring: I'm testing by hardcoding an avatar URL for staging user 573bdf58a59dbfc6198b458c and still get the crash when testing on iPhone 5 / 9.3 simulator.

The crash doesn't occur when I return null in the NetworkImage component's renderImage method.

aaronschachter commented 8 years ago

Specifically seems to happen on iPhone 5 (not iPhone 5S or 6) in the NetworkImage component's onProgress handler.

screen shot 2016-05-18 at 11 28 52 am
     <Image
        source={this.props.source}
        style={this.props.style}
        onLoadStart={(e) => this.setState({loading: true})}
        onError={(e) => this.setState({error: e.nativeEvent.error, loading: false})}
        onProgress={(e) => this.setState({progress: Math.round(100 * e.nativeEvent.loaded / e.nativeEvent.total)})}
        onLoad={() => this.setState({loading: false, error: false})}>
        {content}
      </Image>;

Will comment out the progressHandler as a hotfix -- but still curious to find root of the bug to help diagnose other potential gotchas. Side note that we're on React Native 0.22 -- now behind with latest 0.25