Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It seems there is a memory leak in pyexpand.c #84

Open
onriv opened this issue Nov 7, 2022 · 0 comments
Open

It seems there is a memory leak in pyexpand.c #84

onriv opened this issue Nov 7, 2022 · 0 comments

Comments

@onriv
Copy link

onriv commented Nov 7, 2022

Using valgrind to test the python api expand_address, I got a report:

==231== 51,166 bytes in 1,945 blocks are definitely lost in loss record 149 of 150
==231==    at 0x4C29F73: malloc (vg_replace_malloc.c:309)
==231==    by 0x59EBB89: strdup (in /usr/lib64/libc-2.17.so)
==231==    by 0x87EBD72: PyObject_to_string (pyutils.c:59)
==231==    by 0x87EB7CF: py_expand (pyexpand.c:120)
==231==    by 0x2D2077: cfunction_call_varargs (call.c:755)
==231==    by 0x2D2077: PyCFunction_Call (call.c:786)
==231==    by 0x2D2077: do_call_core (ceval.c:4641)
==231==    by 0x2D2077: _PyEval_EvalFrameDefault (ceval.c:3191)
==231==    by 0x220E84: PyEval_EvalFrameEx (ceval.c:547)
==231==    by 0x220E84: _PyEval_EvalCodeWithName (ceval.c:3930)
==231==    by 0x240CD2: _PyFunction_FastCallKeywords (call.c:433)
==231==    by 0x2CB394: call_function (ceval.c:4616)
==231==    by 0x2CB394: _PyEval_EvalFrameDefault (ceval.c:3124)
==231==    by 0x220E84: PyEval_EvalFrameEx (ceval.c:547)
==231==    by 0x220E84: _PyEval_EvalCodeWithName (ceval.c:3930)
==231==    by 0x222272: PyEval_EvalCodeEx (ceval.c:3959)
==231==    by 0x222272: PyEval_EvalCode (ceval.c:524)
==231==    by 0x32FC81: run_mod (pythonrun.c:1037)
==231==    by 0x339E1D: PyRun_FileExFlags (pythonrun.c:990)

Checking the source of function py_expand in pyexpand.c, line 120, it seems memory owning by the variable input is not freed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant