MPoint rendermode bug.

i tried to render a pointcloud of vertices(building a 3d-scanner these days so it’s useful for viewing scans).

the problem is: if i load a model with more than 32 vertices, panda just freezes in an infinite loop.

core to reproduce:

from panda3d.core import  RenderModeAttrib
import direct.directbase.DirectStart

mymodel =loader.loadModel("teapot")
mymodel.reparentTo(render)
print "file loaded"
mymodel.setRenderMode(RenderModeAttrib.MPoint,20)
print "rendermode set"
run()

loading any model with 32 or less vertices works totaly fine.
tried to disable hardware-sprites with no luck.
once panda gets stuck the cpu jumps to 100%(not surprising) but it doesnt even react to anything. no close button, no ctrl+c on the terminal. only killing the process works.

running on Ubuntu 10.04_64 with nvidia card. rdb tested it, same problem occurs on his machine.
on a third machine Ubuntu 10.04, AMD ATI Radeon HD 4870 IceQ4+ &latest panda cvs version it’s just the same.
renders one or 2 frames. then freezes.

rendering point clouds with panda has worked in the past.
any clues what’s going on?
changing the model to “box” which has less than 32 vertices the code runs fine.

Hmm, my first attempt to reproduce this fails–I can see a teapot-shaped cloud of squares just fine, with no freezing. This is on my Windows box with my own latest CVS build. I’ll try a few other platforms.

David

Similar behavior on OSX 10.4 and Ubuntu 10.04: it runs just fine for me. Maybe there’s a critical config variable difference between us?

David

i played around a bit more.
the teapot runs for me. i can move and zoom in and out. but only up to a certain point. when zooming out too far it just gets stuck. this behaviour is somewhat strange.

my config variables are still the installation’s defaults.

Hmm, that is strange indeed. I can believe it might be doing something bad in there that gets it caught in an infinite loop due to numerical imprecision, maybe, though I don’t see it.

But still, I’m unable to repro. I can move the teapot so far away that all of the points collapse into a single square. I can continue to move it still farther away with no loss of performance until I eventually have to give up trying. How far away do you have to move it before it locks up?

David

not far. the teapot still extends over the screen in all dimensions. i counted 40 vertices onscreen. sometimes a bit more, sometimes a bit less. but i never managed to zoom out far enough to even see half of the teapot.

No problem with me too - not freeze but i try to
Win XP - Panda3D CVS - ATI HD4870

Flawless too. Ubuntu 10.04 + P3D 1.7.0 official.

camera.posInterval(10,Point3(0,-1000,0)).start()

ok now… THIS is strange… today i booted… and it works. just like that. i wonder what’s wrong with my machine scratches head

oh, i thought we reboot a linux only one time per Year ! :smiley:
It was the good day : 13th Friday

:open_mouth: it broke again …

is it possible that loading a model with more than 65k points will break it until system reboot?

btw. i turn my computer off over night. you should do the same unless you run a server

Not really a server,
But a continious flow of emule :smiling_imp:

hm… when it breaks… it eats my memory for breakfast several megabytes per second

Works fine here, too. MacBookPro late 2009, NVidia 9600 GT, Python 2.5.4, Panda3D (April 2010), OS X.6.4.

Hmm, perhaps it’s a graphics driver issue–does the same thing happen in tinydisplay?

thought about it too. but in blender i can display gazillions of pointclouds just fine.

just tested tiny display… it does exactly the same, renders a few frames until i zoom out a tad, then hangs and starts to eat my RAM great apetite. (15MB/s)

anything else i can try to provide you with more detailed information?

Hmm, can you break into it with gdb for a stacktrace?

David

strace output:

