[AstroPy] Curious bug in Pywcs?

Michael Droettboom mdroe@stsci....
Wed Sep 7 16:12:49 CDT 2011


Curious.  Thanks for sending me the full valgrind log.

There is some curiousness -- it's trying to refree and already free'd 
Python object.  But it's not clear to me why.  And unfortunately, I'm 
still not able to reproduce here, so I'm rather stumped.

I have not tried python-2.6, as you're using here.  But I believe 
earlier you said you also experience this on python-2.7, so I don't want 
to go through the trouble of setting up a full Python 2.6 environment if 
that turns out to not be the missing variable.

I will think on this some more -- in the meantime I'm glad you've found 
a workaround, but it would also be nice to get to the bottom of the cause.

Mike

On 09/07/2011 10:21 AM, Michael Droettboom wrote:
> It's a helpful data point that some backends work while others don't,
> but frustratingly, I am still unable to reproduce this myself using the
> Qt4Agg or GtkAgg backends.
>
> Can you send the full valgrind log to me (off-list)?  There's nothing
> particularly special about the last entries -- it's more than likely the
> memory corruption occurs earlier than that.
>
> Mike
>
> On 09/07/2011 04:19 AM, Nicolas Gaudin wrote:
>> 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)
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy@scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy



More information about the AstroPy mailing list