Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.squareup.SocketRocket.NetworkThread(18): EXC_BAD_ACCESS #21086

Closed
3 tasks done
zhongwuzw opened this issue Sep 13, 2018 · 10 comments
Closed
3 tasks done

com.squareup.SocketRocket.NetworkThread(18): EXC_BAD_ACCESS #21086

zhongwuzw opened this issue Sep 13, 2018 · 10 comments
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.

Comments

@zhongwuzw
Copy link
Contributor

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 611.18 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 9.5.0 - /usr/local/bin/node
Yarn: 1.6.0 - /usr/local/bin/yarn
npm: 6.2.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
IDEs:
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: 16.4.1 => 16.4.1
react-native: 0.56.0 => 0.56.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1

Description

Crash randomly when run on iOS, the cause is when WebSocket's delegate callback, the delegate already released, leads to EXC_BAD_ACCESS.

More detail can see #6117.

Reproducible Demo

Crash randomly.

potential fix PR

#19489

@react-native-bot

This comment has been minimized.

@Ghstart

This comment has been minimized.

@Ghstart

This comment has been minimized.

@Ghstart

This comment has been minimized.

@zenghao0708

This comment has been minimized.

@javiercr
Copy link
Contributor

Same problem with v0.57.1

@zhongwuzw
Copy link
Contributor Author

@hramos Apologize if disturb, I see you already imported #19489 , any progress about this? 🤔

@hramos
Copy link
Contributor

hramos commented Sep 28, 2018

Left some comments in #19489.

@hramos hramos added the Platform: iOS iOS applications. label Sep 28, 2018
@ishigamii
Copy link

no update on this issue, can we safely add this PR to our code ? if not what can we do to avoid the many crash caused by it ? 👍 Thanks a lot.

@hramos
Copy link
Contributor

hramos commented Dec 13, 2018

FYI: latest proposed fix is at #22439 (which is referenced above).

bruchim pushed a commit to wix-playground/react-native that referenced this issue Feb 12, 2019
Summary:
Fixes facebook#21086.
Fixes facebook#6117.

This PR fixes a crash caused by a race condition when `webSocket` deallocated and `NSStream` delegate callback, because `NSStream`'s delegate callback be called on `RCTSR_networkRunLoop`.

This PR mainly changes:

* Remove unnecessary `nil` operation in `dealloc` method.
* Add a new method `_scheduleCleanUp` to schedule `webSocket` cleanup also on `RCTSR_networkRunLoop`.
* In `stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode` delegate method, add a `wself` to make safe further.
Pull Request resolved: facebook#22439

Differential Revision: D13564247

Pulled By: cpojer

fbshipit-source-id: 675c1b2805aa45c54d7708d796f5843ef7ea34e2
marcinolek pushed a commit to marcinolek/react-native that referenced this issue Feb 13, 2019
Summary:
Fixes facebook#21086.
Fixes facebook#6117.

This PR fixes a crash caused by a race condition when `webSocket` deallocated and `NSStream` delegate callback, because `NSStream`'s delegate callback be called on `RCTSR_networkRunLoop`.

This PR mainly changes:

* Remove unnecessary `nil` operation in `dealloc` method.
* Add a new method `_scheduleCleanUp` to schedule `webSocket` cleanup also on `RCTSR_networkRunLoop`.
* In `stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode` delegate method, add a `wself` to make safe further.
Pull Request resolved: facebook#22439

Differential Revision: D13564247

Pulled By: cpojer

fbshipit-source-id: 675c1b2805aa45c54d7708d796f5843ef7ea34e2
grabbou pushed a commit that referenced this issue Feb 18, 2019
Summary:
Fixes #21086.
Fixes #6117.

This PR fixes a crash caused by a race condition when `webSocket` deallocated and `NSStream` delegate callback, because `NSStream`'s delegate callback be called on `RCTSR_networkRunLoop`.

This PR mainly changes:

* Remove unnecessary `nil` operation in `dealloc` method.
* Add a new method `_scheduleCleanUp` to schedule `webSocket` cleanup also on `RCTSR_networkRunLoop`.
* In `stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode` delegate method, add a `wself` to make safe further.
Pull Request resolved: #22439

Differential Revision: D13564247

Pulled By: cpojer

fbshipit-source-id: 675c1b2805aa45c54d7708d796f5843ef7ea34e2
t-nanava pushed a commit to microsoft/react-native-macos that referenced this issue Jun 17, 2019
Summary:
Fixes facebook#21086.
Fixes facebook#6117.

This PR fixes a crash caused by a race condition when `webSocket` deallocated and `NSStream` delegate callback, because `NSStream`'s delegate callback be called on `RCTSR_networkRunLoop`.

This PR mainly changes:

* Remove unnecessary `nil` operation in `dealloc` method.
* Add a new method `_scheduleCleanUp` to schedule `webSocket` cleanup also on `RCTSR_networkRunLoop`.
* In `stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode` delegate method, add a `wself` to make safe further.
Pull Request resolved: facebook#22439

Differential Revision: D13564247

Pulled By: cpojer

fbshipit-source-id: 675c1b2805aa45c54d7708d796f5843ef7ea34e2
@facebook facebook locked as resolved and limited conversation to collaborators Jan 2, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot. Resolution: PR Submitted A pull request with a fix has been provided.
Projects
None yet
7 participants