Re: Help with assertion bug

Matthieu Kraus <[email protected]> Mon, 06 Jan 2014 08:21:22 +0100
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <[email protected]>
Greetings,

For now you may safely ignore the assert.

The reason this asserts is that SpatialTree does loads of sanity  
checks in debug mode,
one of them being checking for valid objects on insertion. Accordingly  
this fails as
the object shouldn't be added as it isn't a valid object at all. Now  
this is fine as long
as the object is valid by the time it's distributed in the tree which  
is probably the case
for you, however it still triggers that assertion on insertion as it's  
easier to track things
down that way.

I'll dig around a bit, but the proper fix to that assertion firing for  
you should probably
be to not not prepare meshes upon creation as preparing registers them  
to the culler which
isn't exactly a sane operation on an empty mesh. Alternatively  
occluvis could detect that
and not insert such objects at this point - might be worth checking  
with frustvis and dynavis
whether they handle this gracefully or not.

kind regards,
RlyDontKnow


Zitat von Ralph Campbell <[email protected]>:

> I'm trying to debug a problem with PlaneShift and Crystalspace.
> I configured CS --enable-debug and ran PS.
> You can see in the trace below, there is an assertion when a portal
> is created. The assertion is due to the csPortalContainer bounding
> box being uninitialized which makes sense since the csPortalContainer
> is created and then the portal vertices are added.
> I'm not sure what the correct fix would be.
> Any help is appreciated.
>
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x00000039adc0ee6b in raise (sig=5)
>     at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
> 37	  return INLINE_SYSCALL (tgkill, 3, pid, THREAD_GETMEM (THREAD_SELF, tid),
> (gdb) bt
> #0  0x00000039adc0ee6b in raise (sig=5)
>     at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
> #1  0x00007ffff778895e in CS::Debug::DebugBreak () at  
> ./include/cssysdef.h:971
> #2  0x00007ffff7788bce in CS::Debug::AssertMessage (
>     expr=0x7fff9b6ef169 "min <= max",
>     filename=0x7fff9b6eed70 "./include/csgeom/spatialtree.h", line=752,
>     msg=0x0) at /devel/ralphc/CS_LATEST/libs/csutil/csassert.cpp:82
> #3  0x00007fff9b6df748 in  
> CS::Geometry::SpatialTree<CS::Geometry::KDTree<CS::Geometry::SpatialTreeChild::BoxChild<true> >, CS::Geometry::SpatialTreeChild::BoxChild<true> >::AddObject (this=0x7fffd18b2598, bounds=...,  
> object=0x7fffc925d8a0)
>     at ./include/csgeom/spatialtree.h:752
> #4  0x00007fff9b6da1b7 in csFrustumVis::RegisterVisObject (
>     this=0x7fff9947e950, visobj=0x7fff9947ec08)
>     at /devel/ralphc/CS_LATEST/plugins/culling/frustvis/frustvis.cpp:317
> #5  0x00007fffe9cba4db in csSector::RegisterMeshToCuller  
> (this=0x7fffc919f6a0,
>     mesh=0x7fff9947ec00)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:215
> #6  0x00007fffe9cba606 in csSector::PrepareMesh (this=0x7fffc919f6a0,
>     mesh=0x7fff9947ec00)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:230
> #7  0x00007fffe9cb8de0 in csSectorMeshList::PrepareMesh (this=0x7fffc919f738,
>     item=0x7fff9947ec00)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:59
> #8  0x00007fffe9c0dbdc in CS::Plugin::Engine::csMeshList::Add (
>     this=0x7fffc919f738, obj=0x7fff9947ec00)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/meshobj.cpp:1268
> #9  0x00007fffe9c09db5 in CS::Plugin::Engine::csMeshWrapper::MoveToSector (
>     this=0x7fff9947eba0, s=0x7fffc919f700)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/meshobj.cpp:375
> #10 0x00007fffe9cba2ac in csSector::PrepareMovable (this=0x7fffc919f6a0,
>     movable=0x7fff9947ec80)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/sector.cpp:184
> #11 0x00007ffff78e7973 in CS::Engine::MovableSectorList::PrepareSector (
>     this=0x7fff9947ecf0, sector=0x7fffc919f700)
>     at /devel/ralphc/CS_LATEST/libs/cstool/basemovable.cpp:49
> #12 0x00007ffff78e85b9 in CS::Engine::BaseMovable::SetSector (
>     this=0x7fff9947ec68, sector=0x7fffc919f700)
>     at /devel/ralphc/CS_LATEST/libs/cstool/basemovable.cpp:156
> #13 0x00007fffe9c82720 in csEngine::CreateMeshWrapper (this=0x7fffec8ee4f8,
>     mesh=0x7fffa2efc0c0, name=0x7fffa47f3c48 "_p_npcroom",
>     sector=0x7fffc919f700, pos=..., addToList=true)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:3008
> #14 0x00007fffe9c81d24 in csEngine::CreatePortalContainer (
>     this=0x7fffec8ee4f8, name=0x7fffa47f3c48 "_p_npcroom",
>     sector=0x7fffc919f700, pos=...)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:2895
> ---Type <return> to continue, or q <return> to quit---
> #15 0x00007fffe9c8234e in csEngine::CreatePortal (this=0x7fffec8ee4f8,
>     name=0x7fffa47f3c48 "_p_npcroom", sourceSector=0x7fffc919f700, pos=...,
>     destSector=0x0, vertices=0x7fffa5a8d220, num_vertices=4, portal=
>     @0x7fffa4778bc8: 0xcacacacacacacaca)
>     at /devel/ralphc/CS_LATEST/plugins/engine/3d/engine.cpp:2966
> #16 0x00007fffe7d380e9 in  
> CS::Plugin::bgLoader::BgLoader::Portal::LoadObject (
>     this=0x7fffa4778a28) at  
> src/plugins/common/bgloader/loader_objects.cpp:385
> #17 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
>     this=0x7fffa4778a28, wait=false)
>     at src/plugins/common/bgloader/loader.h:547
> #18 0x00007fffe7d3c5c7 in  
> CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Portal>::LoadObjects (this=0x7fffa478fb08,  
> wait=false)
>     at src/plugins/common/bgloader/loader.h:953
> #19 0x00007fffe7d38a2f in  
> CS::Plugin::bgLoader::BgLoader::Sector::LoadObject (
>     this=0x7fffa478f980, wait=false)
>     at src/plugins/common/bgloader/loader_objects.cpp:482
> #20 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
>     this=0x7fffa478f980, wait=false)
>     at src/plugins/common/bgloader/loader.h:547
> #21 0x00007fffe7d52895 in  
> CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Sector>::LoadObjects (this=0x7fffa478b6e8,  
> wait=false)
>     at src/plugins/common/bgloader/loader.h:953
> #22 0x00007fffe7d4933c in CS::Plugin::bgLoader::BgLoader::Zone::LoadObject (
>     this=0x7fffa478b640, wait=false)
>     at src/plugins/common/bgloader/loader.h:1665
> #23 0x00007fffe7d03878 in CS::Plugin::bgLoader::BgLoader::Loadable::Load (
>     this=0x7fffa478b640, wait=false)
>     at src/plugins/common/bgloader/loader.h:547
> #24 0x00007fffe7d1b761 in  
> CS::Plugin::bgLoader::BgLoader::ObjectLoader<CS::Plugin::bgLoader::BgLoader::Zone>::LoadObjects (this=0x7fffe8bbd3f8,  
> wait=false)
>     at src/plugins/common/bgloader/loader.h:953
> #25 0x00007fffe7d1212e in CS::Plugin::bgLoader::BgLoader::LoadZones (
>     this=0x7fffe8bbc540, regions=0x7fffd174c070, priority=false)
>     at src/plugins/common/bgloader/loader.cpp:233
> #26 0x000000000042f544 in ZoneHandler::LoadZone (this=0x13f00c0, pos=...,
>     yrot=0, sector=0x7fffffffd6b8 "NPCroom", vel=..., force=false)
>     at src/client/zonehandler.cpp:238
> #27 0x000000000042f293 in ZoneHandler::HandleMessage (this=0x13f00c0,
>     me=0x12a7dd0) at src/client/zonehandler.cpp:206
> #28 0x000000000040e956 in psClientNetSubscriber::HandleMessage (
>     this=0x13f00c0, msg=0x12a7dd0) at ./src/common/net/cmdbase.h:73
> #29 0x0000000000619172 in MsgHandler::Publish (this=0x126a780, me=0x12a7dd0)
>     at src/common/net/msghandler.cpp:76
> #30 0x00000000004568e2 in psCelClient::HandleWorld (this=0x13ef7a0,
>     me=0x7fff80000f00) at src/client/pscelclient.cpp:237
> #31 0x000000000045a69e in psCelClient::HandleMessage (this=0x13ef7a0,
> ---Type <return> to continue, or q <return> to quit---
>     me=0x7fff80000f00) at src/client/pscelclient.cpp:823
> #32 0x000000000040e956 in psClientNetSubscriber::HandleMessage (
>     this=0x13ef7a0, msg=0x7fff80000f00) at ./src/common/net/cmdbase.h:73
> #33 0x0000000000619172 in MsgHandler::Publish (this=0x126a780,
>     me=0x7fff80000f00) at src/common/net/msghandler.cpp:76
> #34 0x00000000005db225 in ClientMsgHandler::DispatchQueue (this=0x126a780)
>     at src/common/net/clientmsghandler.cpp:93
> #35 0x00000000005db1c8 in ClientMsgHandler::HandleEvent (this=0x126a780)
>     at src/common/net/clientmsghandler.cpp:76
> #36 0x00000000005daac3 in ClientMsgHandler::EventHandler::HandleEvent (
>     this=0x7fffd187f2f0, event=...) at ./src/common/net/clientmsghandler.h:73
> #37 0x00007ffff77dca01 in csEventTree::Dispatch (this=0xafb530, e=...)
>     at /devel/ralphc/CS_LATEST/libs/csutil/cssubscription.cpp:576
> #38 0x00007ffff77dc8e7 in csEventTree::Notify (this=0xafb530)
>     at /devel/ralphc/CS_LATEST/libs/csutil/cssubscription.cpp:546
> #39 0x00007ffff776f25d in csEventQueue::Notify (this=0x7ffff0fa6690,  
> name=...)
>     at /devel/ralphc/CS_LATEST/libs/csutil/cseventq.cpp:239
> #40 0x00007ffff776f350 in csEventQueue::Process (this=0x7ffff0fa6690)
>     at /devel/ralphc/CS_LATEST/libs/csutil/cseventq.cpp:255
> #41 0x00007ffff77fe673 in csDefaultRunLoop (r=0x7ffff0f87e78)
>     at /devel/ralphc/CS_LATEST/libs/csutil/generic/runloop.cpp:99
> #42 0x00000000004ab4ff in main (argc=1, argv=0x7fffffffdf98)
>     at src/client/psengine.cpp:1993
>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of  
> AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Crystal-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crystal-develop




------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk