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

SIGSEGV segmentation fault when accessing default Timberjack session configuration #27

Open
briandavidelliott opened this issue Sep 26, 2017 · 0 comments

Comments

@briandavidelliott
Copy link

I am seeing a crash (SIGSEGV - invalid memory address) in the following code when calling the Alamofire HTTPManager and passing the results of a call to the Timberjack.defaultSessionConfiguration():

class HTTPManager: Alamofire.SessionManager {

static let shared: HTTPManager = {
    let configuration = Timberjack.defaultSessionConfiguration()
    let manager = HTTPManager(configuration: configuration) . <=== Crashes here
    return manager
}()

}

The is following the example in the Timberjack README file (https://github.com/andysmart/Timberjack)

And our network calls look like this:

class DataAgent: NSObject, NSCoding {

public static var manager:NetworkManager = NetworkManager()

let request:DataRequest = manager.networkRequest("(DataAgent.api_url)", method:NetworkingConstants.HTTPMethod.post, params: params)
request.validate()
.responseJSON { response in
switch response.result {
case .success(let data):
DataAgent.tokenCallback(json: JSON(data))
DataAgent.scope = role
print("Login Successful! (DataAgent.access_token ?? "UNDEFINED")")
completion(true)

                    case .failure(let error):
                        print("Login Failed: \(error)")
                        completion(false)
                }
            }

And the network request is in my NetworkManager class:

func networkRequest<T> (_ url:String, method:NetworkingConstants.HTTPMethod, params:[String : Any], mock:Bool = false) -> T  {
       ...
        let parameters:Parameters = params
        let returnRequest:DataRequest = HTTPManager.shared.request(url, method: getAlamofireMethod(method), parameters: parameters)
        return returnRequest as! T
      ...
}

But I am not able to reproduce this one on-demand but am seeing that my users are experiencing it.

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

No branches or pull requests

1 participant