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

HTTPDataLoader crashes decrementStrong on line 438 #58

Closed
hschouman opened this issue Jul 26, 2022 · 4 comments
Closed

HTTPDataLoader crashes decrementStrong on line 438 #58

hschouman opened this issue Jul 26, 2022 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hschouman
Copy link

Bug Report

Q A
BC Break no
Version 1.5.2

Summary

Hello, I am experiencing some crash using RealHTTP on my app. Not sure if it comes from the lib or the use I do.

Current behavior

The app crash when deallocating a pointer on line 438 of the file HTTPDataLoader.swift.

How to reproduce

2% of my users are experiencing the crash but not sure of how to reproduce for the moment.

Here are the stack trace : crash.txt
Capture d’écran 2022-07-26 à 17 45 34

Thanks for your help

@malcommac malcommac changed the title HTTPDataLoader crashes decrementStrong on ligne 438 HTTPDataLoader crashes decrementStrong on line 438 Jul 28, 2022
@malcommac
Copy link
Collaborator

malcommac commented Aug 15, 2022

On line 438 of HTTPDataLoader on version 1.5.2 there is the following line.

Of course, we should call client's delegate to the main thread:

if let client = self.client {
  client.delegate?.client(client, didFinish: (handler.request, task), response: response)
}

However, it should be not your issue. Have you found a way to replicate this issue? Did you perform some action in your HTTPClient's delegate object for that event?

@malcommac malcommac reopened this Aug 15, 2022
@malcommac malcommac self-assigned this Aug 15, 2022
@hschouman
Copy link
Author

Not found a way to replicate yet. Yes we use the delegate object for that event to forward the request.task,response.error?.error and response.data to Datadog methods : URLSessionInterceptor.shared?.taskCompleted(task: task, error: error) and URLSessionInterceptor.shared?.taskReceivedData(task: task, data: data).

Also with Xcode beta I have two warnings that are not here with Xcode 13.4.1, that could be related :
Capture d’écran 2022-08-16 à 15 10 04

@malcommac
Copy link
Collaborator

The warning should be okay with the fixes on main branch where events to delegate are sent in main thread.
May you have a look and test it?

@hschouman
Copy link
Author

Ok I will fetch and try the main branch on a beta with enough people to say if it fixed the crash. Thanks for your help !

@malcommac malcommac added this to the 1.7.0 milestone Sep 6, 2022
@malcommac malcommac added the bug Something isn't working label Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants