Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXC_BAD_ACCESS #21

Open
wuttke opened this issue May 10, 2018 · 7 comments
Open

EXC_BAD_ACCESS #21

wuttke opened this issue May 10, 2018 · 7 comments

Comments

@wuttke
Copy link

wuttke commented May 10, 2018

Hi!

When using the SMART classes, I encounter a EXC_BAD_ACCESS.

bildschirmfoto 2018-05-10 um 14 13 12

This happens both in the Demo project (regardless of the data source) and with a small own test app:

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        let myEndpoint = "https://hapi.fhir.org/baseDstu3"
        //var myFhirUrl = myEndpoint + "/Observation?patient=3352608&category=laboratory"
        
        let smart = Client(
            baseURL: URL(string: myEndpoint)!,
            settings: [:
            ]
        )
        
        smart.authProperties.granularity = .tokenOnly

        smart.authorize() { patient, error in
            if nil != error { //} || nil == patient {
            }
            else {
                Observation.search(["patient": "3352608", "category": "laboratory"])
                    .perform(smart.server) { bundle, error in
                        if nil != error {
                        }
                        else {
                        }
                }
            }
        }
    }
}
@wuttke
Copy link
Author

wuttke commented May 10, 2018

This gives the same exception:

        let server = FHIRMinimalServer(baseURL: URL(string: "https://hapi.fhir.org/baseDstu3/")!)
        Observation.search(["patient": "3352608", "category": "laboratory"])
            .perform(server) { bundle, error in
// ...
        }

@p2
Copy link
Member

p2 commented May 11, 2018

Try enabling "Thread Sanitizer" in build settings.

@wuttke
Copy link
Author

wuttke commented May 11, 2018

Thanks for the feedback. I've enabled the Thread Sanitizer for my Build scheme. This caused the exception to disappear. Should I use the Thread Sanitizer all the time?

https://developer.apple.com/documentation/code_diagnostics/thread_sanitizer/enabling_the_thread_sanitizer

@p2
Copy link
Member

p2 commented May 11, 2018

We should fix the root issue, enabling the sanitizer is just a workaround. :)

@wuttke
Copy link
Author

wuttke commented May 11, 2018

Makes sense :-)
Can I help?

@p2
Copy link
Member

p2 commented May 11, 2018

PRs are always welcome!!

@raheelsayeed
Copy link

I've seen this happen only on xcode9.3 simulators. No error on testing on Device (11.3) . (With thread sanitizer disabled)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants