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

valgrind detects problems in PyObject_Free #43251

Closed
jtajta2002 mannequin opened this issue Apr 19, 2006 · 2 comments
Closed

valgrind detects problems in PyObject_Free #43251

jtajta2002 mannequin opened this issue Apr 19, 2006 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@jtajta2002
Copy link
Mannequin

jtajta2002 mannequin commented Apr 19, 2006

BPO 1473000

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2006-04-21.03:59:32.000>
created_at = <Date 2006-04-19.14:12:46.000>
labels = ['interpreter-core', 'invalid']
title = 'valgrind detects problems in PyObject_Free'
updated_at = <Date 2006-04-21.03:59:32.000>
user = 'https://bugs.python.org/jtajta2002'

bugs.python.org fields:

activity = <Date 2006-04-21.03:59:32.000>
actor = 'nnorwitz'
assignee = 'nnorwitz'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2006-04-19.14:12:46.000>
creator = 'jtajta2002'
dependencies = []
files = []
hgrepos = []
issue_num = 1473000
keywords = []
message_count = 2.0
messages = ['28310', '28311']
nosy_count = 2.0
nosy_names = ['nnorwitz', 'jtajta2002']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1473000'
versions = ['Python 2.4']

@jtajta2002
Copy link
Mannequin Author

jtajta2002 mannequin commented Apr 19, 2006

I just compiled python 2.4.3 with gcc 4.1.0, using
glibc-2.4, and the COPTS = -g -O2

I just run valgrind (version 3.1.1) python -v
And I get a lot of errors complaying about PyObject_Free:

Conditional jump or move depends on uninitialised value(s)
at 0x40B66A4: PyObject_Free (obmalloc.c:735)
by 0x40B1E71: dictresize (dictobject.c:495)
by 0x40B204D: PyDict_SetItemString (dictobject.c:1988)
by 0x41048E3: Py_InitModule4 (modsupport.c:82)
by 0x4116364: initposix (posixmodule.c:7895)
by 0x40FF281: init_builtin (import.c:1765)
by 0x40FF511: load_module (import.c:1694)
by 0x40FFB3F: import_submodule (import.c:2266)
by 0x40FFFEE: load_next (import.c:2086)
by 0x41001D6: PyImport_ImportModuleEx (import.c:1921)
by 0x40E23AD: builtin___import__ (bltinmodule.c:45)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)
------------------------
Invalid read of size 4
at 0x40B669F: PyObject_Free (obmalloc.c:735)
by 0x4103B7E: PyMarshal_ReadLastObjectFromFile
(marshal.c:768)
by 0x40FCE53: read_compiled_module (import.c:723)
by 0x40FED89: load_source_module (import.c:891)
by 0x40FFB3F: import_submodule (import.c:2266)
by 0x40FFFEE: load_next (import.c:2086)
by 0x41001D6: PyImport_ImportModuleEx (import.c:1921)
by 0x40E23AD: builtin___import__ (bltinmodule.c:45)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)
by 0x408BB36: PyObject_Call (abstract.c:1795)
by 0x40E580A: PyEval_CallObjectWithKeywords
(ceval.c:3430)
by 0x40E87D1: PyEval_EvalFrame (ceval.c:2020)
Address 0x4339010 is 232 bytes inside a block of size
352 free'd
at 0x4022E9D: free (vg_replace_malloc.c:235)
by 0x41FBD1B: __fopen_internal (in /lib/libc-2.4.so)
by 0x41FE569: fopen64 (in /lib/libc-2.4.so)
by 0x40FD626: find_module (import.c:1316)
by 0x40FFC64: import_submodule (import.c:2256)
by 0x40FFFEE: load_next (import.c:2086)
by 0x41001D6: PyImport_ImportModuleEx (import.c:1921)
by 0x40E23AD: builtin___import__ (bltinmodule.c:45)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)
by 0x408BB36: PyObject_Call (abstract.c:1795)
by 0x40E580A: PyEval_CallObjectWithKeywords
(ceval.c:3430)
by 0x40E87D1: PyEval_EvalFrame (ceval.c:2020)
---------------------

Invalid read of size 4
at 0x40B669F: PyObject_Free (obmalloc.c:735)
by 0x4085A12: PyGrammar_RemoveAccelerators
(acceler.c:47)
by 0x41070DC: Py_Finalize (pythonrun.c:436)
by 0x410E2C4: Py_Main (main.c:513)
by 0x8048559: main (in /usr/bin/python)
Address 0x4364010 is 104 bytes inside a block of size
640 free'd
at 0x4022E9D: free (vg_replace_malloc.c:235)
by 0x40B66C0: PyObject_Free (obmalloc.c:798)
by 0x4085BA1: PyGrammar_AddAccelerators (acceler.c:124)
by 0x40866A7: PyParser_New (parser.c:77)
by 0x4086722: parsetok (parsetok.c:109)
by 0x4086C9E: PyParser_ParseStringFlags (parsetok.c:31)
by 0x4105FF3: PyParser_SimpleParseStringFlags
(pythonrun.c:1365)
by 0x410644A: PyRun_StringFlags (pythonrun.c:1222)
by 0x40E1CBA: builtin_eval (bltinmodule.c:527)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)
by 0x40EAE9B: PyEval_EvalFrame (ceval.c:3563)
by 0x40EA6AA: PyEval_EvalFrame (ceval.c:3645)

--------------

ERROR SUMMARY: 9678 errors from 111 contexts
(suppressed: 36 from 1)
malloc/free: in use at exit: 715,180 bytes in 251 blocks.
malloc/free: 1,822 allocs, 1,571 frees, 1,552,763 bytes
allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 251 not-freed blocks.
checked 664,740 bytes.

LEAK SUMMARY:
definitely lost: 10 bytes in 2 blocks.
possibly lost: 0 bytes in 0 blocks.
still reachable: 715,170 bytes in 249 blocks.
suppressed: 0 bytes in 0 blocks.

Best regards and many thanks for such an incredible
language.

@jtajta2002 jtajta2002 mannequin closed this as completed Apr 19, 2006
@jtajta2002 jtajta2002 mannequin added the invalid label Apr 19, 2006
@jtajta2002 jtajta2002 mannequin assigned nnorwitz Apr 19, 2006
@jtajta2002 jtajta2002 mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 19, 2006
@jtajta2002 jtajta2002 mannequin closed this as completed Apr 19, 2006
@jtajta2002 jtajta2002 mannequin added the invalid label Apr 19, 2006
@jtajta2002 jtajta2002 mannequin assigned nnorwitz Apr 19, 2006
@jtajta2002 jtajta2002 mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 19, 2006
@nnorwitz
Copy link
Mannequin

nnorwitz mannequin commented Apr 21, 2006

Logged In: YES
user_id=33168

Please read this file:
http://svn.python.org/projects/python/branches/release24-maint/Misc/README.valgrind

That should explain what's going on and how to fix it.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

0 participants