awslabs / aws-crt-python

Python bindings for the AWS Common Runtime
Apache License 2.0
87 stars 42 forks source link

Update crash handler behavior to opt-in #484

Closed waahm7 closed 1 year ago

waahm7 commented 1 year ago

Description of changes: Our current crash handler unintentionally catches crashes from other Python libraries that utilize native code. The stacktrace dumped by the crash handler makes it look like our fault as it contains PyInt_init calls at the top of the stack trace. These calls, in reality, are simply function calls made to print the stack trace and printed as PyInt_init in release mode. To address this, this PR alters the crash handler to be an opt-in feature, disabling its automatic registration. Users can enable the crash handler by setting an env variable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.