[Python-Dev] refleaks & test_tcl & threads

Thomas Wouters thomas at python.org
Sun Apr 16 18:10:09 CEST 2006


On my box, the latest batch of refleak fixes seems to have fixed all but one
of the leaky tests. test_threading_local still leaks, but it leaks rather
consistently now (which is new.) I'm not able to make the other ones leak
with any combination of '-u<resource>' or removing .pyc's beforehand or
running longer or shorter. I hope it's not just my box :-)

test_threading_local is not entirely consistent, but it looks a lot more
reliable on my box than on Neal's automated mails:

test_threading_local
beginning 11 repetitions
12345678901
...........
test_threading_local leaked [34, 34, 34, 34, 34, 26, 26, 22, 34] references

One remaining issue with refleakhunting on my machine is that test_tcl can't
stand being run twice. Even without -R, this makes Python hang while waiting
for a mutex in the second run through test_tcl:

...trunk $ ./python -E -tt Lib/test/regrtest test_tcl test_tcl

Attaching gdb to the hung process shows this unenlightening trace:
#0  0x00002b7d6629514b in __lll_mutex_lock_wait () from /lib/libpthread.so.0
#1  0x00002b7d6639a280 in completed.4801 () from /lib/libpthread.so.0
#2  0x0000000000000004 in ?? ()
#3  0x00002b7d66291dca in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x0000000000000000 in ?? ()

The process has one other thread, which is stuck here:
#0  0x00002b7d667f14d6 in __select_nocancel () from /lib/libc.so.6
#1  0x00002b7d67512d8c in Tcl_WaitForEvent () from /usr/lib/libtcl8.4.so.0
#2  0x00002b7d66290b1c in start_thread () from /lib/libpthread.so.0
#3  0x00002b7d667f8962 in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

It smells like test_tcl or Tkinter is doing something wrong with regards to
threads. I can reproduce this on a few machines, but all of them run newish
linux kernels with newish glibc's and newish tcl/tk. At least in kernel/libc
land, various thread related things changed of late. I don't have access to
other machines with tcl/tk right now, but I wonder if anyone can reproduce
this in different situations.

--
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20060416/c815e197/attachment.html 


More information about the Python-Dev mailing list