0

I am getting lots of warnings from OpenSceneGraph and all look like this:

    Warning:: Picked up error in TriangleIntersect
   (-117448 -2.12751e+06 -519242,   -120167 -2.17679e+06 -383117,   -234607 -1.85755e+06 -431865)
   (-nan,   -nan,   -nan)

And unfortunately I cannot trace the origin of them.

I tried to launch my program, then interrupt it with CTRL + C and with bt print the back-trace. It gives me only some basic trace from application workflow like:

#0  0x00007fffe8116bf9 in __GI___poll (fds=0x5555584549f0, nfds=3, timeout=461) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffe45395c9 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffe45396dc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff2a2897f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff29cd9fa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff29d6aa4 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

The warnings occur when entering: void osgViewer::ViewerBase::frame()

I tried to enter it also but it escapes immediately, prints the warnings and continues the program flow. I suppose it triggers some actions maybe in other threads.

And here comes my question, is there a chance of getting to the origin/trace of those warning messages with GDB?

I am using OpenSceneGraph 3.4

Kyeiv
  • 63
  • 8
  • That should be simple enough. Search the source code to find where the warning messages get emitted, and set a breakpoint there. – Sam Varshavchik Sep 13 '19 at 11:03
  • But they are emitted from the dynamic linked OpenSceneGraph so I don't have its source code, that's why I am looking for a way to get warning's back-trace to get to where my code triggers it – Kyeiv Sep 13 '19 at 11:06
  • You can try to catch `SIGFPE` signal in GDB. See related question https://stackoverflow.com/q/5393997/72178. – ks1322 Sep 13 '19 at 11:37
  • If you don't have the source code, there's nothing you can do. On Linux, I would simply load the library's debug package that has all the source, and the debug symbols. Then it's a simple matter of setting a breakpoint in gdb. You cannot debug code without its source. – Sam Varshavchik Sep 13 '19 at 11:50
  • looks like [`osg::notify`](https://github.com/openscenegraph/OpenSceneGraph/blob/bd50af117bed340b14b5bf13da6a8efe893f4ce7/include/osg/Notify#L82) would be a good location for a breakpoint – Alan Birtles Sep 13 '19 at 13:17

1 Answers1

1

The error is coming from this line: https://github.com/jklimke/osg/blob/master/src/osgUtil/LineSegmentIntersector.cpp#L174

That code and error isn't even in the current trunk/head OSG source, so maybe your problem could be resolved by simply updating to the latest version of OSG.

XenonofArcticus
  • 573
  • 2
  • 7