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

[cuperino_http] Crash in cupertino_http #887

Closed
knaeckeKami opened this issue Mar 8, 2023 · 9 comments · Fixed by #888
Closed

[cuperino_http] Crash in cupertino_http #887

knaeckeKami opened this issue Mar 8, 2023 · 9 comments · Fixed by #888
Assignees
Labels
package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@knaeckeKami
Copy link
Contributor

I recently rolled out cupertino_http for a small percentage of users in a production app and I see some crashes associated with it.

I did not reproduce it myself yet, but I thought I'd share the stack trace here:

OS Version: iOS 15.7.3 (19H307)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x0000000d531fc190
Crashed Thread: 15

Application Specific Information:
lock > ryView:withSize: >
Attempted to dereference garbage pointer 0xd531fc190.

Thread 15 Crashed:
0   libobjc.A.dylib                 0x32fa99cf4         objc_msgSend
1   cupertino_http                  0x102986028         -[CUPHTTPClientDelegate URLSession:dataTask:didReceiveResponse:completionHandler:] (CUPHTTPClientDelegate.m:126)
2   CFNetwork                       0x30197d4ec         CFURLConnectionCreateWithProperties
3   Foundation                      0x3037c8398         __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
4   Foundation                      0x3037d9a6c         -[NSBlockOperation main]
5   Foundation                      0x3037b3a88         __NSOPERATION_IS_INVOKING_MAIN__
6   Foundation                      0x3037c3fc8         -[NSOperation start]
7   Foundation                      0x3037c7494         __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__
8   Foundation                      0x3037d4cc8         __NSOQSchedule_f
9   libdispatch.dylib               0x300341540         _dispatch_block_async_invoke2
10  libdispatch.dylib               0x300394090         _dispatch_client_callout
11  libdispatch.dylib               0x300336bb4         _dispatch_continuation_pop$VARIANT$mp
12  libdispatch.dylib               0x3003362dc         _dispatch_async_redirect_invoke
13  libdispatch.dylib               0x300343b90         _dispatch_root_queue_drain
14  libdispatch.dylib               0x300344398         _dispatch_worker_thread2
15  libsystem_pthread.dylib         0x3b712fdd0         _pthread_wqthread

Additional info: I use cupertino_http in a separate isolate, not in the Main isolate. Not sure if related.

@knaeckeKami knaeckeKami added package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Mar 8, 2023
@brianquinlan
Copy link
Collaborator

Hey @knaeckeKami, thanks for the great bug report. I'm looking into it now.

@brianquinlan
Copy link
Collaborator

I think that I screwed up the reference count management. Let me try to verify.

@knaeckeKami
Copy link
Contributor Author

Thanks your the prompt fix!

@brianquinlan
Copy link
Collaborator

@knaeckeKami I'm going to do a release in a few minutes, would you mind testing it?

@knaeckeKami
Copy link
Contributor Author

will do!

@knaeckeKami
Copy link
Contributor Author

We have enabled native http for all users for a 2 weeks now and have not seen any crashes related to that, seems good

@brianquinlan
Copy link
Collaborator

@knaeckeKami Awesome! If you don't mind me asking, in what app are you using cupertino_http?

@knaeckeKami
Copy link
Contributor Author

We use it for Hello Inside, an app that aims to offer you insights into how your body reacts to certain foods, habits, etc. using continuous glucose monitoring.

https://helloinside.com/hello-hormones/

The reason why we tried cupertino_http is that a small fraction of our users reported, that the app behaves as if they were offline all time time.
The native parts of the app (sentry error reporting, customer support) worked though, we saw that every HTTP call was terminated with "Connection Reset By Peer".

It was probably an issue with proxies, metered connections, or even anti-malware systems blocking the calls (the users are not particularly tech-savvy, so they could not really tell us more about their network).

But since native HTTP calls using Sentry etc. worked, we decided the enable cupertino_http for them to see if this solved their issue, and it did.

@brianquinlan
Copy link
Collaborator

Thanks for that! Your app looks cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:cupertino_http Issues related to package:cupertino_http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants