[AstroPy] Curious bug in Pywcs?

Nicolas Gaudin nicolas-gaudin at laposte.net
Wed Sep 7 04:19:42 EDT 2011


Thank you for your tests.

I was at home, with packages from debian testing (python 2.6 and 
matplotlib-1.0.1-3) and I reproduce the bug. I use Qt4Agg. Indeed, GTKAgg 
reproduces the bug but Agg and TkAgg don't. So, I will switch to another 
backend.

The output of Valgrind is verbose, I will print only the last lines. I've used 
the option --leak-check=full.

For a working backend (TkAgg):

[...]
==15463== 786,432 bytes in 3 blocks are still reachable in loss record 2,167 
of 2,169
==15463==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
x86-linux.so)
==15463==    by 0x8096176: PyObject_Malloc (in /usr/bin/python2.6)
==15463==    by 0x809652F: PyObject_Realloc (in /usr/bin/python2.6)
==15463==    by 0x8157AA4: PyNode_AddChild (in /usr/bin/python2.6)
==15463==    by 0x8157EBE: PyParser_AddToken (in /usr/bin/python2.6)
==15463==    by 0x805E81E: ??? (in /usr/bin/python2.6)
==15463==    by 0x80FAE9E: PyParser_ASTFromFile (in /usr/bin/python2.6)
==15463==    by 0x80F0321: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F1520: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F179F: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F1D75: ??? (in /usr/bin/python2.6)
==15463==    by 0x8269003: ??? (in /usr/bin/python2.6)
==15463== 
==15463== 786,432 bytes in 3 blocks are still reachable in loss record 2,168 
of 2,169
==15463==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
x86-linux.so)
==15463==    by 0x8096176: PyObject_Malloc (in /usr/bin/python2.6)
==15463==    by 0x805E7CA: ??? (in /usr/bin/python2.6)
==15463==    by 0x80FAE9E: PyParser_ASTFromFile (in /usr/bin/python2.6)
==15463==    by 0x80F0321: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F1520: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F179F: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F1D75: ??? (in /usr/bin/python2.6)
==15463==    by 0x8269003: ??? (in /usr/bin/python2.6)
==15463== 
==15463== 1,048,576 bytes in 4 blocks are still reachable in loss record 2,169 
of 2,169
==15463==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
x86-linux.so)
==15463==    by 0x8096176: PyObject_Malloc (in /usr/bin/python2.6)
==15463==    by 0x8157AA4: PyNode_AddChild (in /usr/bin/python2.6)
==15463==    by 0x8157EBE: PyParser_AddToken (in /usr/bin/python2.6)
==15463==    by 0x805E81E: ??? (in /usr/bin/python2.6)
==15463==    by 0x80FAE9E: PyParser_ASTFromFile (in /usr/bin/python2.6)
==15463==    by 0x80F0321: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F1520: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F179F: ??? (in /usr/bin/python2.6)
==15463==    by 0x80F1D75: ??? (in /usr/bin/python2.6)
==15463==    by 0x8269003: ??? (in /usr/bin/python2.6)
==15463== 
==15463== LEAK SUMMARY:
==15463==    definitely lost: 772 bytes in 10 blocks
==15463==    indirectly lost: 860 bytes in 46 blocks
==15463==      possibly lost: 1,524,749 bytes in 676 blocks
==15463==    still reachable: 11,457,411 bytes in 9,550 blocks
==15463==         suppressed: 0 bytes in 0 blocks
==15463== 
==15463== For counts of detected and suppressed errors, rerun with: -v
==15463== Use --track-origins=yes to see where uninitialised values come from
==15463== ERROR SUMMARY: 13488 errors from 605 contexts (suppressed: 266 from 
12)

And with Qt4Agg:

[...]
==15478== 786,432 bytes in 3 blocks are still reachable in loss record 2,585 
of 2,588
==15478==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
x86-linux.so)
==15478==    by 0x8096176: PyObject_Malloc (in /usr/bin/python2.6)
==15478==    by 0x805E7CA: ??? (in /usr/bin/python2.6)
==15478==    by 0x80FAE9E: PyParser_ASTFromFile (in /usr/bin/python2.6)
==15478==    by 0x80F0321: ??? (in /usr/bin/python2.6)
==15478==    by 0x80F1520: ??? (in /usr/bin/python2.6)
==15478==    by 0x80F179F: ??? (in /usr/bin/python2.6)
==15478==    by 0x80F1D75: ??? (in /usr/bin/python2.6)
==15478==    by 0x8269003: ??? (in /usr/bin/python2.6)
==15478== 
==15478== 1,001,096 bytes in 1 blocks are possibly lost in loss record 2,586 
of 2,588
==15478==    at 0x4024604: operator new[](unsigned int) (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==15478==    by 0x7FED313: RendererAgg::RendererAgg(unsigned int, unsigned 
int, double, int) (in 
/usr/lib/pyshared/python2.6/matplotlib/backends/_backend_agg.so)
==15478==    by 0x3801573F: ??? (in /usr/lib/valgrind/memcheck-x86-linux)
==15478== 
==15478== 1,048,576 bytes in 4 blocks are still reachable in loss record 2,587 
of 2,588
==15478==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
x86-linux.so)
==15478==    by 0x8096176: PyObject_Malloc (in /usr/bin/python2.6)
==15478==    by 0x8157AA4: PyNode_AddChild (in /usr/bin/python2.6)
==15478==    by 0x8157EBE: PyParser_AddToken (in /usr/bin/python2.6)
==15478==    by 0x805E81E: ??? (in /usr/bin/python2.6)
==15478==    by 0x80FAE9E: PyParser_ASTFromFile (in /usr/bin/python2.6)
==15478==    by 0x80F0321: ??? (in /usr/bin/python2.6)
==15478==    by 0x80F1520: ??? (in /usr/bin/python2.6)
==15478==    by 0x80F179F: ??? (in /usr/bin/python2.6)
==15478==    by 0x80F1D75: ??? (in /usr/bin/python2.6)
==15478==    by 0x8269003: ??? (in /usr/bin/python2.6)
==15478== 
==15478== 1,572,864 bytes in 1 blocks are still reachable in loss record 2,588 
of 2,588
==15478==    at 0x4025018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
x86-linux.so)
==15478==    by 0x808E8E3: ??? (in /usr/bin/python2.6)
==15478==    by 0x809E61A: PyString_InternInPlace (in /usr/bin/python2.6)
==15478==    by 0x80921C2: PyDict_SetItemString (in /usr/bin/python2.6)
==15478==    by 0xA2A8ACD: ??? (in /usr/lib/python2.6/dist-packages/sip.so)
==15478==    by 0xA2A8E9E: ??? (in /usr/lib/python2.6/dist-packages/sip.so)
==15478==    by 0xA2A8FF4: ??? (in /usr/lib/python2.6/dist-packages/sip.so)
==15478==    by 0x80D7035: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==15478==    by 0x80DBB26: PyEval_EvalCodeEx (in /usr/bin/python2.6)
==15478==    by 0x80DBC36: PyEval_EvalCode (in /usr/bin/python2.6)
==15478==    by 0x80F0128: PyImport_ExecCodeModuleEx (in /usr/bin/python2.6)
==15478==    by 0x80F047B: ??? (in /usr/bin/python2.6)
==15478== 
==15478== LEAK SUMMARY:
==15478==    definitely lost: 700 bytes in 12 blocks
==15478==    indirectly lost: 766 bytes in 34 blocks
==15478==      possibly lost: 1,368,637 bytes in 644 blocks
==15478==    still reachable: 12,846,296 bytes in 12,562 blocks
==15478==         suppressed: 0 bytes in 0 blocks
==15478== 
==15478== For counts of detected and suppressed errors, rerun with: -v
==15478== Use --track-origins=yes to see where uninitialised values come from
==15478== ERROR SUMMARY: 13064 errors from 570 contexts (suppressed: 686 from 
12)



More information about the AstroPy mailing list