poll([{fd=11, events=POLLIN|POLLPRI}], 1, 1000) = 1 ([{fd=11, revents=POLLIN|POLLPRI}])
ioctl(11, 0xc0104652, 0x7fffdf367a00)   = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
read(4, "\6\0o\0&\r\260\3Z\1\0\0\3\0\240\5\0\0\0\0\253\3\341\0015\1\r\1\20\4\1\0"..., 4096) = 64
read(4, 0x27ddff4, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(4, 0x27ddff4, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(4, 0x27ddff4, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGINT, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, 8) = 0
rt_sigaction(SIGINT, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, 8) = 0
getpid()                                = 6452
poll([{fd=11, events=POLLIN|POLLPRI}], 1, 1000) = 1 ([{fd=11, revents=POLLIN|POLLPRI}])
ioctl(11, 0xc0104652, 0x7fffdf367a00)   = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
read(4, "\6\0o\0006\r\260\3Z\1\0\0\3\0\240\5\0\0\0\0\253\3\336\0015\1\n\1\20\4\1\0"..., 4096) = 64
read(4, 0x27ddff4, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(4, 0x27ddff4, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(4, 0x27ddff4, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGINT, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, 8) = 0
rt_sigaction(SIGINT, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, {0x4d9820, [], SA_RESTORER, 0x7fb6ef9f68f0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
select(0, NULL, NULL, NULL, {0, 1000})  = 0 (Timeout)
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getpid()                                = 6452
poll([{fd=11, events=POLLIN|POLLPRI}], 1, 1000) = 1 ([{fd=11, revents=POLLIN|POLLPRI}])
ioctl(11, 0xc0104652, 0x7fffdf367a00)   = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
brk(0x301a000)                          = 0x301a000
brk(0x308e000)                          = 0x308e000
mmap(NULL, 819200, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb6d7820000
mremap(0x7fb6d7820000, 819200, 823296, MREMAP_MAYMOVE) = 0x7fb6d7757000
mremap(0x7fb6d7757000, 823296, 827392, MREMAP_MAYMOVE) = 0x7fb6d7757000
mremap(0x7fb6d7757000, 827392, 831488, MREMAP_MAYMOVE) = 0x7fb6d7757000
mremap(0x7fb6d7757000, 831488, 835584, MREMAP_MAYMOVE) = 0x7fb6d7757000
mremap(0x7fb6d7757000, 835584, 839680, MREMAP_MAYMOVE) = 0x7fb6d7757000

before the mmap(NULL… line it loops the content above that line. as soon as it hangs. it’s printing endless numberse of thet mremap.

gdb brings up different results since it doesnt really crash.
the GeomVertexWriter line seems to appear quite often when i killall the thread.

Program received signal SIGTERM, Terminated.
0x00007ffff43f7a50 in GeomVertexWriter::inc_add_pointer() () from /usr/lib64/panda3d/libpanda.so
(gdb) bt
#0  0x00007ffff43f7a50 in GeomVertexWriter::inc_add_pointer() () from /usr/lib64/panda3d/libpanda.so
#1  0x00007ffff4947524 in GeomPrimitive::make_points() const () from /usr/lib64/panda3d/libpanda.so
#2  0x00007ffff4947f30 in Geom::make_points_in_place() () from /usr/lib64/panda3d/libpanda.so
#3  0x00007ffff446c4f3 in CullableObject::munge_geom(GraphicsStateGuardianBase*, GeomMunger*, CullTraverser const*, bool) () from /usr/lib64/panda3d/libpanda.so
#4  0x00007ffff447a439 in CullResult::add_object(CullableObject*, CullTraverser const*) () from /usr/lib64/panda3d/libpanda.so
#5  0x00007ffff446d7b6 in GeomNode::add_for_draw(CullTraverser*, CullTraverserData&) () from /usr/lib64/panda3d/libpanda.so
#6  0x00007ffff4480b33 in CullTraverser::traverse_below(CullTraverserData&) () from /usr/lib64/panda3d/libpanda.so
#7  0x00007ffff4480a6a in CullTraverser::traverse_below(CullTraverserData&) () from /usr/lib64/panda3d/libpanda.so
#8  0x00007ffff4480a6a in CullTraverser::traverse_below(CullTraverserData&) () from /usr/lib64/panda3d/libpanda.so
#9  0x00007ffff4480a6a in CullTraverser::traverse_below(CullTraverserData&) () from /usr/lib64/panda3d/libpanda.so
#10 0x00007ffff44810d8 in CullTraverser::traverse(NodePath const&) () from /usr/lib64/panda3d/libpanda.so
#11 0x00007ffff484e4df in GraphicsEngine::do_cull(CullHandler*, SceneSetup*, GraphicsStateGuardian*, Thread*) () from /usr/lib64/panda3d/libpanda.so
#12 0x00007ffff4855157 in GraphicsEngine::cull_to_bins(GraphicsOutput*, DisplayRegion*, Thread*) () from /usr/lib64/panda3d/libpanda.so
#13 0x00007ffff4855829 in GraphicsEngine::cull_to_bins(ov_set<PointerTo<GraphicsOutput>, IndirectLess<GraphicsOutput> > const&, Thread*) () from /usr/lib64/panda3d/libpanda.so
#14 0x00007ffff4856038 in GraphicsEngine::WindowRenderer::do_frame(GraphicsEngine*, Thread*) () from /usr/lib64/panda3d/libpanda.so
#15 0x00007ffff4856de7 in GraphicsEngine::render_frame() () from /usr/lib64/panda3d/libpanda.so
#16 0x00007ffff487e2e5 in ?? () from /usr/lib64/panda3d/libpanda.so
#17 0x00000000004a7c5e in PyEval_EvalFrameEx ()
#18 0x00000000004a9671 in PyEval_EvalCodeEx ()
#19 0x0000000000537620 in ?? ()
#20 0x000000000041f0c7 in PyObject_Call ()
#21 0x0000000000427dff in ?? ()
#22 0x000000000041f0c7 in PyObject_Call ()
#23 0x00007ffff48b7a5d in Thread::call_python_func(_object*, _object*) () from /usr/lib64/panda3d/libpanda.so
#24 0x00007ffff48ceb32 in PythonTask::do_python_task() () from /usr/lib64/panda3d/libpanda.so
---Type <return> to continue, or q <return> to quit---
#25 0x00007ffff48d44bb in AsyncTask::unlock_and_do_task() () from /usr/lib64/panda3d/libpanda.so
#26 0x00007ffff48de101 in AsyncTaskChain::service_one_task(AsyncTaskChain::AsyncTaskChainThread*) () from /usr/lib64/panda3d/libpanda.so
#27 0x00007ffff48dec19 in AsyncTaskChain::do_poll() () from /usr/lib64/panda3d/libpanda.so
#28 0x00007ffff48dedb1 in AsyncTaskManager::poll() () from /usr/lib64/panda3d/libpanda.so
#29 0x00007ffff48eff55 in ?? () from /usr/lib64/panda3d/libpanda.so
#30 0x00000000004a7c5e in PyEval_EvalFrameEx ()
#31 0x00000000004a8550 in PyEval_EvalFrameEx ()
#32 0x00000000004a9671 in PyEval_EvalCodeEx ()
#33 0x00000000004a7809 in PyEval_EvalFrameEx ()
#34 0x00000000004a8550 in PyEval_EvalFrameEx ()
#35 0x00000000004a9671 in PyEval_EvalCodeEx ()
#36 0x00000000004a9742 in PyEval_EvalCode ()
#37 0x00000000004c9a0e in PyRun_FileExFlags ()
#38 0x00000000004c9c24 in PyRun_SimpleFileExFlags ()
#39 0x000000000041a7ff in Py_Main ()
#40 0x00007ffff69d9c4d in __libc_start_main () from /lib/libc.so.6
#41 0x00000000004199f9 in _start ()
(gdb) 

i dont think my panda build has debug symbols enabled.