Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

EXC_BAD_ACCESS Attempted to dereference garbage pointer 0x871dcbeb8 #295

Open
dwilt opened this issue Mar 21, 2017 · 15 comments
Open

EXC_BAD_ACCESS Attempted to dereference garbage pointer 0x871dcbeb8 #295

dwilt opened this issue Mar 21, 2017 · 15 comments

Comments

@dwilt
Copy link

dwilt commented Mar 21, 2017

"react-native": "0.41.2",
"react-native-fetch-blob": "0.10.2",

Got a crash while using our app. Not totally sure what the repro steps are but wanted to put this out there.

EXC_BAD_ACCESS Attempted to dereference garbage pointer 0x871dcbeb8. 
    /usr/lib/libobjc.A.dylib objc_msgSend
    Frameworks/Foundation.framework/Foundation -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:]
    Frameworks/Foundation.framework/Foundation -[NSOperationQueue setMaxConcurrentOperationCount:]
    /Users/dwilt/Projects/GJS/gjs-app/node_modules/react-native-fetch-blob/ios/RNFetchBlobNetwork.m:114:19 -[RNFetchBlobNetwork init]
    /Users/dwilt/Projects/GJS/gjs-app/node_modules/react-native-fetch-blob/ios/RNFetchBlob/RNFetchBlob.m:102:46 __65-[RNFetchBlob fetchBlob:taskId:method:url:headers:body:callback:]_block_invoke
    /Users/dwilt/Projects/GJS/gjs-app/node_modules/react-native-fetch-blob/ios/RNFetchBlobReqBuilder.m:160:9 __85+[RNFetchBlobReqBuilder buildOctetRequest:taskId:method:url:headers:body:onComplete:]_block_invoke
    /usr/lib/system/libdispatch.dylib __dispatch_call_block_and_release
    /usr/lib/system/libdispatch.dylib __dispatch_client_callout
    /usr/lib/system/libdispatch.dylib __dispatch_queue_override_invoke
    /usr/lib/system/libdispatch.dylib __dispatch_root_queue_drain
    /usr/lib/system/libdispatch.dylib __dispatch_worker_thread3
    /usr/lib/system/libsystem_pthread.dylib __pthread_wqthread
@wkh237
Copy link
Owner

wkh237 commented Mar 27, 2017

@dwilt , could you provide a sample about your usage which can replicate the error?

@wkh237 wkh237 closed this as completed Apr 3, 2017
@GaborWnuk
Copy link

GaborWnuk commented Apr 18, 2017

Hi! I also have this problem, can't replicate whatsoever:

# Issue #: 3121
# Issue ID: 58cbfcf70aeb16625b824896
# Session ID: 106ae09fabfd479a8b692f05b6bbd9ab_9f34c65b3a0d4190bb2c0d88a6fe659f_0_v1
# Date: 2017-04-18T08:50:19Z
# OS Version: 10.3.1 (14E304)
# Device: iPhone 7
# RAM Free: 13.3%
# Disk Free: 35.9%

#4. Crashed: com.apple.root.default-qos
0  libobjc.A.dylib                0x182dd4150 objc_msgSend + 16
1  Foundation                     0x184d62c94 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 60
2  Foundation                     0x184d8aa5c -[NSOperationQueue setMaxConcurrentOperationCount:] + 204
3  Xxxxxxx                        0x1002fe3ac -[RNFetchBlobNetwork init] (RNFetchBlobNetwork.m:117)
4  Xxxxxxx                        0x1002f4b10 __65-[RNFetchBlob fetchBlob:taskId:method:url:headers:body:callback:]_block_invoke (RNFetchBlob.m:131)
5  Xxxxxxx                        0x1003031c4 __85+[RNFetchBlobReqBuilder buildOctetRequest:taskId:method:url:headers:body:onComplete:]_block_invoke (RNFetchBlobReqBuilder.m:178)
6  libdispatch.dylib              0x1832169e0 _dispatch_call_block_and_release + 24
7  libdispatch.dylib              0x1832169a0 _dispatch_client_callout + 16
8  libdispatch.dylib              0x1832250d4 _dispatch_queue_override_invoke + 644
9  libdispatch.dylib              0x183226a50 _dispatch_root_queue_drain + 540
10 libdispatch.dylib              0x1832267d0 _dispatch_worker_thread3 + 124
11 libsystem_pthread.dylib        0x18341f1d0 _pthread_wqthread + 1096
12 libsystem_pthread.dylib        0x18341ed7c start_wqthread + 4

