malloc: nano zone abandoned due to inability to preallocate reserved vm space.

Symptom

malloc: nano zone abandoned due to inability to preallocate reserved vm space. message is displayed when the “Thead Sanitizer” of “Diagnostic” is checked.

Solution

A default Swift Project for iPhone with no control shows this message, when the “Thead Sanitizer” of “Diagnostic” is checked.

It means this message can be ignored, I believe.

nw_protocol_get_quic_image_block_invoke dlopen libquic failed

Symptom

nw_protocol_get_quic_image_block_invoke dlopen libquic failed” error always occurs.

        if let url = URL(string: baseUrlStr) {
            let task = URLSession.shared.dataTask(with: url) {(data, response, error) in
            }
            task.resume()
        }

Solution

Just ignore the error.

I tested the code above within main thread and global thread, and the error message was displayed in both cases. There is no way to avaid this error at this moment.

https://forums.swift.org/t/swift-firebase-connection/41632/6

Singleton

final class Settings {
    let userDefaults = UserDefaults.standard
    
    public static let shared = Settings()

    let defaults: [String : Int] = ["minute" : 4, "second" : 59]
    
    private init() {
        self.minute = userDefaults.integer(forKey: "minute")
        self.second = userDefaults.integer(forKey: "second")
    }

    private var _interval: Int = 0
    var interval: Int {
        get {
            return _interval
        }
        set {
            _interval = newValue
        }
    }
    
    private var _minute: Int = 0
    var minute: Int {
        get {
            return _minute
        }
        set {
            _minute = newValue
        }
    }
}

-------------------------
        // 設定を初期化する
        let _ = Settings.shared

        minStepper.value = Double(Settings.shared.minute)

error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x18).

Reference

Symptom

error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x18).

The process has been returned to the state before expression evaluation.

Investigation

In Xcode, Menu >> Product >> Scheme >> Edit Scheme

From Run >> Diagnostics >> Check Runtime Sanitization

Solution

In my case, accessed timer.userInfo which timer has been already invalidated. It was due to multiple async timer invocations. Inserted timer.isValid check just before accessing timer.userInfo.

“Generic error”: Insufficient Permission (to submit GPU work from background)

Symptom

[espresso] [Espresso::handle_ex_plan] exception=Espresso exception: “Generic error”: Insufficient Permission (to submit GPU work from background) (IOAF code 6); code=7 status=-1

Solution

Background Apps May Not Execute Commands on the Graphics Hardware, at this moment.