Hello Michael,

Michael Raab wrote:
this is strange. I'm running not exactly the same example that I sent you but 
the changes I made to simplify shouldn't have any bigger impact.
I started to investigate the error in detail and this is what I got up to now:

- if I start only the client and 1 server no crash happens
- if I start more than one server the crash happens after each start
- your guess was right, one of the TileCameraDecoratorPtr::dcast() calls in 
MultiDisplayWindow::serverRender() failes, the one in line 244
- the cast failed as serverWindow->getPort(sv) is a ProjectionCameraDecorator; sv=2; serverWindow->getPort(sv) is of type FBOViewport clientPort->getType() is of type Viewport

Does this help? Any Suggestions?

I think I can reproduce it now if I resize a server window while everything is running. It looks as if that confuses the code to skip invisible viewports and somehow it handles an FBOViewport (with no TCD added by MDW) as if it was a regular Viewport (which would have the TCD). I've attached a patch for MDW that will make it report which ports are created/skipped, can you apply that and run your servers with it, that should give a better idea where the current code gets confused.

        Cheers,
                Carsten
Index: Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindow.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindow.cpp,v
retrieving revision 1.25
diff -u -r1.25 OSGMultiDisplayWindow.cpp
--- Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindow.cpp	9 Jun 2008 07:30:36 -0000	1.25
+++ Source/System/Cluster/Window/MultiDisplay/OSGMultiDisplayWindow.cpp	1 Jul 2010 15:47:19 -0000
@@ -182,6 +182,9 @@
             // then transmitting the texture doesn't seem like a good idea either.
             if(serverWindow->getMFPort()->size() <= sv)
             {
+                SLOG << "server id " << id << " sv " << sv << " cv " << cv
+                     << " new virtual port" << std::endl;
+
                 serverPort = ViewportPtr::dcast(clientPort->shallowCopy());
                 beginEditCP(serverWindow);
                 serverWindow->addPort(serverPort);
@@ -190,8 +193,13 @@
             else
             {
                 serverPort = serverWindow->getPort(sv);
-                if(serverWindow->getPort(sv)->getType() !=
-                        clientPort->getType())
+
+                SLOG << "server id " << id << " sv " << sv << " cv " << cv
+                     << " existing virtual port " << serverPort->getType().getCName()
+                     << " camera " << serverPort->getCamera()->getType().getCName()
+                     << std::endl;
+
+                if(serverPort->getType() != clientPort->getType())
                 {
                     // there is a viewport with the wrong type
                     subRefCP(serverWindow->getPort(sv));
@@ -220,6 +228,23 @@
                 cbottom > top       )
             {
                 // invisible on this server screen
+                SLOG << " server id " << id << " skipping vp " << cv
+                     << " cright "  << cright  << " left "   << left
+                     << " cleft "   << cleft   << " right "  << right
+                     << " ctop "    << ctop    << " bottom " << bottom
+                     << " cbottom " << cbottom << " top "    << top
+                     << "\n    "
+                     << " px left " << clientPort->getPixelLeft()
+                     << " px bot " << clientPort->getPixelBottom()
+                     << " px right " << clientPort->getPixelRight()
+                     << " px top " << clientPort->getPixelTop()
+                     << "\n    "
+                     << " left "  << clientPort->getLeft()
+                     << " bot "   << clientPort->getBottom()
+                     << " right " << clientPort->getRight()
+                     << " top "   << clientPort->getTop()
+                     << std::endl;
+
                 continue;
             }
             // calculate overlapping viewport
@@ -229,6 +254,9 @@
             t = osgMin(ctop   ,top   ) - bottom;
             if(serverWindow->getMFPort()->size() <= sv)
             {
+                SLOG << "server id " << id << " sv " << sv << " cv " << cv
+                     << " new port" << std::endl;
+
                 serverPort = ViewportPtr::dcast(clientPort->shallowCopy());
                 beginEditCP(serverPort);
                 deco=TileCameraDecorator::create();
@@ -241,9 +269,14 @@
             else
             {
                 serverPort = serverWindow->getPort(sv);
+
+                SLOG << "server id " << id << " sv " << sv << " cv " << cv
+                     << " existing port " << serverPort->getType().getCName()
+                     << " camera " << serverPort->getCamera()->getType().getCName()
+                     << std::endl;
+
                 deco = TileCameraDecoratorPtr::dcast(serverPort->getCamera());
-                if(serverWindow->getPort(sv)->getType() != 
-                        clientPort->getType())
+                if(serverPort->getType() != clientPort->getType())
                 {
                     // there is a viewport with the wrong type
                     subRefCP(serverWindow->getPort(sv));
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to