I got crash report for my mobile application
private var _timedEvents: SynchronizedBarrier<[String: TimeInterval]>
private var timedEvents: [String: TimeInterval] {
get {
_timedEvents.value
}
set {
_timedEvents.value { $0 = newValue }
}
}
func time(event: String) {
let startTime = Date.now.timeIntervalSince1970
trackingQueue.async { [weak self, startTime, event] in
guard let self else { return }
var timedEvents = self.timedEvents
timedEvents[event] = startTime
self.timedEvents = timedEvents
}
}
From the report, the crash is happening at _timedEvents.value { $0 = newValue }
struct ReadWriteLock {
private let concurentQueue: DispatchQueue
init(label: String,
qos: DispatchQoS = .utility) {
let queue = DispatchQueue(label: label,
qos: qos,
attributes: .concurrent)
self.init(queue: queue)
}
init(queue: DispatchQueue) {
self.concurentQueue = queue
}
func read<T>(closure: () -> T) -> T {
concurentQueue.sync { closure() }
}
func write<T>(closure: () throws -> T) rethrows -> T {
try concurentQueue.sync(flags: .barrier) { try closure() }
}
}
struct SynchronizedBarrier<Value> {
private let lock: ReadWriteLock
private var _value: Value
init(_ value: Value,
lock: ReadWriteLock = ReadWriteLock(queue: DispatchQueue(label: "com.example.SynchronizedBarrier",
attributes: .concurrent))) {
self.lock = lock
self._value = value
}
var value: Value { lock.read { _value } }
mutating func value<T>(execute task: (inout Value) throws -> T) rethrows -> T {
try lock.write { try task(&_value) }
}
}
What could be the reason for the crash?
I have attached the crash report.
Masked.crash
Post
Replies
Boosts
Views
Activity
I need some clarification from Mobile Device Management analytics usage.
We are developing a SDK which collects device information such as Device Model and OS version for analytics.
One of our SDK integrator uses our SDK in their MDM app, can we collect the device information, if we specify the what data will be collected and how it will be used on app screen from the app layer?
Trying to generate dynamic library (framework), in Debug build I can see the local path to my source code inside the framework or Unix Executable File.
This is not the case with Release build. How can I prevent the path getting exposed in the framework file?
I tried perl command to replace the occurrences of the path inside file. But when I do that and try to use framework within my iOS application, I got
ld: malformed universal file: slice extends beyond end of file file '/path/to/my/Sample.framework/Sample'
Framework file got corrupted, is there any proper way from XCode or xcodebuild command to achieve this?