Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting threading-model /Draw or Cull/Draw while using realtime shadows with shadow cameras will freeze panda3d #162

Closed
ghost opened this issue Aug 22, 2017 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 22, 2017

Setting threading-model /Draw or Cull/Draw will freeze panda3d for me after a few seconds.
Edit: as pointed out below, I do indeed use light.setShadowCaster() which seems to be related to this.

This is how it looks like in gdb:

(gdb) thread apply all bt

Thread 4 (Thread 0x7fa849ef0700 (LWP 19159)):
#0  0x00007fa871a0181b in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fa850fbb158 in pa_threaded_mainloop_wait () from /lib64/libpulse.so.0
#2  0x00007fa8514257ef in ALCpulsePlayback_mixerProc () from /lib64/libopenal.so.1
#3  0x00007fa8514294e7 in althrd_starter () from /lib64/libopenal.so.1
#4  0x00007fa8719fb36d in start_thread () from /lib64/libpthread.so.0
#5  0x00007fa871016b8f in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7fa84e6f1700 (LWP 19158)):
#0  0x00007fa87100aa9d in poll () from /lib64/libc.so.6
#1  0x00007fa850fbab71 in poll_func () from /lib64/libpulse.so.0
#2  0x00007fa850fac530 in pa_mainloop_poll () from /lib64/libpulse.so.0
#3  0x00007fa850facbc0 in pa_mainloop_iterate () from /lib64/libpulse.so.0
#4  0x00007fa850facc50 in pa_mainloop_run () from /lib64/libpulse.so.0
#5  0x00007fa850fbaab9 in thread () from /lib64/libpulse.so.0
#6  0x00007fa850d5a078 in internal_thread_func () from /usr/lib64/pulseaudio/libpulsecommon-10.0.so
#7  0x00007fa8719fb36d in start_thread () from /lib64/libpthread.so.0
#8  0x00007fa871016b8f in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7fa85a39d700 (LWP 19154)):
#0  0x00007fa871a04fad in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x00007fa8719fde88 in pthread_mutex_lock () from /lib64/libpthread.so.0
#2  0x00007fa865ef17a9 in ReMutexPosixImpl::acquire() () from /usr/lib64/panda3d/libpanda.so.1.10
#3  0x00007fa8660837f9 in GraphicsEngine::get_threading_model() const () from /usr/lib64/panda3d/libpanda.so.1.10
#4  0x00007fa86608ef8a in GraphicsEngine::make_output(GraphicsPipe*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, FrameBufferProperties const&, WindowProperties const&, int, GraphicsStateGuardian*, GraphicsOutput*) ()
   from /usr/lib64/panda3d/libpanda.so.1.10
#5  0x00007fa8660ae662 in GraphicsStateGuardian::make_shadow_buffer(NodePath const&, GraphicsOutputBase*) ()
   from /usr/lib64/panda3d/libpanda.so.1.10
#6  0x00007fa8660af19a in GraphicsStateGuardian::get_shadow_map(NodePath const&, GraphicsOutputBase*) () from /usr/lib64/panda3d/libpanda.so.1.10
#7  0x00007fa8660b4301 in GraphicsStateGuardian::fetch_specified_texture(Shader::ShaderTexSpec&, SamplerState&, int&) ()
   from /usr/lib64/panda3d/libpanda.so.1.10
#8  0x00007fa85bf1d9ae in GLShaderContext::update_shader_texture_bindings(ShaderContext*) () from /usr/lib64/panda3d/libpandagl.so
#9  0x00007fa85bf20d18 in GLGraphicsStateGuardian::do_issue_texture() () from /usr/lib64/panda3d/libpandagl.so
#10 0x00007fa85bf2ada5 in GLGraphicsStateGuardian::set_state_and_transform(RenderState const*, TransformState const*) ()
   from /usr/lib64/panda3d/libpandagl.so
#11 0x00007fa865f83787 in CullBinFixed::draw(bool, Thread*) () from /usr/lib64/panda3d/libpanda.so.1.10
#12 0x00007fa865eda9a3 in CullResult::draw(Thread*) () from /usr/lib64/panda3d/libpanda.so.1.10
#13 0x00007fa86609167d in GraphicsEngine::do_draw(GraphicsOutput*, GraphicsStateGuardian*, DisplayRegion*, Thread*) ()
   from /usr/lib64/panda3d/libpanda.so.1.10
#14 0x00007fa866091977 in GraphicsEngine::draw_bins(ov_set<PointerTo<GraphicsOutput>, IndirectLess<GraphicsOutput>, pvector<PointerTo<GraphicsOutput> > > const&, Thread*) () from /usr/lib64/panda3d/libpanda.so.1.10
#15 0x00007fa866093846 in GraphicsEngine::WindowRenderer::do_frame(GraphicsEngine*, Thread*) () from /usr/lib64/panda3d/libpanda.so.1.10
#16 0x00007fa86609541b in GraphicsEngine::RenderThread::thread_main() () from /usr/lib64/panda3d/libpanda.so.1.10
#17 0x00007fa8660c5ff0 in ThreadPosixImpl::root_func(void*) () from /usr/lib64/panda3d/libpanda.so.1.10
#18 0x00007fa8719fb36d in start_thread () from /lib64/libpthread.so.0
---Type <return> to continue, or q <return> to quit---
#19 0x00007fa871016b8f in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fa87236a700 (LWP 19144)):
#0  0x00007fa871a04fad in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x00007fa8719fde13 in pthread_mutex_lock () from /lib64/libpthread.so.0
#2  0x00007fa865ec12c9 in MutexPosixImpl::acquire() () from /usr/lib64/panda3d/libpanda.so.1.10
#3  0x00007fa8660940d1 in GraphicsEngine::render_frame() () from /usr/lib64/panda3d/libpanda.so.1.10
#4  0x00007fa866d7210c in Dtool_GraphicsEngine_render_frame_515(_object*, _object*) ()
   from /usr/lib64/python3.6/site-packages/panda3d/core.cpython-36m-x86_64-linux-gnu.so
