[issue36253] Use after free in ctypes test suite

Ben Harper report at bugs.python.org
Sat Mar 9 19:08:40 EST 2019


New submission from Ben Harper <btharper1221 at gmail.com>:

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

----------
components: Tests, ctypes
files: asan StringPtrTestCase.txt
messages: 337583
nosy: btharper
priority: normal
severity: normal
status: open
title: Use after free in ctypes test suite
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48202/asan StringPtrTestCase.txt

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36253>
_______________________________________


More information about the Python-bugs-list mailing list