-
Notifications
You must be signed in to change notification settings - Fork 42
SIGSEGV segmentation fault when accessing default Timberjack session configuration #27
Description
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.