I maintain a large C++ library which I have partially exposed to python using pybind11. The C++ library contains unit test which I run sometimes under various sanitizers: asan, tsan, etc. These tests run cleanly, but of course tests aren't perfect and you can't test 100% of all edge cases.
There's a particular jupyter notebook that crashes when I use this library with a certain settings, a particular dataset, and various options which could be replicated in a pure C++ environment, but that replication would be very labor intensive, time consuming, and error prone.
IF I had pure C++ in front of me I would run the notebook through ubsan, asan, etc to make sure I'm not witnessing undefined behavior or a segfault. Is there a way I can apply these sanitizers (or something equivalent) to my notebook without rewriting all the python glue in raw C++?