以下是我目前收集到的信息:
ntdll.dll!TpCallbackIndependent+0x238
ntdll.dll!RtlMoveMemory+x5a5
ntdll.dll
中的线程仍在运行,退出状态为1这个TpCallbackIndependent
的东西似乎与Windows Thread Pool API有关,这个应用程序使用的{a1}不是。如果对您有意义的话,我可以列出所有外部Python库,但我认为它们也没有使用它。在
编辑:可能的罪魁祸首是pycurl
模块。一旦我发出第一个pycurl.Curl.perform()
,RtlMoveMemory
和{pycurl.global_cleanup()
(此时mswsock
线程消失,RtlMoveMemory
线程永远不会完成,TpCallbackIndependent
也会虚假地出现并永远消失。在
pycurl.version
打印“libcurl/7.20.1openssl/0.9.8qzlib/1.2.5”,我不知道pycurl
的版本是什么(我只有.pyd
文件)。在
编辑:下面是一个创建有问题线程的示例Pycurl程序。出于某种原因我无法解释,这个特殊的调用并没有崩溃。。。在
import cStringIO
import pycurl
import sys
pycurl.global_init(pycurl.GLOBAL_DEFAULT)
try:
b = cStringIO.StringIO()
# Issue request.
c = pycurl.Curl()
try:
c.setopt(pycurl.CUSTOMREQUEST, 'GET')
c.setopt(c.URL, 'http://www.google.ca')
c.setopt(c.WRITEFUNCTION, b.write)
print 'Type anything to issue the request.'
sys.stdin.readline()
c.perform()
# Threads appear as a result of the `.perform()`
# operation. If you monitor the active threads
# in "process explorer", you see that the threads
# appear here.
finally:
c.close()
del c
finally:
print 'Type anything to cleanup.'
sys.stdin.readline()
pycurl.global_cleanup()
# If you're still looking at active threads in "process
# explorer", you see that some threads (the mswsock.dll
# thread in particular) have disappeared, but there are still
# weird TpCallbackIndependent threads showing up.
print 'Type anything to exit.'
sys.stdin.readline()
在调用cleanup之前,请确保所有pycurl对象都已关闭。这包括简单、共享和多对象。在
相关问题 更多 >
编程相关推荐