When running the builtin test suite with address sanitizer enabled, one of the ctypes tests causes a use after free demonstrating the danger of using a reference to the inside of a deallocated buffer. This use is detected as an error by the address sanitizer and can be replicated with the following; a stack trace from the resulting failure is attached. export ASAN_OPTIONS="detect_leaks=0" make clean ./configure --with-address-sanitizer --with-pydebug make ./python Lib/ctypes/test/test_stringptr.py StringPtrTestCase -v