20 ноября 2010 г. 13:05 пользователь Vitja Makarov
<[email protected]> написал:
> 20 ноября 2010 г. 12:43 пользователь Vitja Makarov
> <[email protected]> написал:
>> 19 ноября 2010 г. 18:36 пользователь Vitja Makarov
>> <[email protected]> написал:
>>> 19 ноября 2010 г. 10:27 пользователь Vitja Makarov
>>> <[email protected]> написал:
>>>> 2010/11/19 Stefan Behnel <[email protected]>:
>>>>> Vitja Makarov, 18.11.2010 22:54:
>>>>>> 2010/11/18 Stefan Behnel:
>>>>>>> Vitja Makarov, 18.11.2010 21:17:
>>>>>>>> 2010/11/18 Stefan Behnel:
>>>>>>>>> The C compiler problems looked like closure issues, so they are more 
>>>>>>>>> likely
>>>>>>>>> to be related.
>>>>>>>>
>>>>>>>> Is compile problem logged somewhere?
>>>>>>>
>>>>>>> You can find most of them here:
>>>>>>>
>>>>>>> https://sage.math.washington.edu:8091/hudson/job/cython-devel-tests-pyregr-py26-c/704/parsed_console/
>>>>>>>
>>>>>>> Look out for "has no member named".
>>>>>>
>>>>>> Disabling this tests seems to make regression tests finish up.
>>>>>>
>>>>>> pyregr.test_socket
>>>>>> pyregr.test_threading
>>>>>
>>>>> Ok, I disabled them.
>>>>>
>>>>> Stefan
>>>>> _______________________________________________
>>>>> Cython-dev mailing list
>>>>> [email protected]
>>>>> http://codespeak.net/mailman/listinfo/cython-dev
>>>>>
>>>>
>>>>
>>>> New patch fixes #537, where are all that gcc errors came from.
>>>> It seems that patch enable many new tests that break test runner
>>>> itself, in threads.
>>>>
>>>> With latest patch runtests couldn't exit because of thread lock
>>>> (join?), here is gdb traceback:
>>>> I don't know how to figure out which test causes this. Should we
>>>> disable some more thread-related tests.
>>>> Or as workaround use _exit() in testrunner
>>>>
>>>> (gdb) bt
>>>> #0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
>>>> #1  0x00000000004dcac8 in PyThread_acquire_lock (lock=0x6d43c60,
>>>> waitflag=128) at Python/thread_pthread.h:309
>>>> #2  0x00000000004e00d2 in lock_PyThread_acquire_lock (self=0x1d113790,
>>>> args=<value optimised out>) at ./Modules/threadmodule.c:51
>>>> #3  0x00000000004a860a in call_function (f=0x3136af0, throwflag=<value
>>>> optimised out>) at Python/ceval.c:4012
>>>> #4  PyEval_EvalFrameEx (f=0x3136af0, throwflag=<value optimised out>)
>>>> at Python/ceval.c:2665
>>>> #5  0x00000000004a9e81 in PyEval_EvalCodeEx (co=0x3f7b430,
>>>> globals=<value optimised out>, locals=<value optimised out>, args=0x2,
>>>> argcount=0, kws=<value optimised out>,
>>>>    kwcount=0, defs=0x2c53668, defcount=1, closure=0x0) at 
>>>> Python/ceval.c:3252
>>>> #6  0x00000000004a8134 in fast_function (f=0x3c34650, throwflag=<value
>>>> optimised out>) at Python/ceval.c:4108
>>>> #7  call_function (f=0x3c34650, throwflag=<value optimised out>) at
>>>> Python/ceval.c:4033
>>>> #8  PyEval_EvalFrameEx (f=0x3c34650, throwflag=<value optimised out>)
>>>> at Python/ceval.c:2665
>>>> #9  0x00000000004a9e81 in PyEval_EvalCodeEx (co=0x3f60530,
>>>> globals=<value optimised out>, locals=<value optimised out>, args=0x2,
>>>> argcount=0, kws=<value optimised out>,
>>>>    kwcount=0, defs=0x3d239e8, defcount=1, closure=0x0) at 
>>>> Python/ceval.c:3252
>>>> #10 0x00000000004a8134 in fast_function (f=0x18172230,
>>>> throwflag=<value optimised out>) at Python/ceval.c:4108
>>>> #11 call_function (f=0x18172230, throwflag=<value optimised out>) at
>>>> Python/ceval.c:4033
>>>> #12 PyEval_EvalFrameEx (f=0x18172230, throwflag=<value optimised out>)
>>>> at Python/ceval.c:2665
>>>> #13 0x00000000004a9e81 in PyEval_EvalCodeEx (co=0x3f60eb0,
>>>> globals=<value optimised out>, locals=<value optimised out>,
>>>> args=0x23a6c68, argcount=0, kws=<value optimised out>,
>>>>    kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3252
>>>> #14 0x000000000050aa4e in function_call (func=0x3d12e60,
>>>> arg=0x23a6c50, kw=0x0) at Objects/funcobject.c:526
>>>> #15 0x00000000004195c7 in PyObject_Call (func=0x3d12e60, arg=0x80,
>>>> kw=0x0) at Objects/abstract.c:2522
>>>> #16 0x000000000042222f in instancemethod_call (func=0x3d12e60,
>>>> arg=0x23a6c50, kw=0x0) at Objects/classobject.c:2578
>>>> #17 0x000000000041c133 in PyObject_Call (callable=0x2e36550,
>>>> args=0x7f599bbc1050) at Objects/abstract.c:2522
>>>> #18 call_function_tail (callable=0x2e36550, args=0x7f599bbc1050) at
>>>> Objects/abstract.c:2554
>>>> #19 0x000000000041f340 in PyObject_CallMethod (o=<value optimised
>>>> out>, name=0x53f786 "_shutdown", format=0x5285b0 "") at
>>>> Objects/abstract.c:2631
>>>> #20 0x00000000004ca089 in wait_for_thread_shutdown () at 
>>>> Python/pythonrun.c:1696
>>>> #21 Py_Finalize () at Python/pythonrun.c:401
>>>> #22 0x00000000004c9810 in Py_Exit () at Python/pythonrun.c:1753
>>>> #23 handle_system_exit () at Python/pythonrun.c:1127
>>>> #24 0x00000000004c9e15 in PyErr_PrintEx (set_sys_last_vars=<value
>>>> optimised out>) at Python/pythonrun.c:1137
>>>> #25 0x00000000004cac40 in PyRun_SimpleFileExFlags (fp=<value optimised
>>>> out>, filename=0x7fff5f1d8f91 "runtests.py", closeit=1,
>>>> flags=0x7fff5f1d7270) at Python/pythonrun.c:940
>>>> #26 0x0000000000414b7a in Py_Main (argc=-1682423728, argv=<value
>>>> optimised out>) at Modules/main.c:599
>>>> #27 0x00007f599ae04d8e in __libc_start_main (main=<value optimised
>>>> out>, argc=<value optimised out>, ubp_av=<value optimised out>,
>>>> init=<value optimised out>,
>>>>    fini=<value optimised out>, rtld_fini=<value optimised out>,
>>>> stack_end=0x7fff5f1d7388) at libc-start.c:226
>>>> #28 0x0000000000413cd9 in _start ()
>>>> (gdb) info threads
>>>>  3 Thread 0x7f59857cb710 (LWP 17342)  sem_wait () at
>>>> ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
>>>>  2 Thread 0x7f597cf7e710 (LWP 17397)  0x00007f599aec52e3 in select ()
>>>> at ../sysdeps/unix/syscall-template.S:82
>>>> * 1 Thread 0x7f599bc02700 (LWP 8116)  sem_wait () at
>>>> ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
>>>> (gdb) thread 2
>>>> [Switching to thread 2 (Thread 0x7f597cf7e710 (LWP 17397))]#0
>>>> 0x00007f599aec52e3 in select () at
>>>> ../sysdeps/unix/syscall-template.S:82
>>>> 82      ../sysdeps/unix/syscall-template.S: Нет такого файла или каталога.
>>>>        in ../sysdeps/unix/syscall-template.S
>>>> (gdb) bt
>>>> #0  0x00007f599aec52e3 in select () at 
>>>> ../sysdeps/unix/syscall-template.S:82
>>>> #1  0x00007f596b8e2f18 in ?? () from /usr/lib/libtcl8.5.so.0
>>>> #2  0x00007f599b7fa971 in start_thread (arg=<value optimised out>) at
>>>> pthread_create.c:304
>>>> #3  0x00007f599aecc94d in clone () at
>>>> ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
>>>> #4  0x0000000000000000 in ?? ()
>>>> (gdb) thread 3
>>>> [Switching to thread 3 (Thread 0x7f59857cb710 (LWP 17342))]#0
>>>> sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
>>>> 86      ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Нет такого файла
>>>> или каталога.
>>>>        in ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
>>>> (gdb) bt
>>>> #0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
>>>> #1  0x00000000004dcac8 in PyThread_acquire_lock (lock=0x14816d80,
>>>> waitflag=128) at Python/thread_pthread.h:309
>>>> #2  0x00000000004e00d2 in lock_PyThread_acquire_lock (self=0x26964370,
>>>> args=<value optimised out>) at ./Modules/threadmodule.c:51
>>>> #3  0x00000000004a860a in call_function (f=0x24b11010,
>>>> throwflag=<value optimised out>) at Python/ceval.c:4012
>>>> #4  PyEval_EvalFrameEx (f=0x24b11010, throwflag=<value optimised out>)
>>>> at Python/ceval.c:2665
>>>> #5  0x00000000004a9e81 in PyEval_EvalCodeEx (co=0x3f7b430,
>>>> globals=<value optimised out>, locals=<value optimised out>,
>>>> args=0x250b8a58, argcount=0, kws=<value optimised out>,
>>>>    kwcount=0, defs=0x2c53668, defcount=1, closure=0x0) at 
>>>> Python/ceval.c:3252
>>>> #6  0x00000000004a8134 in fast_function (f=0x250b88d0,
>>>> throwflag=<value optimised out>) at Python/ceval.c:4108
>>>> #7  call_function (f=0x250b88d0, throwflag=<value optimised out>) at
>>>> Python/ceval.c:4033
>>>> #8  PyEval_EvalFrameEx (f=0x250b88d0, throwflag=<value optimised out>)
>>>> at Python/ceval.c:2665
>>>> #9  0x00000000004a9e81 in PyEval_EvalCodeEx (co=0x3f7bdb0,
>>>> globals=<value optimised out>, locals=<value optimised out>, args=0x2,
>>>> argcount=0, kws=<value optimised out>,
>>>>    kwcount=0, defs=0x3d23ae8, defcount=1, closure=0x0) at 
>>>> Python/ceval.c:3252
>>>> #10 0x000000000050aa4e in function_call (func=0x3d120c8,
>>>> arg=0x26b704d0, kw=0x0) at Objects/funcobject.c:526
>>>> #11 0x00000000004195c7 in PyObject_Call (func=0x3d120c8, arg=0x80,
>>>> kw=0x0) at Objects/abstract.c:2522
>>>> #12 0x000000000042222f in instancemethod_call (func=0x3d120c8,
>>>> arg=0x26b704d0, kw=0x0) at Objects/classobject.c:2578
>>>> #13 0x00000000004195c7 in PyObject_Call (func=0x26b72370, arg=0x80,
>>>> kw=0x0) at Objects/abstract.c:2522
>>>> #14 0x00007f596cb85f36 in ?? ()
>>>> #15 0x0000000000000000 in ?? ()
>>>>
>>>
>>> Still can't find which one test have thread left.
>>>
>>> Here is workaround:
>>>
>>> import threading
>>> import time
>>> import os
>>>
>>> class XXX(threading.Thread):
>>>    def run(self):
>>>        print ('Bad thread')
>>>        while True:
>>>            time.sleep(1)
>>> XXX().start()
>>>
>>> time.sleep(.1)
>>>
>>> if len(threading._active) > 1:
>>>    import warnings
>>>    print("Warning more then one threads left, forcing _exit()")
>>>    os._exit(0)
>>>
>>>
>>> I'm not sure it is a good idea to add this into runtests.py
>>>
>>
>> Btw I think we need a way to find blocking thread.
>>
>> wait_for_thread_shutdown() calls threading._shutdown and we can hook
>> it and test is there NonDaemon threads left and try to join
>> them with timeout. If it fails call _exit and print error message.
>>
>> One more problem: how to make it portable between python versions.
>> --
>> vitja.
>>
>
> 2.5, 2.6, 2.7, 3.x use threading._shutdown
>
> 2.3,2.4 use sys.exitfunc
>
> --
> vitja.
>

I added patch to runthreads to check thread state at exit.

http://trac.cython.org/cython_trac/attachment/ticket/596/runtests-check-threads.patch

-- 
vitja.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to