It is not OS version specific (i have crashes on iOS 9 and 10) or phone specific (also - full range of devices).

The problem is quite rare (around 1% of my users on scale of few thousand) however - it does exist.

The view consists of ~15 images displayed in ListView, with following render conditions for ListView:

initialListSize={3}
scrollRenderAheadDistance={Dimensions.get("window").height * 3}
pageSize={2}

as cells are quite big.

@wkh237 wkh237 reopened this Apr 18, 2017
@knutvalen
Copy link

knutvalen commented May 5, 2017

I also got the same problem as @GaborWnuk. The view is a ListView with one Image in each row.

# Issue #: 11
# Issue ID: 58ef3d0f0aeb16625b9db7bd
# Session ID: cf40838edb814dcaaaa7db573ea9c141_1d0b9e3debdf4c20a45a5eb09689e102_0_v1
# Date: 2017-05-04T13:28:19Z
# OS Version: 10.3.1 (14E304)
# Device: iPhone 6s
# RAM Free: 9.4%
# Disk Free: 14%

#2. Crashed: com.apple.root.default-qos
0  libobjc.A.dylib                0x1854a4150 objc_msgSend + 16
1  Foundation                     0x1874ea85c -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 188
2  Foundation                     0x187432c94 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 60
3  Foundation                     0x18745aa5c -[NSOperationQueue setMaxConcurrentOperationCount:] + 204
4  x                              0x100136434 -[RNFetchBlobNetwork init] + 4296729652
5  x                              0x10013d758 __65-[RNFetchBlob fetchBlob:taskId:method:url:headers:body:callback:]_block_invoke + 4296759128
6  x                              0x10013b790 __85+[RNFetchBlobReqBuilder buildOctetRequest:taskId:method:url:headers:body:onComplete:]_block_invoke + 4296750992
7  libdispatch.dylib              0x1858e69e0 _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x1858e69a0 _dispatch_client_callout + 16
9  libdispatch.dylib              0x1858f50d4 _dispatch_queue_override_invoke + 644
10 libdispatch.dylib              0x1858f6a50 _dispatch_root_queue_drain + 540
11 libdispatch.dylib              0x1858f67d0 _dispatch_worker_thread3 + 124
12 libsystem_pthread.dylib        0x185aef1d0 _pthread_wqthread + 1096
13 libsystem_pthread.dylib        0x185aeed7c start_wqthread + 4

@kelset
Copy link

kelset commented Jun 5, 2017

Similar situation over here too, we have a SectionList (RN 0.44) with two images in each row.

Crashed: com.apple.root.default-qos
0  libobjc.A.dylib                0x189904150 objc_msgSend + 16
1  Foundation                     0x18b94a82c -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 140
2  Foundation                     0x18b892c94 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 60
3  Foundation                     0x18b8baa5c -[NSOperationQueue setMaxConcurrentOperationCount:] + 204
4  TheWeek                        0x1004eb8a4 -[RNFetchBlobNetwork init] (RNFetchBlobNetwork.m:112)
5  TheWeek                        0x1004f2b00 __65-[RNFetchBlob fetchBlob:taskId:method:url:headers:body:callback:]_block_invoke (RNFetchBlob.m:131)
6  TheWeek                        0x1004f0b14 __85+[RNFetchBlobReqBuilder buildOctetRequest:taskId:method:url:headers:body:onComplete:]_block_invoke (RNFetchBlobReqBuilder.m:178)
7  libdispatch.dylib              0x189d469e0 _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x189d469a0 _dispatch_client_callout + 16
9  libdispatch.dylib              0x189d550d4 _dispatch_queue_override_invoke + 644
10 libdispatch.dylib              0x189d56a50 _dispatch_root_queue_drain + 540
11 libdispatch.dylib              0x189d567d0 _dispatch_worker_thread3 + 124
12 libsystem_pthread.dylib        0x189f4f1d0 _pthread_wqthread + 1096
13 libsystem_pthread.dylib        0x189f4ed7c start_wqthread + 4

