#14059: Fix refcount/deallocation of integers
-----------------------------+----------------------------------------------
Reporter: SimonKing | Owner: rlm
Type: defect | Status: new
Priority: blocker | Milestone: sage-5.7
Component: memleak | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-----------------------------+----------------------------------------------
Comment (by SimonKing):
The same with sage -gdb yields
{{{
sage:
Exiting Sage (CPU time 0m2.67s, Wall time 0m27.17s).
[Thread 0x7fffef932700 (LWP 29861) exited]
Debug memory block at address p=0x1c817e0: API '�'
18302628885633695743 bytes originally requested
The 7 pad bytes at p-7 are not all FORBIDDENBYTE (0xfb):
at p-7: 0xcb *** OUCH
at p-6: 0xcb *** OUCH
at p-5: 0xcb *** OUCH
at p-4: 0xcb *** OUCH
at p-3: 0xcb *** OUCH
at p-2: 0xcb *** OUCH
at p-1: 0xcb *** OUCH
Because memory is corrupted at the start, the count of bytes requested
may be bogus, and checking the trailing pad bytes may segfault.
The 8 pad bytes at tail=0xfe00000001c817df are
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7a29ebe in _PyObject_DebugDumpAddress (p=0x1c817e0) at
Objects/obmalloc.c:1649
1649 Objects/obmalloc.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007ffff7a29ebe in _PyObject_DebugDumpAddress (p=0x1c817e0) at
Objects/obmalloc.c:1649
#1 0x00007ffff7a29c1e in _PyObject_DebugCheckAddressApi (api=111 'o',
p=0x1c817e0) at Objects/obmalloc.c:1590
#2 0x00007ffff7a298de in _PyObject_DebugFreeApi (api=111 'o',
p=0x1c817e0) at Objects/obmalloc.c:1478
#3 0x00007ffff7a2978a in _PyObject_DebugFree (p=0x1c817e0) at
Objects/obmalloc.c:1422
#4 0x00007fffe4a40292 in __pyx_f_4sage_5rings_7integer_fast_tp_dealloc
(__pyx_v_o=<sage.rings.integer.Integer at remote 0x1c817e0>) at
sage/rings/integer.c:35775
#5 0x00007ffff7a27be4 in _Py_Dealloc (op=<sage.rings.integer.Integer at
remote 0x1c817e0>) at Objects/object.c:2243
#6 0x00007ffff7a18e8e in dict_dealloc (mp=
{'gmp_randrange': <built-in method gmp_randrange of
builtin_function_or_method object at remote 0x239aba0>, 'LCM_list':
<built-in method LCM_list of builtin_function_or_method object at remote
0x1b23c18>, '_test_mpz_set_longlong': <built-in method
_test_mpz_set_longlong of builtin_function_or_method object at remote
0x1b16d08>, 'initialized': False, 'operator': <module at remote 0x8a7f68>,
'make_integer': <built-in method make_integer of
builtin_function_or_method object at remote 0x1c8b588>, '__package__':
<unknown at remote 0x1b1cdc0>, 'IntegerWrapper': <type
sage.rings.integer.IntegerWrapper at remote 0x7fffe4c74d20>,
'CoercionException': <type CoercionException at remote 0x16d53e0>, 'ONE':
<sage.rings.integer.Integer at remote 0x1c817e0>, 'clear_mpz_globals':
<built-in function clear_mpz_globals>, '__pyx_capi__': {'smallInteger':
<PyCapsule at remote 0x1a2bac0>}, 'integer_ring': <module at remote
0x1b30e30>, 'Integer': <type sage.rings.integer.Integer at remote
0x7fffe4c74980>, '__doc__': "File: sage/ring...(truncated)) at
Objects/dictobject.c:985
#7 0x00007ffff7a27be4 in _Py_Dealloc (op=
{'gmp_randrange': <built-in method gmp_randrange of
builtin_function_or_method object at remote 0x239aba0>, 'LCM_list':
<built-in method LCM_list of builtin_function_or_method object at remote
0x1b23c18>, '_test_mpz_set_longlong': <built-in method
_test_mpz_set_longlong of builtin_function_or_method object at remote
0x1b16d08>, 'initialized': False, 'operator': <module at remote 0x8a7f68>,
'make_integer': <built-in method make_integer of
builtin_function_or_method object at remote 0x1c8b588>, '__package__':
<unknown at remote 0x1b1cdc0>, 'IntegerWrapper': <type
sage.rings.integer.IntegerWrapper at remote 0x7fffe4c74d20>,
'CoercionException': <type CoercionException at remote 0x16d53e0>, 'ONE':
<sage.rings.integer.Integer at remote 0x1c817e0>, 'clear_mpz_globals':
<built-in function clear_mpz_globals>, '__pyx_capi__': {'smallInteger':
<PyCapsule at remote 0x1a2bac0>}, 'integer_ring': <module at remote
0x1b30e30>, 'Integer': <type sage.rings.integer.Integer at remote
0x7fffe4c74980>, '__doc__': "File: sage/ring...(truncated)) at
Objects/object.c:2243
#8 0x00007ffff7a18e8e in dict_dealloc (mp=
{<unknown at remote 0x23365b8>: <unknown at remote 0x237d650>,
<unknown at remote 0x26c1428>: <unknown at remote 0x26903a0>, <unknown at
remote 0x290b100>: <unknown at remote 0x293db00>, <unknown at remote
0x17865c0>: <unknown at remote 0x17b9b70>, <unknown at remote 0x2b92640>:
<unknown at remote 0x2caa5e0>, <unknown at remote 0x2413100>: <unknown at
remote 0x2407470>, <unknown at remote 0x2a67a50>: <unknown at remote
0x2a28140>, <unknown at remote 0x5d5eeb0>: <unknown at remote 0x5d9f410>,
<unknown at remote 0x13a78c8>: <unknown at remote 0x13ee740>, <unknown at
remote 0x2e0e880>: <unknown at remote 0x2e22b60>, <unknown at remote
0x24b2998>: <unknown at remote 0x2508e50>, <unknown at remote 0x2a67bc0>:
<unknown at remote 0x2a2b0c0>, <unknown at remote 0x2b924c0>: <unknown at
remote 0x2aec980>, <unknown at remote 0x3579040>: <unknown at remote
0x3522620>, 'gc': <unknown at remote 0x98eba0>, <unknown at remote
0x2b21998>: <unknown at remote 0x2ab35e0>, <unknown at remote 0x19483d8>:
<unknown at remote 0x197fd...(truncated)) at Objects/dictobject.c:985
#9 0x00007ffff7a27be4 in _Py_Dealloc (op=
{<unknown at remote 0x23365b8>: <unknown at remote 0x237d650>,
<unknown at remote 0x26c1428>: <unknown at remote 0x26903a0>, <unknown at
remote 0x290b100>: <unknown at remote 0x293db00>, <unknown at remote
0x17865c0>: <unknown at remote 0x17b9b70>, <unknown at remote 0x2b92640>:
<unknown at remote 0x2caa5e0>, <unknown at remote 0x2413100>: <unknown at
remote 0x2407470>, <unknown at remote 0x2a67a50>: <unknown at remote
0x2a28140>, <unknown at remote 0x5d5eeb0>: <unknown at remote 0x5d9f410>,
<unknown at remote 0x13a78c8>: <unknown at remote 0x13ee740>, <unknown at
remote 0x2e0e880>: <unknown at remote 0x2e22b60>, <unknown at remote
0x24b2998>: <unknown at remote 0x2508e50>, <unknown at remote 0x2a67bc0>:
<unknown at remote 0x2a2b0c0>, <unknown at remote 0x2b924c0>: <unknown at
remote 0x2aec980>, <unknown at remote 0x3579040>: <unknown at remote
0x3522620>, 'gc': <unknown at remote 0x98eba0>, <unknown at remote
0x2b21998>: <unknown at remote 0x2ab35e0>, <unknown at remote 0x19483d8>:
<unknown at remote 0x197fd...(truncated)) at Objects/object.c:2243
#10 0x00007ffff7ae1b45 in _PyImport_Fini () at Python/import.c:244
#11 0x00007ffff7af5b86 in Py_Finalize () at Python/pythonrun.c:470
#12 0x00007ffff7b1276b in Py_Main (argc=3, argv=0x7fffffffd168) at
Modules/main.c:664
#13 0x00000000004007b4 in main (argc=3, argv=0x7fffffffd168) at
./Modules/python.c:23
(gdb) q
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14059#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.