diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-12-29 06:58:09 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-12-29 06:58:09 -0500 |
commit | 246474f2fd7d4e2de09a0627341873aa0eb16059 (patch) | |
tree | b9bd9ade358425ff816027407134bacec9baac2a | |
parent | 639624108f5dd7748f5824d62470d7e0cc040d5b (diff) | |
download | python-coveragepy-git-246474f2fd7d4e2de09a0627341873aa0eb16059.tar.gz |
Prevent a hard crash when starting coverage thousands of times
-rw-r--r-- | CHANGES.rst | 4 | ||||
-rw-r--r-- | CONTRIBUTORS.txt | 1 | ||||
-rw-r--r-- | coverage/ctracer/tracer.c | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index d63388df..d502612a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,7 +9,9 @@ Change history for Coverage.py Unreleased ---------- -Nothing yet. +- If you started and stopped coverage measurement thousands of times in your + process, you could crash Python with a "Fatal Python error: deallocating + None" error. This is now fixed. Thanks to Alex Groce for the bug report. Version 4.3.1 --- 2016-12-28 diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index fbbef000..e293db77 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -6,6 +6,7 @@ useful bug reports, have been made by: Adi Roiban Alex Gaynor +Alex Groce Alexander Todorov Andrew Hoos Anthony Sottile diff --git a/coverage/ctracer/tracer.c b/coverage/ctracer/tracer.c index 8abb60a7..a5173270 100644 --- a/coverage/ctracer/tracer.c +++ b/coverage/ctracer/tracer.c @@ -74,6 +74,7 @@ CTracer_init(CTracer *self, PyObject *args_unused, PyObject *kwds_unused) self->cur_entry.last_line = -1; self->context = Py_None; + Py_INCREF(self->context); ret = RET_OK; goto ok; |