Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
iOS Attempted to dereference garbage pointer

I am getting iOS crash report from Bugnag:

Attempted to dereference garbage pointer 0x8000000000000010

Below is the class which I have in my project

class Presence {
    private var userStates = [Int: [String: Any]]()

   internal func saveState(state: UserPresenceState, updateTime: Date, for userId: Int) {
        let value = ["state": state, "updated_at": updateTime]
        let queue = DispatchQueue(label: "mySerialQueue")
        queue.sync { 
             self.userStates[userId] = value
        }
    }
}

I am getting Attempted to dereference garbage pointer at line self.userStates[userId] = value. Not sure while accessing self or while accessing userStates variable

I am not sure why this is happening and unable to replicate it, how to solve these kinds of problems?

Is there anything know whether a variable is deallocated or not?

Any help much appreciated

FYI I got the same error from bugsnag with below code too

internal func saveState(state: UserPresenceState, updateTime: Date, for userId: Int) {
    let value: [String: Any] = ["state": state, "updated_at": updateTime]
    self.userStates[userId] = value
}
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!