setRenderModePerspective segfault


I try to render points (GeomPoints) with perspective mode.
But, I have a pretty segmentation fault on setRenderModePerspactive(True) call. :confused:

I’m on ubuntu with openGL. Any idears ?


It sounds like it might be a driver issue, but I can’t be sure from the vague problem description. What is the stack trace at the time of the segment fault?

What happens if you set “hardware-point-sprites 0” and “hardware-points 0” in your Config.prc file?


Sorry for the poor problem description. I have tried to gdb but it stop on “ImportError: No module named panda3d.core”… So I can’t get any backtrace.

“hardware-point-sprites 0” and “hardware-points 0” don’t help at all.

You are probably right, it might be a driver issue. I’ll try on an other config then.


You can also put “load-display tinydisplay” in your Config.prc to avoid using your 3-D hardware and thus avoid any driver issues. But I’m surprised that the hardware-sprites settings had no effect; that may mean it’s not a driver issue after all.

gdb will occasionally stop when Python starts up, but you can just type “c” to continue. I don’t know why you’re getting the ImportError, though; it sounds like something is different about the way you’re launching Python within gdb that causes the paths to be incorrect. Note that you could also just launch your app normally, then find out the pid and use “gdb -p pid” to debug it after you have launched it.


Same issue with tinydisplay.

I had not thought of the “attach to process” way with gdb to pass the imports. Great idear.
So know I can get the backtrace.

Program received signal SIGSEGV, Segmentation fault.
0x00007f381d3df39b in CullableObject::munge_points_to_quads(CullTraverser const*, bool) () from /usr/lib64/panda3d/
(gdb) bt
#0  0x00007f381d3df39b in CullableObject::munge_points_to_quads(CullTraverser const*, bool) () from /usr/lib64/panda3d/
#1  0x00007f381d3e7542 in CullableObject::munge_geom(GraphicsStateGuardianBase*, GeomMunger*, CullTraverser const*, bool) ()
   from /usr/lib64/panda3d/
#2  0x00007f381d3f5189 in CullResult::add_object(CullableObject*, CullTraverser const*) () from /usr/lib64/panda3d/
#3  0x00007f381d3e8896 in GeomNode::add_for_draw(CullTraverser*, CullTraverserData&) () from /usr/lib64/panda3d/
#4  0x00007f381d3fbed3 in CullTraverser::traverse_below(CullTraverserData&) () from /usr/lib64/panda3d/
#5  0x00007f381d3fbe0a in CullTraverser::traverse_below(CullTraverserData&) () from /usr/lib64/panda3d/
#6  0x00007f381d3fc478 in CullTraverser::traverse(NodePath const&) () from /usr/lib64/panda3d/
#7  0x00007f381d80796f in GraphicsEngine::do_cull(CullHandler*, SceneSetup*, GraphicsStateGuardian*, Thread*) () from /usr/lib64/panda3d/
#8  0x00007f381d8085b7 in GraphicsEngine::cull_to_bins(GraphicsOutput*, DisplayRegion*, Thread*) () from /usr/lib64/panda3d/
#9  0x00007f381d808c89 in GraphicsEngine::cull_to_bins(ov_set<PointerTo<GraphicsOutput>, IndirectLess<GraphicsOutput> > const&, Thread*) ()
   from /usr/lib64/panda3d/
#10 0x00007f381d80948f in GraphicsEngine::WindowRenderer::do_frame(GraphicsEngine*, Thread*) () from /usr/lib64/panda3d/
#11 0x00007f381d80a137 in GraphicsEngine::render_frame() () from /usr/lib64/panda3d/
#12 0x00007f381d83d26d in Dtool_GraphicsEngine_render_frame_534(_object*, _object*, _object*) () from /usr/lib64/panda3d/
#13 0x00000000004a4354 in PyEval_EvalFrameEx ()
#14 0x00000000004a5e62 in PyEval_EvalCodeEx ()
#15 0x000000000053eaf7 in ?? ()
#16 0x00000000004217d7 in PyObject_Call ()
#17 0x000000000042b19f in ?? ()
#18 0x00000000004217d7 in PyObject_Call ()
#19 0x00007f381d878b8d in Thread::call_python_func(_object*, _object*) () from /usr/lib64/panda3d/
#20 0x00007f381d892ea2 in PythonTask::do_python_task() () from /usr/lib64/panda3d/
#21 0x00007f381d899786 in AsyncTask::unlock_and_do_task() () from /usr/lib64/panda3d/
#22 0x00007f381d8a3a01 in AsyncTaskChain::service_one_task(AsyncTaskChain::AsyncTaskChainThread*) () from /usr/lib64/panda3d/
#23 0x00007f381d8a4519 in AsyncTaskChain::do_poll() () from /usr/lib64/panda3d/
#24 0x00007f381d8a46b1 in AsyncTaskManager::poll() () from /usr/lib64/panda3d/
#25 0x00007f381d8b592d in Dtool_AsyncTaskManager_poll_121(_object*, _object*, _object*) () from /usr/lib64/panda3d/
#26 0x00000000004a4354 in PyEval_EvalFrameEx ()
#27 0x00000000004a5556 in PyEval_EvalFrameEx ()
#28 0x00000000004a5e62 in PyEval_EvalCodeEx ()
#29 0x00000000004a3ee8 in PyEval_EvalFrameEx ()
#30 0x00000000004a5556 in PyEval_EvalFrameEx ()
#31 0x00000000004a5e62 in PyEval_EvalCodeEx ()
#32 0x00000000004a5f32 in PyEval_EvalCode ()
#33 0x00000000004cb2d4 in PyRun_SimpleFileExFlags ()
#34 0x000000000041801d in Py_Main ()
#35 0x00007f381fc3deff in __libc_start_main (main=0x4173c0 <main>, argc=2, ubp_av=0x7fffa8a8fbe8, init=<value optimized out>, fini=<value optimized out>, 
    rtld_fini=<value optimized out>, stack_end=0x7fffa8a8fbd8) at libc-start.c:226
#36 0x00000000004172f9 in _start ()


Well, this puts it solidly as a Panda crash. So the next question is: which version of Panda are you using? Is it 1.7.2? That version and earlier versions did have some “bugs” in the sense that it would crash, rather than raise an error condition, if you created certain kinds of invalid geometry structures.

You could install the latest buildbot version and see if the crash goes away. Also, if the code is something simple you could paste here, I could perhaps look at it and tell you if there’s something invalid in the way you’re creating geometry.