segmentation fault 11 in Xcode 9 ios 11 beta

We are facing segmentation fault 11 in Xcode 9 ios 11 beta but works fine in xcode 8.3.3. Errors like while type-checking, While validating and while resolving type. Will this be fixed by apple in the upcoming beta's?


We are facing this issue in many places changing the code is difficult also we dint see any release note regarding this from apple so we are waiting for the new beta.


We are waiting for your reply.

Replies

There are many possible causes to segmentation faults ; it's possible that they were hidden in Swift3 but appear in Swift4 is is more strict on checkings).


Some causes I have identified, if that may help:


- If you have a loop as :

for i in 0..<limit {

and if limit has a value but is optional (e.g., because of optional chaining)


- when trying to set a Double to a var that is declared as Int, without converting with Int()


- When using subscript, without unwrapping the subscript result as in :

subscript (j: Int, h: Int) -> Bool? // Compute subscript of a 2 dimension array

var tab : Array 2D

if tab[theFirstDay, iHeure]! // without !, seg fault 11

Thanks it got fixed in iOS 11 Beta 4.

Great. Don't forget to mark the thread as closed.