← Back to team overview

openshot.bugs team mailing list archive

[Bug 643151] Re: openshot-render never end

 

Attaching with gdb in my case shows thread stacks such as below - Thread 1 is the main thread and Thread 2 is the thumbnailer.
Since the thumbnailer is not a daemon thread (is there a reason for this?) it prevents the Python interpreter from exiting.
Attaching a patch which fixes the hang for me.

(gdb) thread apply all bt

Thread 2 (Thread 0x7f1dd8817700 (LWP 28984)):
#0  0x00007f1de2e2e5b3 in select () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x0000000000502a40 in floatsleep (secs=<optimized out>) at ../Modules/timemodule.c:943
#2  time_sleep.53112 (self=<optimized out>, args=<optimized out>) at ../Modules/timemodule.c:206
#3  0x00000000004b1764 in call_function (oparg=<optimized out>, pp_stack=0x7f1dd88166f0) at ../Python/ceval.c:4021
#4  PyEval_EvalFrameEx (f=<optimized out>, throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#5  0x00000000004b1f94 in fast_function (nk=<optimized out>, na=<optimized out>, n=1, pp_stack=0x7f1dd88168d0, func=<function at remote 0x2708aa0>) at ../Python/ceval.c:4107
#6  call_function (oparg=<optimized out>, pp_stack=0x7f1dd88168d0) at ../Python/ceval.c:4042
#7  PyEval_EvalFrameEx (f=<optimized out>, throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#8  0x00000000004b1f94 in fast_function (nk=<optimized out>, na=<optimized out>, n=1, pp_stack=0x7f1dd8816ab0, func=<function at remote 0x7f1de3c6f938>) at ../Python/ceval.c:4107
#9  call_function (oparg=<optimized out>, pp_stack=0x7f1dd8816ab0) at ../Python/ceval.c:4042
#10 PyEval_EvalFrameEx (f=f@entry=Frame 0x2afade0, for file /usr/lib/python2.7/threading.py, line 525, in __bootstrap (self=<thumbnailer(profile=<Profile(this=<SwigPyObject at remote 0x28a8b10>) at remote 0x28ac710>, c=None, _Thread__ident=139766163142400, p=None, _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e50>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e50>, _Condition__waiters=[<thread.lock at remote 0x7f1de3d30eb0>], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e50>) at remote 0x28ac6d0>, _Thread__name='Thread-1', _Thread__daemonic=False, file_name='', _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e30>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e30>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e30>) at remo...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#11 0x00000000004b9158 in PyEval_EvalCodeEx (co=<optimized out>, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=<optimized out>, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, closure=0x0) at ../Python/ceval.c:3253
#12 0x00000000004b9cec in function_call.15272 (func=<function at remote 0x7f1de3c6f848>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#13 0x000000000047c9c4 in PyObject_Call (kw=0x0, arg=(<thumbnailer(profile=<Profile(this=<SwigPyObject at remote 0x28a8b10>) at remote 0x28ac710>, c=None, _Thread__ident=139766163142400, p=None, _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e50>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e50>, _Condition__waiters=[<thread.lock at remote 0x7f1de3d30eb0>], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e50>) at remote 0x28ac6d0>, _Thread__name='Thread-1', _Thread__daemonic=False, file_name='', _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e30>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e30>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e30>) at remote 0x28ac5d0>) at remote 0x28ac550>, _Thread__stderr=<file at remote 0x7f1de3d86270>, pro...(truncated), func=<function at remote 0x7f1de3c6f848>) at ../Objects/abstract.c:2529
#14 instancemethod_call.8745 (func=<function at remote 0x7f1de3c6f848>, arg=(<thumbnailer(profile=<Profile(this=<SwigPyObject at remote 0x28a8b10>) at remote 0x28ac710>, c=None, _Thread__ident=139766163142400, p=None, _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e50>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e50>, _Condition__waiters=[<thread.lock at remote 0x7f1de3d30eb0>], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e50>) at remote 0x28ac6d0>, _Thread__name='Thread-1', _Thread__daemonic=False, file_name='', _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e30>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e30>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e30>) at remote 0x28ac5d0>) at remote 0x28ac550>, _Thread__stderr=<file at remote 0x7f1de3d86270>, pro...(truncated), kw=0x0) at ../Objects/classobject.c:2602
#15 0x0000000000467d4e in PyObject_Call (kw=<optimized out>, arg=(), func=<instancemethod at remote 0x2695550>) at ../Objects/abstract.c:2529
#16 PyEval_CallObjectWithKeywords (func=<instancemethod at remote 0x2695550>, arg=(), kw=<optimized out>) at ../Python/ceval.c:3890
#17 0x0000000000501928 in t_bootstrap.49361 (boot_raw=0x2ae8560) at ../Modules/threadmodule.c:614
#18 0x00007f1de398ab50 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#19 0x00007f1de2e34abd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#20 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f1de3daf700 (LWP 28979)):
#0  0x00007f1de3991420 in sem_wait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x000000000048922f in PyThread_acquire_lock (waitflag=<optimized out>, lock=0x2bbc1e0) at ../Python/thread_pthread.h:321
#2  lock_PyThread_acquire_lock.49379 (self=<optimized out>, args=<optimized out>) at ../Modules/threadmodule.c:52
#3  0x00000000004b1764 in call_function (oparg=<optimized out>, pp_stack=0x7ffffdc7b400) at ../Python/ceval.c:4021
#4  PyEval_EvalFrameEx (f=f@entry=Frame 0x2afaa10, for file /usr/lib/python2.7/threading.py, line 244, in wait (self=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e50>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e50>, _Condition__waiters=[<thread.lock at remote 0x7f1de3d30eb0>], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e50>) at remote 0x28ac6d0>, timeout=None, waiter=<thread.lock at remote 0x7f1de3d30eb0>, saved_state=None), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#5  0x00000000004b9158 in PyEval_EvalCodeEx (co=<optimized out>, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=<optimized out>, kws=0x2c06bf0, kwcount=0, defs=0x7f1de3c59ea8, defcount=1, closure=closure@entry=0x0) at ../Python/ceval.c:3253
#6  0x00000000004b1d15 in fast_function (nk=<optimized out>, na=<optimized out>, n=<optimized out>, pp_stack=0x7ffffdc7b6a0, func=<function at remote 0x7f1de3c6eb90>) at ../Python/ceval.c:4117
#7  call_function (oparg=<optimized out>, pp_stack=0x7ffffdc7b6a0) at ../Python/ceval.c:4042
#8  PyEval_EvalFrameEx (f=f@entry=Frame 0x2c06a50, for file /usr/lib/python2.7/threading.py, line 668, in join (self=<thumbnailer(profile=<Profile(this=<SwigPyObject at remote 0x28a8b10>) at remote 0x28ac710>, c=None, _Thread__ident=139766163142400, p=None, _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e50>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e50>, _Condition__waiters=[<thread.lock at remote 0x7f1de3d30eb0>], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e50>) at remote 0x28ac6d0>, _Thread__name='Thread-1', _Thread__daemonic=False, file_name='', _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30e30>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30e30>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30e30>) at remote 0x28...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#9  0x00000000004b9158 in PyEval_EvalCodeEx (co=<optimized out>, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=<optimized out>, kws=0x2136020, kwcount=0, defs=0x7f1de3c65ea8, defcount=1, closure=closure@entry=0x0) at ../Python/ceval.c:3253
#10 0x00000000004b1d15 in fast_function (nk=<optimized out>, na=<optimized out>, n=<optimized out>, pp_stack=0x7ffffdc7b940, func=<function at remote 0x7f1de3c6faa0>) at ../Python/ceval.c:4117
#11 call_function (oparg=<optimized out>, pp_stack=0x7ffffdc7b940) at ../Python/ceval.c:4042
#12 PyEval_EvalFrameEx (f=f@entry=Frame 0x2135e90, for file /usr/lib/python2.7/threading.py, line 785, in _exitfunc (self=<_MainThread(_Thread__ident=139766353557248, _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30190>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30190>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30190>) at remote 0x7f1de3c72290>, _Thread__name='MainThread', _Thread__daemonic=False, _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30150>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30150>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30150>) at remote 0x7f1de3c721d0>) at remote 0x7f1de3c72110>, _Thread__stderr=<file at remote 0x7f1de3d86270>, _Thread__target=None, _Thread__kwargs={}, _Verb...(truncated), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#13 0x00000000004b9158 in PyEval_EvalCodeEx (co=<optimized out>, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=<optimized out>, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, closure=0x0) at ../Python/ceval.c:3253
#14 0x00000000004b9cec in function_call.15272 (func=<function at remote 0x7f1de3c70320>, arg=<optimized out>, kw=<optimized out>) at ../Objects/funcobject.c:526
#15 0x000000000047c9c4 in PyObject_Call (kw=0x0, arg=(<_MainThread(_Thread__ident=139766353557248, _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30190>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30190>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30190>) at remote 0x7f1de3c72290>, _Thread__name='MainThread', _Thread__daemonic=False, _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30150>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30150>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30150>) at remote 0x7f1de3c721d0>) at remote 0x7f1de3c72110>, _Thread__stderr=<file at remote 0x7f1de3d86270>, _Thread__target=None, _Thread__kwargs={}, _Verbose__verbose=False, _Thread__args=(), _Thread__stopped=True, _Thread__initialized=True)...(truncated), func=<function at remote 0x7f1de3c70320>) at ../Objects/abstract.c:2529
#16 instancemethod_call.8745 (func=<function at remote 0x7f1de3c70320>, arg=(<_MainThread(_Thread__ident=139766353557248, _Thread__block=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30190>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30190>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30190>) at remote 0x7f1de3c72290>, _Thread__name='MainThread', _Thread__daemonic=False, _Thread__started=<_Event(_Verbose__verbose=False, _Event__flag=True, _Event__cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f1de3d30150>, acquire=<built-in method acquire of thread.lock object at remote 0x7f1de3d30150>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f1de3d30150>) at remote 0x7f1de3c721d0>) at remote 0x7f1de3c72110>, _Thread__stderr=<file at remote 0x7f1de3d86270>, _Thread__target=None, _Thread__kwargs={}, _Verbose__verbose=False, _Thread__args=(), _Thread__stopped=True, _Thread__initialized=True)...(truncated), kw=0x0) at ../Objects/classobject.c:2602
#17 0x0000000000467be1 in PyObject_Call (kw=0x0, arg=(), func=<instancemethod at remote 0x7f1de3d525a0>) at ../Objects/abstract.c:2529
#18 call_function_tail.5346 (callable=callable@entry=<instancemethod at remote 0x7f1de3d525a0>, args=()) at ../Objects/abstract.c:2561
#19 0x000000000054f077 in PyObject_CallMethod (o=<optimized out>, name=0x577d6d "_shutdown", format=0x567cb3 "") at ../Objects/abstract.c:2638
#20 0x00000000004344ee in wait_for_thread_shutdown () at ../Python/pythonrun.c:1715
#21 Py_Finalize () at ../Python/pythonrun.c:408
#22 0x000000000043465c in Py_Exit (sts=sts@entry=0) at ../Python/pythonrun.c:1772
#23 0x0000000000434798 in handle_system_exit () at ../Python/pythonrun.c:1146
#24 0x000000000086f540 in ?? ()
#25 0x0000000000000001 in ?? ()
#26 0x000000000087ac80 in ?? ()
#27 0x0000000002135e70 in ?? ()
#28 0x00000000028bfef0 in ?? ()
#29 0x0000000000000001 in ?? ()
#30 0x0000000000000001 in ?? ()
#31 0x0000000000433355 in PyErr_PrintEx (set_sys_last_vars=0) at ../Python/pythonrun.c:1156
#32 0x000000000044aa2f in PyRun_SimpleFileExFlags (fp=fp@entry=0x2135e70, filename=<optimized out>, filename@entry=0x7ffffdc7d955 "/usr/bin/openshot-render", closeit=closeit@entry=1, flags=flags@entry=0x7ffffdc7bff0) at ../Python/pythonrun.c:947
#33 0x000000000044aae5 in PyRun_AnyFileExFlags (fp=fp@entry=0x2135e70, filename=filename@entry=0x7ffffdc7d955 "/usr/bin/openshot-render", closeit=closeit@entry=1, flags=flags@entry=0x7ffffdc7bff0) at ../Python/pythonrun.c:747
#34 0x000000000044b616 in Py_Main (argc=<optimized out>, argv=0x7ffffdc7c1a8) at ../Modules/main.c:639
#35 0x00007f1de2d78ead in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#36 0x00000000004c8d81 in _start ()


** Patch added: "Shut down thumbnailer thread before finishing."
   https://bugs.launchpad.net/openshot/+bug/643151/+attachment/3441484/+files/cli_render.py.patch

-- 
You received this bug notification because you are a member of OpenShot
Bugs, which is subscribed to OpenShot Video Editor.
https://bugs.launchpad.net/bugs/643151

Title:
  openshot-render never end

Status in OpenShot Video Editor:
  New

Bug description:
  command line renderer never exit, it creates output file without any problem but after call sys.exit() it hangs forever. Only way to stop it is to send a signal kill -1.
  Some work around is to use return instead of sys.exit() where possible eg in function main in openshot_render.py
  and in main program use os._exit(0) to force exit the script, instead throwing exception SystemExit with sys.exit().

  Used OS: Linux Mint 9 based on Ubuntu 10.04, OpenShot 1.1.3

To manage notifications about this bug go to:
https://bugs.launchpad.net/openshot/+bug/643151/+subscriptions