Swift-SMART icon indicating copy to clipboard operation
Swift-SMART copied to clipboard

Search related EXC_BAD_ACCESS

Open raheelsayeed opened this issue 6 years ago • 2 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

raheelsayeed avatar Jul 19 '18 16:07 raheelsayeed

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

p2 avatar Jul 19 '18 16:07 p2

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.

raheelsayeed avatar Jul 20 '18 20:07 raheelsayeed