#5  0x00007fa871d9713a in _PyCFunction_FastCallDict () from /lib64/libpython3.6m.so.1.0
#6  0x00007fa871d9e4ba in call_function () from /lib64/libpython3.6m.so.1.0
#7  0x00007fa871ddb61a in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#8  0x00007fa871d2d12a in _PyFunction_FastCallDict () from /lib64/libpython3.6m.so.1.0
#9  0x00007fa871d2d81e in _PyObject_FastCallDict () from /lib64/libpython3.6m.so.1.0
#10 0x00007fa871d37451 in _PyObject_Call_Prepend () from /lib64/libpython3.6m.so.1.0
#11 0x00007fa871d2dc3b in PyObject_Call () from /lib64/libpython3.6m.so.1.0
#12 0x00007fa86707775d in PythonThread::call_python_func(_object*, _object*) ()
   from /usr/lib64/python3.6/site-packages/panda3d/core.cpython-36m-x86_64-linux-gnu.so
#13 0x00007fa86707ac4e in PythonTask::do_python_task() () from /usr/lib64/python3.6/site-packages/panda3d/core.cpython-36m-x86_64-linux-gnu.so
#14 0x00007fa86707b398 in PythonTask::do_task() () from /usr/lib64/python3.6/site-packages/panda3d/core.cpython-36m-x86_64-linux-gnu.so
#15 0x00007fa8660cdc3d in AsyncTask::unlock_and_do_task() () from /usr/lib64/panda3d/libpanda.so.1.10
#16 0x00007fa8660d5a2a in AsyncTaskChain::service_one_task(AsyncTaskChain::AsyncTaskChainThread*) () from /usr/lib64/panda3d/libpanda.so.1.10
#17 0x00007fa8660d70c1 in AsyncTaskChain::do_poll() () from /usr/lib64/panda3d/libpanda.so.1.10
#18 0x00007fa8660d7861 in AsyncTaskManager::poll() () from /usr/lib64/panda3d/libpanda.so.1.10
#19 0x00007fa866da8143 in Dtool_AsyncTaskManager_poll_128(_object*, _object*) ()
   from /usr/lib64/python3.6/site-packages/panda3d/core.cpython-36m-x86_64-linux-gnu.so
#20 0x00007fa871d9713a in _PyCFunction_FastCallDict () from /lib64/libpython3.6m.so.1.0
#21 0x00007fa871d9e4ba in call_function () from /lib64/libpython3.6m.so.1.0
#22 0x00007fa871ddb61a in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#23 0x00007fa871d60c5a in fast_function () from /lib64/libpython3.6m.so.1.0
#24 0x00007fa871d9e57e in call_function () from /lib64/libpython3.6m.so.1.0
#25 0x00007fa871ddb61a in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#26 0x00007fa871d2c81d in _PyEval_EvalCodeWithName () from /lib64/libpython3.6m.so.1.0
#27 0x00007fa871d60e81 in fast_function () from /lib64/libpython3.6m.so.1.0
#28 0x00007fa871d9e57e in call_function () from /lib64/libpython3.6m.so.1.0
#29 0x00007fa871ddb61a in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#30 0x00007fa871d60c5a in fast_function () from /lib64/libpython3.6m.so.1.0
#31 0x00007fa871d9e57e in call_function () from /lib64/libpython3.6m.so.1.0
#32 0x00007fa871ddb61a in _PyEval_EvalFrameDefault () from /lib64/libpython3.6m.so.1.0
#33 0x00007fa871dab427 in PyEval_EvalCodeEx () from /lib64/libpython3.6m.so.1.0
#34 0x00007fa871dac18b in PyEval_EvalCode () from /lib64/libpython3.6m.so.1.0
#35 0x00007fa871e33922 in run_mod () from /lib64/libpython3.6m.so.1.0
#36 0x00007fa871e3457d in PyRun_FileExFlags () from /lib64/libpython3.6m.so.1.0
#37 0x00007fa871e367a7 in PyRun_SimpleFileExFlags () from /lib64/libpython3.6m.so.1.0
#38 0x00007fa871e377a3 in Py_Main () from /lib64/libpython3.6m.so.1.0
#39 0x000055d7c3dd9cf5 in main ()
(gdb)
@rdb
Copy link
Member

rdb commented Aug 22, 2017

There is currently a deadlock with multithreading and the shadow system. (Also tracked in LP: https://bugs.launchpad.net/panda3d/+bug/1212752 )

@rdb rdb added the bug label Aug 22, 2017
@ghost ghost changed the title Setting threading-model /Draw or Cull/Draw will freeze panda3d Setting threading-model /Draw or Cull/Draw while using realtime shadows with shadow cameras will freeze panda3d Aug 22, 2017
@drewc5131

This comment has been minimized.

@rdb rdb closed this as completed in 5309db8 Dec 30, 2017
@rdb
Copy link
Member

rdb commented Dec 30, 2017

Should be all right now. Please give it a try and report back whether it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants