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

"Use of uninitialised value of size 4" in pari.pyx #1001

Closed
sagetrac-mabshoff mannequin opened this issue Oct 26, 2007 · 3 comments
Closed

"Use of uninitialised value of size 4" in pari.pyx #1001

sagetrac-mabshoff mannequin opened this issue Oct 26, 2007 · 3 comments
Assignees

Comments

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Oct 26, 2007

Just by doing a sage start + immediate quit under valgrind leads to:

==12979== Conditional jump or move depends on uninitialised value(s)
==12979==    at 0x8088C18: PyObject_Free (obmalloc.c:920)
==12979==    by 0x8106892: code_dealloc (codeobject.c:270)
==12979==    by 0x810C769: frame_dealloc (frameobject.c:444)
==12979==    by 0x80EBB0B: tb_dealloc (traceback.c:34)
==12979==    by 0x5764226: __Pyx_GetExcValue (gen.c:30664)
==12979==    by 0x5788110: __pyx_f_py_3gen_12PariInstance___call__ (gen.c:23295)
==12979==    by 0x805A276: PyObject_Call (abstract.c:1860)
==12979==    by 0x80BE7CB: PyEval_CallObjectWithKeywords (ceval.c:3433)
==12979==    by 0x805A48F: PyObject_CallObject (abstract.c:1851)
==12979==    by 0x5791B62: __pyx_f_py_3gen_12PariInstance___init__ (gen.c:21789)
==12979==    by 0x809C412: type_call (typeobject.c:436)
==12979==    by 0x805A276: PyObject_Call (abstract.c:1860)
==12979==
==12979== Use of uninitialised value of size 4
==12979==    at 0x8088C23: PyObject_Free (obmalloc.c:920)
==12979==    by 0x8106892: code_dealloc (codeobject.c:270)
==12979==    by 0x810C769: frame_dealloc (frameobject.c:444)
==12979==    by 0x80EBB0B: tb_dealloc (traceback.c:34)
==12979==    by 0x5764226: __Pyx_GetExcValue (gen.c:30664)
==12979==    by 0x5788110: __pyx_f_py_3gen_12PariInstance___call__ (gen.c:23295)
==12979==    by 0x805A276: PyObject_Call (abstract.c:1860)
==12979==    by 0x80BE7CB: PyEval_CallObjectWithKeywords (ceval.c:3433)
==12979==    by 0x805A48F: PyObject_CallObject (abstract.c:1851)
==12979==    by 0x5791B62: __pyx_f_py_3gen_12PariInstance___init__ (gen.c:21789)
==12979==    by 0x809C412: type_call (typeobject.c:436)
==12979==    by 0x805A276: PyObject_Call (abstract.c:1860)

I tracked this down to gen.pyx:5566:

        self.ONE = self(1)

but I have no clue how to fix this.

Cheers,

Michael

Component: memleak

Issue created by migration from https://trac.sagemath.org/ticket/1001

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-2.8.10 milestone Oct 26, 2007
@sagetrac-mabshoff sagetrac-mabshoff mannequin added t: bug labels Oct 26, 2007
@craigcitro
Copy link
Member

comment:1

this is likely fixed by the fix for #875, since the offending line in gen.pyx has been changed.

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Oct 28, 2007
@sagetrac-mabshoff sagetrac-mabshoff mannequin removed this from the sage-2.8.10 milestone Oct 28, 2007
@sagetrac-mabshoff
Copy link
Mannequin Author

sagetrac-mabshoff mannequin commented Oct 28, 2007

comment:3
[07:35] <cwitty> Whenever you pass an address to PyObject_Free, it will read the first 4 bytes of the 4096-byte page containing that address.  If Python allocated that memory, then those 4 bytes will be valid to read.  But if the system malloc allocated them, then there may or may not be valid (according to valgrind) data there.
[07:35] <cwitty> It just depends on the particular history of allocations/frees in the program so far.

@sagetrac-cwitty
Copy link
Mannequin

sagetrac-cwitty mannequin commented Oct 28, 2007

comment:4

For more details, read the comment describing Py_ADDRESS_IN_RANGE, in Objects/obmalloc.c in the Python source code.

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

No branches or pull requests

2 participants