On Oct 26, 5:18 am, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> On Oct 25, 2007, at 7:46 PM, mabshoff wrote:
>
> > On Oct 25, 9:34 pm, Robert Bradshaw <[EMAIL PROTECTED]>
> > wrote:
> > Hi Robert,
>
> >> Try adding "--clean 2" to line 1008 of process_cython_file() in
> >> setup.py.
>
> > that doesn't work yet, because the parsing of the command line doesn't
> > seem to comprehend --clean yet, so I hardcoded the value I wanted for
> > now.
>
> Sorry, that should have been --cleanup 2, but hardcoding works too.
>
>
>
>
>
> > With n=2 I get the following which might be the cause for the memory
> > corruption:
>
> > ==14064== Invalid free() / delete / delete[]
> > ==14064==    at 0x4A1B74A: free (vg_replace_malloc.c:320)
> > ==14064==    by 0xB98B0D8:
> > __pyx_f_4sage_5rings_7integer_fast_tp_dealloc (integer.c:13607)
> > ==14064==    by 0x4B0022: collect (gcmodule.c:714)
> > ==14064==    by 0x4B0373: PyGC_Collect (gcmodule.c:1265)
> > ==14064==    by 0x4A612C: Py_Finalize (pythonrun.c:387)
> > ==14064==    by 0x4A5C7A: handle_system_exit (pythonrun.c:1616)
> > ==14064==    by 0x4A5E78: PyErr_PrintEx (pythonrun.c:1062)
> > ==14064==    by 0x4A6686: PyRun_SimpleFileExFlags (pythonrun.c:976)
> > ==14064==    by 0x412319: Py_Main (main.c:134)
> > ==14064==    by 0x4FD94C9: (below main) (in /lib/libc-2.3.6.so)
> > ==14064==  Address 0x73287d8 is 0 bytes inside a block of size 8
> > free'd
> > ==14064==    at 0x4A1B74A: free (vg_replace_malloc.c:320)
> > ==14064==    by 0xB98B0D8:
> > __pyx_f_4sage_5rings_7integer_fast_tp_dealloc (integer.c:13607)
> > ==14064==    by 0xB9847E2: cleanup (integer.c:15198)
> > ==14064==    by 0x415522: PyObject_Call (abstract.c:1860)
> > ==14064==    by 0x481ACA: PyEval_EvalFrameEx (ceval.c:3844)
> > ==14064==    by 0x484F3A: PyEval_EvalCodeEx (ceval.c:2831)
> > ==14064==    by 0x4CE527: function_call (funcobject.c:517)
> > ==14064==    by 0x415522: PyObject_Call (abstract.c:1860)
> > ==14064==    by 0x47C850: PyEval_CallObjectWithKeywords (ceval.c:3433)
> > ==14064==    by 0x4A60BC: Py_Finalize (pythonrun.c:1589)
> > ==14064==    by 0x4A5C7A: handle_system_exit (pythonrun.c:1616)
> > ==14064==    by 0x4A5E78: PyErr_PrintEx (pythonrun.c:1062)

Hello Robert,

>
> This last one might be due to funny stuff we do with the fast alloc/
> dealloc stuff. Try compiling just the integer file with --cleanup 1
> and see if that fixes it.

Yep, for n=2 and n=3 there isn't anything funny going on. Ironically
valgrind pretty much reports the same amount of still reachable
memory:

==17336== LEAK SUMMARY:
==17336==    definitely lost: 0 bytes in 0 blocks.
==17336==      possibly lost: 253,574 bytes in 633 blocks.
==17336==    still reachable: 36,239,900 bytes in 20,342 blocks.
==17336==         suppressed: 0 bytes in 0 blocks.


> Perhaps we could incref
> __pyx_v_4sage_5rings_7integer_global_dummy_Integer manually so it's
> never actually collected. Or it could be something more subtle.
>
> > Carl Witty was also wondering whether your new Cython.spkg was ready
> > for 2.8.10 or if we should wait.
>
> I believe so, it compiles all of SAGE and passes all doctests. Stefan
> (the other main Cython guy) is having trouble getting his code to
> work though.
>

ok.

One more thing: I compiled python --pydebug and I get the following
crash related to nteger_fast_tp_dealloc, so it seems that something
very odd is going on there:

----------------------------------------------------------------------
| SAGE Version 2.8.9.alpha0, Release Date: 2007-10-23                |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage:
Exiting SAGE (CPU time 0m0.07s, Wall time 0m2.15s).

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208604992 (LWP 20053)]
0x0078341b in free () from /lib/libc.so.6
(gdb) bt
#0  0x0078341b in free () from /lib/libc.so.6
#1  0x00ea2f38 in __pyx_f_7integer_fast_tp_dealloc
(__pyx_v_o=0x91c046c) at sage/rings/integer.c:15544
#2  0x08083bdf in dict_dealloc (mp=0x91b7334) at Objects/dictobject.c:
847
#3  0x08083bdf in dict_dealloc (mp=0x8cf7474) at Objects/dictobject.c:
847
#4  0x080d9659 in _PyImport_Fini () at Python/import.c:229
#5  0x080e4da4 in Py_Finalize () at Python/pythonrun.c:419
#6  0x080e48ea in handle_system_exit () at Python/pythonrun.c:1616
#7  0x080e4ae5 in PyErr_PrintEx (set_sys_last_vars=1) at Python/
pythonrun.c:1062
#8  0x080e5303 in PyRun_SimpleFileExFlags (fp=0x0,
    filename=0xbfa27cb3 "/tmp/Work/sage-2.8.9.rc1/local/bin/sage-gdb-
pythonstartup", closeit=0, flags=0xbfa268e8)
    at Python/pythonrun.c:976
#9  0x080571a6 in Py_Main (argc=0, argv=0xbfa269b4) at Modules/main.c:
134
#10 0x08056432 in main (argc=Cannot access memory at address 0x1
) at ./Modules/python.c:23
(gdb) quit

I will try with a "clean build" to see if I can get to the bottom of
this.

Cheers,

Michael

> - Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to