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

Segmentation fault: 11 #72

Closed
nickvelloff opened this issue May 4, 2016 · 9 comments
Closed

Segmentation fault: 11 #72

nickvelloff opened this issue May 4, 2016 · 9 comments

Comments

@nickvelloff
Copy link

Hi. I inherited a project that utilizes this awesome library, but I'm super new to it.
I updated the dependencies to support Swift 2.2 and am now receiving a Segmentation fault: 11 and I can't quite find the issue.

Looking through the change logs here I have a feeling it has something to do with the result error type Result<AccessToken, NSError> and SwishError (and not using it properly)... but I'm not sure.

I tries a few different approaches but am hitting a wall.

This is the first file to fail, and the others like it fail to compile for the same reason.
https://github.com/the-grid/Disc/blob/redirect_uri_email/Disc/Networking/Authorization/GetAccessToken.swift

If you have a moment, does anything shout out at you as something I should look at?

Thanks for the work on this library.

@sidraval
Copy link
Contributor

sidraval commented May 4, 2016

The performRequest method expects the callback to have type: Result<T.ResponseObject, SwishError> -> Void, have you tried changing your callbacks to use SwishError instead of NSError?

https://github.com/thoughtbot/Swish/blob/master/Source/Models/APIClient.swift#L14

@gfontenot
Copy link
Collaborator

Yeah, try what @sidraval said. We saw this same thing here and that fixed the segfaults. Other errors should present themselves as proper compilation errors once you've fixed that.

@nickvelloff
Copy link
Author

Actually I did try that, but let me give it another shot. Thanks, let's see what happens.

@nickvelloff
Copy link
Author

OK so I changed over to SwishError and still am stuck on the seg fault. Anything else stand out?

https://github.com/the-grid/Disc/blob/redirect_uri_email/Disc/Networking/Authorization/GetAccessToken.swift

@nickvelloff
Copy link
Author

FWIW when I roll back to 2d485a7 it compiles (with associated warnings due to Swift)

@gfontenot
Copy link
Collaborator

@nickvelloff
Copy link
Author

@gfontenot That did it! Thanks so much for taking time to look, you saved me a lot of searching. 🙇

@gfontenot
Copy link
Collaborator

Sorry that we don't have proper versioning yet and also sorry that Swift's compiler wasn't being super helpful. Any feedback you have on the lib is greatly appreciated!

@nickvelloff
Copy link
Author

Definitely. I really love how hands off this library is. I will certainly have more feedback as I go. It would be great to migrate to this in the "parent" project at some point.

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

3 participants