We are also using this lib ( react-native-img-cache ) for caching, which relies on react-native-fetch-blob.

@samueljmurray
Copy link

Also having this issue (RN 0.43) and using react-native-img-cache too. All images are used in a FlatList. Similar to @GaborWnuk this has affected ~1% (40) out of a few thousand users. Only on iOS 10, though our sample probably isn't big enough for this to be meaningful as we only support down to 9.3.5.

Crashed: com.apple.root.default-qos
0  libobjc.A.dylib                0x18f1f6f30 objc_msgSend + 16
1  Foundation                     0x19125b738 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 176
2  Foundation                     0x1911a3a40 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 64
3  Foundation                     0x1911cb3f0 -[NSOperationQueue setMaxConcurrentOperationCount:] + 204
4  MyApp                          0x100291644 -[RNFetchBlobNetwork init] + 463760
5  MyApp                          0x100298968 __65-[RNFetchBlob fetchBlob:taskId:method:url:headers:body:callback:]_block_invoke + 493236
6  MyApp                          0x1002969a0 __85+[RNFetchBlobReqBuilder buildOctetRequest:taskId:method:url:headers:body:onComplete:]_block_invoke + 485100
7  libdispatch.dylib              0x18f635200 _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x18f6351c0 _dispatch_client_callout + 16
9  libdispatch.dylib              0x18f643ab4 _dispatch_queue_override_invoke + 732
10 libdispatch.dylib              0x18f64538c _dispatch_root_queue_drain + 572
11 libdispatch.dylib              0x18f6450ec _dispatch_worker_thread3 + 124
12 libsystem_pthread.dylib        0x18f83e2b8 _pthread_wqthread + 1288
13 libsystem_pthread.dylib        0x18f83dda4 start_wqthread + 4

@kelset
Copy link

kelset commented Jul 13, 2017

Any update on this? I've updated my app to 0.45 and I still have this issue, on a small number of iPhones with iOS 10.x

@wkh237
Copy link
Owner

wkh237 commented Jul 27, 2017

I have tried to find the problem but unfortunately couldn't find a way to reproduce it, I think if there's sample for replicate the issue would be helpful.

@kelset
Copy link

kelset commented Oct 5, 2017

To quickly update everyone on this issue, looks like @jackdoe found a fix for it, #499 which is currently merged but not out

@mbarbon
Copy link

mbarbon commented Oct 6, 2017

A workaround for this issue is to make a dummy request early in the app initializaation (for example request www.google.com with 1ms timeout and ignore the failure).

This will force library initialization and should avoid the race condition fixed by #499

@lll000111
Copy link
Contributor

You can always use another branch instead of master or the actual release. I, for example, use the 0.10.9 tree from my own fork of this repo. No need to wait for the "official" release - this is not a big company where "official release" means "this gets official support" and that it has been tested much more thoroughly. The current 0.10.9 branch already passed all tests in https://github.com/wkh237/react-native-fetch-blob-dev and you can use common sense and your own tests for any additional patches that you may want to add on top.

@kelset
Copy link

kelset commented Oct 9, 2017

I really don't get your attitude, I'm not asking for anything more than simply do a new release since this PR has been already merged. I'm not pretending anything not asking for "official support".

@lll000111
Copy link
Contributor

lll000111 commented Oct 9, 2017

I really don't get your attitude,

@kelset

I'm not the owner!

@GaborWnuk
Copy link

Guys,

this PR #499
plus my small fix #513

actually solved my problems.

I am using
"react-native-fetch-blob": "wkh237/react-native-fetch-blob#0.10.9"

in my package.json and the problem disappeared on ~500k userbase.

@kelset
Copy link

kelset commented Oct 25, 2017

@GaborWnuk same.

jsfu pushed a commit to jsfu/react-native-fetch-blob that referenced this issue Feb 27, 2018
@ZionChang
Copy link

@GaborWnuk , when I use "react-native-fetch-blob": "wkh237/react-native-fetch-blob#0.10.9", this error come: RNFetchBlob.mkdir was called with 2 arguments but expects 1 arguments, any help?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants