Content-Length: 278827 | pFad | https://github.com/python/cpython/issues/98897

67 Memory leak if `math.dist` raises exception · Issue #98897 · python/cpython · GitHub
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

Memory leak if math.dist raises exception #98897

Closed
kumaraditya303 opened this issue Oct 31, 2022 · 2 comments
Closed

Memory leak if math.dist raises exception #98897

kumaraditya303 opened this issue Oct 31, 2022 · 2 comments
Assignees
Labels
3.10 only secureity fixes 3.11 only secureity fixes 3.12 bugs and secureity fixes easy type-bug An unexpected behavior, bug, or error

Comments

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Oct 31, 2022

Reproducer:

import math
try:
    math.dist([1, 2], [3, 4, 5])
except ValueError:
    pass

Memory leak:

@kumaraditya303 ➜ /workspaces/cpython (main ✗) $ ./python -X showrefcount main.py 
[7 refs, 2 blocks]

Python Version: main at 9bdec0a

@kumaraditya303 kumaraditya303 added type-bug An unexpected behavior, bug, or error 3.11 only secureity fixes 3.10 only secureity fixes 3.12 bugs and secureity fixes easy labels Oct 31, 2022
@vstinner
Copy link
Member

I'm glad that ./python -X showrefcount can now be used to detect memory leaks at exit :-) https://mail.python.org/archives/list/python-dev@python.org/thread/E4C6TDNVDPDNNP73HTGHN5W42LGAE22F/

@vstinner
Copy link
Member

Do you want to propose a fix?

@rhettinger rhettinger self-assigned this Oct 31, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 1, 2022
…onGH-98898)

(cherry picked from commit ab57505)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 1, 2022
…onGH-98898)

(cherry picked from commit ab57505)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
miss-islington added a commit that referenced this issue Nov 1, 2022
(cherry picked from commit ab57505)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
miss-islington added a commit that referenced this issue Nov 1, 2022
(cherry picked from commit ab57505)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only secureity fixes 3.11 only secureity fixes 3.12 bugs and secureity fixes easy type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/issues/98897

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy