smart-on-fhir / Swift-SMART

Swift SMART on FHIR framework for iOS and OS X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search related EXC_BAD_ACCESS

raheelsayeed opened this issue · comments

Facing an EXC_BAD_ACCESS, something to do when only using .search() query on a QuestionnaireResponse with ValueSetCompose. This is strange, .read() works just fine for the same resource, but .search() is a problem. (STU3)

let server = Server(baseURL: URL(string: "https://r3.smarthealthit.org/")!)

QuestionnaireResponse.read("161921", server: server) { (resource, error) in
 }

QuestionnaireResponse.search(["_id" : "SMART-PROMs-1-QR4"]).perform(server) { (bundle, error) in
}

//ERROR
QuestionnaireResponse.search(["_id" : "161921"]).perform(server) { (bundle, error) in
             
}

note: QR: 161921 might not exist every day: create this resource this to check against

Seems to be some issue surfacing due to recent compiler optimizations. Turn on "Thread Sanitizer" to avoid it.

Tried many approaches to no avail. Thread Sanitizer didn't work on search(). My guess is, something to do with Bundle parsing. Hard to note what for now.
Don't see any zombi objects either.