快速崩溃:Array._allocateBufferUninitialized [英] Swift Crash: Array._allocateBufferUninitialized

查看:96
本文介绍了快速崩溃:Array._allocateBufferUninitialized的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了一个集成了我们的Swift SDK的应用程序的崩溃报告。我能够对其进行符号化,但是当我查看应该属于我们SDK的堆栈跟踪中的最后一行代码时,我无法识别它。

I have a crash report from an app that has integrated our Swift SDK. I was able to symbolicate it but when I look at the last line of code in the stack trace that is supposed to belong to our SDK, I do not recognize it.

(堆栈的其余部分在Swift Core中。混淆的名称)

(rest of stack is in Swift Core. Obfuscated names)

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000a00000008
....
7   libswiftCore.dylib      0x00000001007d337c 0x1005ec000 + 1995644
8   libswiftCore.dylib      0x00000001007d33d4 0x1005ec000 + 1995732
9   OurLib                  0x00000001003e1ed0 specialized specialized static Array._allocateBufferUninitialized<A>(Int) -> _ArrayBuffer<A> (TheCrashingClass.swift:0)
10  OurLib                  0x0000000100420200 specialized static OurLibClass.(startInternal in _9A5ED0808944BC6425F8A2C348E9DA3A)(delegate : NotificationDelegate?, send : Bool) -> () (OurLibClass.swift:0)
11  OurLib                  0x0000000100420a70 specialized static OurLibClass.start(NotificationDelegate?, send : Bool) -> () (OurLibClass.swift:47)
12  OurLib                  0x000000010041f5b0 @objc static OurLibClass.start(NotificationDelegate?, send : Bool) -> () (OurLibClass.swift:0)
13  TheApp                  0x00000001000f8f3c -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:48)

有问题的行是以下行:

specialized specialized static Array._allocateBufferUninitialized<A>(Int) -> _ArrayBuffer<A> (TheCrashingClass.swift:0)

由于OurLibClass不调用TheCrashingClass,因此堆栈跟踪令人困惑。客户端确认未打印在start()调用开始时启用的打印语句。这使我认为在加载CrashingClass时正在调用静态属性/块。这是该类和属性的精简版本。

The stack trace is confusing since OurLibClass doesn't call TheCrashingClass. The client confirmed that a print statement we have enabled at the beginning of the start() call is not being printed. This makes me think that a static property/block is being called on CrashingClass when it is loaded. Here is a stripped down version of the class and attributes.

public class CrashingClass : IProtocolThree, CustomStringConvertible {

    public let description = "ADescription"
    private let class1: IProtocolOne
    private var class2: IProtocolTwo?
    private let defaults: NSUserDefaults
    private let key: String
    private let class4: IProtocolOne
    private let callback: () -> ()
    private let class3 = Class3()

    public private(set) var interval: NSTimeInterval

    public var date2: NSDate? { get { } }

    public var date1: NSDate? { get { } }

    init(class1: IProtocolOne, defaults: NSUserDefaults, key: String, interval: NSTimeInterval, class4: IProtocolFour, callback: () -> ()) {
    }
}

它没有任何数组,是我唯一想到的属性

It doesn't have any arrays and the only property I could think of that would be getting initialized as an array is the String.

其他注意事项:
-我无法在任何设备上重现此问题(真实或模拟器)
-崩溃仅在某些设备上发生,但是当它在设备上发生时,它会持续发生。但是,相同类型的不同设备表现出不同的行为。例如,一个iPad4(ios 8.0)总是崩溃,而另一个iPad4(ios 8.1)却没有崩溃。
-应用程序是objc而框架是Swift

Some other things to note: - I am unable to reproduce this issue on any device (real or simulator) - the crash only happens on certain devices, but when it happens on a device it happens consistently. But, different devices of the same type exhibit different behaviour. For example, one iPad4 (ios 8.0) always crashes while another iPad4 (ios 8.1) doesn't. - App is objc while framework is Swift

我的问题是:

专业化专用静态数组._allocateBufferUninitialized(Int)-> _ArrayBuffer(TheCrashingClass.swift:0)

specialized specialized static Array._allocateBufferUninitialized(Int) -> _ArrayBuffer (TheCrashingClass.swift:0)


  • 我可以在allocateBufferUninitialized上设置一个符号断点,以便

  • 特殊专业化是什么意思?

  • 任何其他见解将不胜感激。

推荐答案

我无法缩小出现问题的代码范围。但是,我发现了问题。

I wasn't able to narrow down the area of the code with the problem. But, I found the issue.

问题是我们的Swift SDK是使用Xcode 7.1(使用Swift 2.1)构建的,而应用程序是使用Xcode 7.0(使用Swift 2.0)。如果我们使用相同版本的Xcode构建框架,那么一切都很好。我对Apple感到非常失望,因为我们不应该在次要版本升级中找到类似的问题。

The problem was that our Swift SDK was built with Xcode 7.1 (using Swift 2.1) and the application was building their application with Xcode 7.0 (using Swift 2.0). If we build our framework with the same version of Xcode all is well. I am super disappointed in Apple in that we shouldn't find issues like this in a minor version upgrade.

已提交雷达23338116。

Submitted radar 23338116.

这篇关于快速崩溃:Array._allocateBufferUninitialized的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