#4155: [with patch, positive review] Speed up totally real field enumeration
code
---------------------------+------------------------------------------------
Reporter: craigcitro | Owner: craigcitro
Type: defect | Status: assigned
Priority: major | Milestone: sage-3.1.3
Component: number theory | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by mabshoff):
Oops: While valgrinding totallyreal.py I saw this:
{{{
==16950== More than 10000000 total errors detected. I'm not reporting any
more.
==16950== Final error counts will be inaccurate. Go fix your program!
==16950== Rerun with --error-limit=no to disable this cutoff. Note
==16950== that errors may occur in your program without prior warning from
==16950== Valgrind, because errors are no longer being displayed.
}}}
Those are the issues:
{{{
==16950== Conditional jump or move depends on uninitialised value(s)
==16950== at 0x12A60CC6:
__pyx_f_4sage_5rings_12number_field_16totallyreal_data_7tr_data_incr
(totallyreal_data.c:5532)
==16950== by 0x12932601:
__pyx_pf_4sage_5rings_12number_field_11totallyreal_enumerate_totallyreal_fields_prim
(totallyreal.c:3205)
==16950== by 0x483E46: PyEval_EvalFrameEx (ceval.c:3573)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x484AF1: PyEval_EvalFrameEx (ceval.c:494)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x486051: PyEval_EvalCode (ceval.c:494)
==16950== by 0x4A751D: PyRun_FileExFlags (pythonrun.c:1273)
==16950== by 0x4A77AF: PyRun_SimpleFileExFlags (pythonrun.c:879)
==16950== by 0x41215F: Py_Main (main.c:523)
==16950== by 0x4FD94C9: (below main) (in /lib/libc-2.3.6.so)
}}}
{{{
==16950== Invalid read of size 8
==16950== at 0x12A55392:
__pyx_f_4sage_5rings_12number_field_16totallyreal_data_lagrange_degree_3
(totallyreal_data.c:2713)
==16950== by 0x12A63665:
__pyx_f_4sage_5rings_12number_field_16totallyreal_data_7tr_data_incr
(totallyreal_data.c:5727)
==16950== by 0x12932601:
__pyx_pf_4sage_5rings_12number_field_11totallyreal_enumerate_totallyreal_fields_prim
(totallyreal.c:3205)
==16950== by 0x483E46: PyEval_EvalFrameEx (ceval.c:3573)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x484AF1: PyEval_EvalFrameEx (ceval.c:494)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x486051: PyEval_EvalCode (ceval.c:494)
==16950== by 0x4A751D: PyRun_FileExFlags (pythonrun.c:1273)
==16950== by 0x4A77AF: PyRun_SimpleFileExFlags (pythonrun.c:879)
==16950== by 0x41215F: Py_Main (main.c:523)
==16950== by 0x4FD94C9: (below main) (in /lib/libc-2.3.6.so)
==16950== Address 0x19ae0cd8 is 8 bytes after a block of size 96 alloc'd
==16950== at 0x4A1BE1B: malloc (vg_replace_malloc.c:207)
==16950== by 0x12B9694A: PyArray_NewFromDescr (arrayobject.c:5626)
==16950== by 0x12BC1842: PyArray_Concatenate (multiarraymodule.c:1834)
==16950== by 0x12BC134C: PyArray_Concatenate (multiarraymodule.c:1733)
==16950== by 0x12BC19DF: array_concatenate (multiarraymodule.c:6701)
==16950== by 0x483E46: PyEval_EvalFrameEx (ceval.c:3573)
==16950== by 0x48491B: PyEval_EvalFrameEx (ceval.c:3659)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x4CF3F7: function_call (funcobject.c:517)
==16950== by 0x415832: PyObject_Call (abstract.c:1861)
==16950== by 0x12A55233:
__pyx_f_4sage_5rings_12number_field_16totallyreal_data_lagrange_degree_3
(totallyreal_data.c:2668)
==16950== by 0x12A63665:
__pyx_f_4sage_5rings_12number_field_16totallyreal_data_7tr_data_incr
(totallyreal_data.c:5727)
==16950== by 0x12932601:
__pyx_pf_4sage_5rings_12number_field_11totallyreal_enumerate_totallyreal_fields_prim
(totallyreal.c:3205)
==16950== by 0x483E46: PyEval_EvalFrameEx (ceval.c:3573)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x484AF1: PyEval_EvalFrameEx (ceval.c:494)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x486051: PyEval_EvalCode (ceval.c:494)
==16950== by 0x4A751D: PyRun_FileExFlags (pythonrun.c:1273)
}}}
{{{
==16950== Conditional jump or move depends on uninitialised value(s)
==16950== at 0x4E524E3: ceil (in /lib/libm-2.3.6.so)
==16950== by 0x12A61046:
__pyx_f_4sage_5rings_12number_field_16totallyreal_data_7tr_data_incr
(totallyreal_data.c:6141)
==16950== by 0x12932601:
__pyx_pf_4sage_5rings_12number_field_11totallyreal_enumerate_totallyreal_fields_prim
(totallyreal.c:3205)
==16950== by 0x483E46: PyEval_EvalFrameEx (ceval.c:3573)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x484AF1: PyEval_EvalFrameEx (ceval.c:494)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x483F76: PyEval_EvalFrameEx (ceval.c:3669)
==16950== by 0x485DB1: PyEval_EvalCodeEx (ceval.c:2836)
==16950== by 0x486051: PyEval_EvalCode (ceval.c:494)
==16950== by 0x4A751D: PyRun_FileExFlags (pythonrun.c:1273)
==16950== by 0x4A77AF: PyRun_SimpleFileExFlags (pythonrun.c:879)
==16950== by 0x41215F: Py_Main (main.c:523)
==16950== by 0x4FD94C9: (below main) (in /lib/libc-2.3.6.so)
}}}
There are more, but you get the idea. I will poke around.
It seems that there are no memory leaks in the code as far as I know, but
one valgrind tests is still running.
Cheers,
Michael
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4155#comment:6>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---