Running santizers (ubsan, asan, etc) on python code containing C++ wrapped by pybind11

512 Views Asked by At

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++?

0

There are 0 best solutions below