remind101 / AutoGraph

A GraphQL Client in Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.5.0 crashes in release mode

0-mykola opened this issue · comments

After pod update with the last version of AutoGraph, I stuck on crashes in release mode.
In debug mode, everything works fine.

Currently, I'm developing the app using the AutoGraph library (0.4.4), and after update to Xcode 9.3 I have a problem with generics used in Crust library. After Autograph update with all dependencies, everything worked fine. But when I compiled in release mode, my app start crashing in any part of code after the request from GraphQL server.

Thread 1: EXC_BAD_ACCESS (code=1, address=0x60020044c998)

Then I created a simple app with dependencies used for Autograph last version and tried to make a simple request. The behavior of the application remains the same in release mode.

Example app:

pod 'AutoGraph'
pod 'RealmSwift'

Using Alamofire (4.7.2)
Using AutoGraph (0.5.0)
Using Crust (0.9.0)
Using JSONValueRX (4.0.0)
Using Realm (3.5.0)
Using RealmSwift (3.5.0)

and set one model in the app for fetch data from GraphQL server.

Result: App always crashes.

Update: xcode 9.4 beta 1 In release mode, everything works fine.

commented

Thanks for letting us know. We're dealing with the same problem unfortunately and are working towards a solution. I'm not surprised that it works in Xcode 9.4 since there were a number of other issues introduced in Swift 4.1 yet resolved in Swift 4.2 we've tackled in Crust. We've currently had tests running in Debug mode but will change this going forward to catch these kinds of issues.

Would you mind providing a stack trace that we can compare with?

In the meantime, it is still possible to ship with Xcode 9.2 if you choose to use an older release, though I know this is not ideal.

commented

This may be of the same vein - ReactiveX/RxSwift#1555

I've isolated relatively where the issue lies, it looks like a completion block is being overreleased after being passed through a dispatch queue. I've refactored the code a number of different ways to try to extend the lifetime of the callback but nothing has seemed to work. For the time being I think rolling back to Xcode 9.2 / Swift 4.0.3 is the right approach, until the next version of Xcode is released. In the meantime I'm going to work on a bug report for the swift team and see if they have any work arounds.

commented

Xcode 9.4 should fix it #82