You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
roll_median_c and roll_quantile reassign but don't destroy their skiplist pointers when the indices are non-monotonic. skiplist_destroy should be called before skiplist_init. It might also be worth considering adding a reset() function to the skiplist to avoid unnecessary reallocations. But, since these extra allocations currently happen anyways it's probably better to just add the destroy() call first.
==184879==
==184879== 0 bytes in 1 blocks are indirectly lost in loss record 1 of 1,913
==184879== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==184879== by 0x168B8745: node_init (skiplist.h:69)
==184879== by 0x168B8745: skiplist_init(int) (skiplist.h:129)
==184879== by 0x168D3F1B: __pyx_pf_6pandas_5_libs_6window_12aggregations_10roll_median_c (aggregations.cpp:9332)
==184879== by 0x168D3F1B: __pyx_pw_6pandas_5_libs_6window_12aggregations_11roll_median_c(_object*, _object*, _object*) (aggregations.cpp:9050)
==184879== by 0x526878: ??? (in /usr/bin/python3.9)
==184879== by 0x629E37: _PyObject_Call (in /usr/bin/python3.9)
==184879== by 0x59F7D5: _PyEval_EvalFrameDefault (in /usr/bin/python3.9)
==184879== by 0x59734D: ??? (in /usr/bin/python3.9)
==184879== by 0x62C5F3: _PyFunction_Vectorcall (in /usr/bin/python3.9)
==184879== by 0x599266: _PyEval_EvalFrameDefault (in /usr/bin/python3.9)
==184879== by 0x59734D: ??? (in /usr/bin/python3.9)
==184879== by 0x62C5F3: _PyFunction_Vectorcall (in /usr/bin/python3.9)
==184879== by 0x599266: _PyEval_EvalFrameDefault (in /usr/bin/python3.9)
==184879==
==184879== 0 bytes in 1 blocks are indirectly lost in loss record 2 of 1,913
==184879== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==184879== by 0x168B8750: node_init (skiplist.h:70)
==184879== by 0x168B8750: skiplist_init(int) (skiplist.h:129)
==184879== by 0x168D3F1B: __pyx_pf_6pandas_5_libs_6window_12aggregations_10roll_median_c (aggregations.cpp:9332)
==184879== by 0x168D3F1B: __pyx_pw_6pandas_5_libs_6window_12aggregations_11roll_median_c(_object*, _object*, _object*) (aggregations.cpp:9050)
==184879== by 0x526878: ??? (in /usr/bin/python3.9)
==184879== by 0x629E37: _PyObject_Call (in /usr/bin/python3.9)
==184879== by 0x59F7D5: _PyEval_EvalFrameDefault (in /usr/bin/python3.9)
==184879== by 0x59734D: ??? (in /usr/bin/python3.9)
==184879== by 0x62C5F3: _PyFunction_Vectorcall (in /usr/bin/python3.9)
==184879== by 0x599266: _PyEval_EvalFrameDefault (in /usr/bin/python3.9)
==184879== by 0x59734D: ??? (in /usr/bin/python3.9)
==184879== by 0x62C5F3: _PyFunction_Vectorcall (in /usr/bin/python3.9)
==184879== by 0x599266: _PyEval_EvalFrameDefault (in /usr/bin/python3.9)
==184879==
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
running the
test_rolling_non_monotonic
test with the following addition triggers the leakdiscovered in #43338
Problem description
roll_median_c
androll_quantile
reassign but don't destroy their skiplist pointers when the indices are non-monotonic.skiplist_destroy
should be called beforeskiplist_init
. It might also be worth considering adding areset()
function to the skiplist to avoid unnecessary reallocations. But, since these extra allocations currently happen anyways it's probably better to just add the destroy() call first.Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: