• Kirill Smelkov's avatar
    bigfile/py/loadblk: Replace pybuf with a stub object in calling frame in case it stays alive · 61b18a40
    Kirill Smelkov authored
    It turns out some code wants to store tracebacks e.g. for further
    logging/whatever. This way GC won't help to free up references to pybuf.
    However if pybuf remain referenced only from calling frames, we can
    change there reference to pybuf to a stub object "<pybuf>" and this way
    remove the reference.
    
    With added test but without loadblk changes the failure would be as:
    
        pybigfile_loadblk WARN: pybuf->ob_refcnt != 1 even after GC:
        pybuf (ob_refcnt=2):    <read-write buffer ptr 0x7fae4911f000, size 2097152 at 0x7fae4998cef0>
        pybuf referrers:        [<frame object at 0x556daff41aa0>]		<-- NOTE
        bigfile/_bigfile.c:613 pybigfile_loadblk        BUG!
    61b18a40
Name
Last commit
Last update
3rdparty Loading commit data...
bigarray Loading commit data...
bigfile Loading commit data...
demo Loading commit data...
include/wendelin Loading commit data...
lib Loading commit data...
t Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
CHANGELOG.rst Loading commit data...
COPYING Loading commit data...
Makefile Loading commit data...
README.rst Loading commit data...
setup.py Loading commit data...
tox.ini Loading commit data...
wendelin.py Loading commit data...