How to fix "Bus error 10" after update to Xcode 10.2
Asked Answered
B

3

12

I updated Xcode to new stable 10.2v. I tried to build my project and it was successful. When I'm trying to archive the project (workspace), I'm getting errors like on screenshot below:

What I've tried so far:

  1. Update cocoa pods to latest version -> COCOAPODS: 1.7.0.beta.3
  2. Clean DeliveredData folder
  3. Reinstall Xcode
  4. Remove repository, clone it again and install pods
  5. Totally remove all pods from project and add them back
Benia answered 28/3, 2019 at 11:43 Comment(0)
T
22

Temporary Workaround

For me it was only the Cache framework. Until they have fixed it, you can manually set SWIFT_OPTIMIZATION_LEVEL to -Onone for the configuration you want to use for archiving.

CocoaPods

You could even use your Podfile if you don't want Cococapods to overwrite the settings every time you run pod install

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            if target.name == 'Cache'
                config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
            end
        end
    end
end

Note that this is specifically checking for the Cache framework. If you have problems with other frameworks you might want to change or extend this condition.

Twohanded answered 3/4, 2019 at 14:31 Comment(0)
U
3

While Lukas' answer of disabling optimization on the Cache pod works, I followed Alex's link to the issue in their GitHub repo and found there is an open pull request with a pretty simple code change that fixes it. I unlocked the file and made the change locally.

Here's the PR: https://github.com/hyperoslo/Cache/pull/236

Apply this diff: https://github.com/hyperoslo/Cache/pull/236/commits/560f00a9a9549db161ca70d96eed74fc580b03e3#diff-9e53dc1370d4f7c9cdaaa103d26ff096

Which, to repeat here, is in the file MD5.swift change the safe_add function to be:

func safe_add(_ x: Int32, _ y: Int32) -> Int32 {
  return x &+ y
}

(Disclaimer: I do not claim to know the correctness of the change, but it seems the delay merging the PR is due to figuring out who is currently maintaining the repo.)

Uremia answered 3/4, 2019 at 19:52 Comment(1)
Chadwick you're a godsend, thanks for linking that hereWentz
B
1

The answer is here: https://github.com/hyperoslo/Cache/issues/238

We are waiting for the owners of this repo to make any sign of life...

Benia answered 28/3, 2019 at 13:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.