Gerrit Voss wrote: > Hi, > > On Mon, 2007-03-26 at 20:22 -0500, Allen Bierbaum wrote: > >> I seem to be very lucky this week, I ran into another very nasty bug. :( >> >> I narrowed it down to this section of code in my application: >> >> OSG::NodePtr model_xform = getModelXform(modelId); >> OSG_ASSERT(model_xform != OSG::NullFC && "Model xform is NULL"); >> OSG::commitChanges(); >> >> OSG_ASSERT(mRootNode.node()->findChild(model_xform) != -1); >> mRootNode.node()->subChild(model_xform); >> >> OSG::commitChanges(); // loop forever >> >> model_xform is a transform node with a textured model under it made up >> of a screen size LOD and several sub-trees of of material groups and >> geometries (data loaded from a VRML model). >> >> When I call the final commitChanges, OpenSG becomes stuck in an infinite >> loop. I added some debug code and found that the >> ContainerChangeEntry::commitChanges keeps getting called over and over >> for the same field container. In all cases it was looping over and over >> on an Image container. With a bit of investigation and some remote >> support from Dirk, we found that if I commented out the contents of >> Image::changed then the code would not loop forever. So for now I have >> just removed that code and will keep running without it until I can get >> some advice from someone on what may be causing this problem. >> > > looking at the code actually I wonder why the image ever worked. > Changed just unconditionally sets internal variables and this should > loop forever all the time. > > That is what we thought too, but then we thought "no way, everyone would see this bug". :)
> So the bug actually is that there are cases where it does not ;-) which > after looking into some other code pieces becomes clear. > > I'll fix that one and try to work backward from there. > Good. > Currently commit is setup to loop until all (including dependent) > changes are committed. Which means if you create change circles it will > loop forever. > > The options you have to limit the amount of loops are either to use > a fixed upper limited on the number of loops or restrict the looping > that per commit a container is only touched once. > > Both look artificial to me so I would prefer to have a loop free changed > setup. > Any idea of a way to automatically detect when a loop happens in debug mode and warn the user? -Allen > regards, > gerrit > > > > > > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Opensg-core mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/opensg-core > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Opensg-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-core
