[osg-users] DatabasePager Crash

Jeff White jeladi at yahoo.com
Tue Apr 5 07:39:25 PDT 2016


I am running a osgEarth-based (v2.7) application that uses OpenSceneGraph 3.4.0 built with mingw (gcc v.4.9.2).  When I am running in cache-only mode on some machines I am seeing a crash in the osgDB::DatabasePager class. I have seen some traffic in the past related to DatabasePager issues so I figured it would be worth asking on here.  It is crashing on a OSG info log statement which seems strange.  It looks like it is trying to iterate over an empty container.  Has anyone seen this behavior before?  My OSG_NUM_DATABASE_THREADS are set to 4 and the machine it crashes on has 8 cores.  I tried setting the value to 8 and still got the same result.


 Here is the call stack along with some information from GDB:

(gdb) info threads
  Id   Target Id         Frame
  18   Thread 8804.0x1ce8 0x77dd1f86 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\Windows\SysWOW64\ntdll.dll
  17   Thread 8804.0x1738 0x77dd019d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
  16   Thread 8804.0x210c 0x77dd019d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
  15   Thread 8804.0x213c 0x61d50a0a in std::_List_const_iterator<osg::ref_ptr<osg::Object> >::operator++ (this=0x54bbfd10)
    at C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_list.h:244
* 14   Thread 8804.0x18e8 0x77dd019d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
  13   Thread 8804.0x15e8 0x77dd019d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
  12   Thread 8804.0x1dd0 0x77dd019d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
  7    Thread 8804.0x1e98 0x77dd019d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
  5    Thread 8804.0x1d48 0x77dcfdd1 in ntdll!ZwDelayExecution () from C:\Windows\SysWOW64\ntdll.dll
  4    Thread 8804.0x910 0x77dd1f86 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\Windows\SysWOW64\ntdll.dll
  3    Thread 8804.0x2190 0x77dd1f86 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\Windows\SysWOW64\ntdll.dll
  2    Thread 8804.0xb14 0x77dd019d in ntdll!ZwWaitForMultipleObjects () from C:\Windows\SysWOW64\ntdll.dll
  1    Thread 8804.0x3ac 0x77de805d in ntdll!RtlGetNtGlobalFlags () from C:\Windows\SysWOW64\ntdll.dll
(gdb) thread 15
[Switching to thread 15 (Thread 8804.0x213c)]
#0  0x61d50a0a in std::_List_const_iterator<osg::ref_ptr<osg::Object> >::operator++ (this=0x54bbfd10)
    at C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_list.h:244
244     C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_list.h: No such file or directory.
(gdb) bt
#0  0x61d50a0a in std::_List_const_iterator<osg::ref_ptr<osg::Object> >::operator++ (this=0x54bbfd10)
    at C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_list.h:244
#1  0x61d8a093 in std::__distance<std::_List_const_iterator<osg::ref_ptr<osg::Object> > > (__first=..., __last=...)
    at C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_iterator_base_funcs.h:82
#2  0x61d9740c in std::distance<std::_List_const_iterator<osg::ref_ptr<osg::Object> > > (__first=..., __last=...)
    at C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_iterator_base_funcs.h:118
#3  0x61d3e48c in std::list<osg::ref_ptr<osg::Object>, std::allocator<osg::ref_ptr<osg::Object> > >::size (this=0x3b905d7c)
    at C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/bits/stl_list.h:887
#4  0x61cd828c in osgDB::DatabasePager::DatabaseThread::run (this=0x3c3285a0)
    at C:\msys\1.0\home\MWoodJ\Projects\OSG\OpenSceneGraph-3.4.0\src\osgDB\DatabasePager.cpp:731
#5  0x66a08538 in OpenThreads::ThreadPrivateActions::StartThread(void*)@4 (data=0x3c3285ac)
    at C:\msys\1.0\home\MWoodJ\Projects\OSG\OpenSceneGraph-3.4.0\src\OpenThreads\win32\Win32Thread.cpp:113
#6  0x77131287 in msvcrt!_itow_s () from C:\Windows\syswow64\msvcrt.dll
#7  0x77131328 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll
#8  0x7757336a in KERNEL32!BaseThreadInitThunk () from C:\Windows\syswow64\kernel32.dll
#9  0x77de9882 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#10 0x77de9855 in ntdll!RtlInitializeExceptionChain () from C:\Windows\SysWOW64\ntdll.dll
#11 0x00000000 in ?? ()


(gdb) frame 4
#4  0x61cd828c in osgDB::DatabasePager::DatabaseThread::run (this=0x3c3285a0)
    at C:\msys\1.0\home\MWoodJ\Projects\OSG\OpenSceneGraph-3.4.0\src\osgDB\DatabasePager.cpp:731
731     C:\msys\1.0\home\MWoodJ\Projects\OSG\OpenSceneGraph-3.4.0\src\osgDB\DatabasePager.cpp: No such file or directory.


(gdb) info locals
fileLocationCallback = {_ptr = 0x0}
databaseRequest = {_ptr = 0x0}
readFromFileCache = false
fileCache = {_ptr = 0x0}
dr_loadOptions = {_ptr = 0x0}
fileName = {static npos = <optimized out>,
  _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
    _M_p = 0x3ab7e0c4 "î_î_î_î_î_î_î_î_î_î_L\033¿\b"}}
frameNumberLastRequest = 0
cacheNodes = false
firstTime = false
read_queue = {_ptr = 0x3b905d40}
out_queue = {_ptr = 0x3b923cf8}



(gdb) print read_queue
$3 = {_ptr = 0x3b905d40}
(gdb) print read_queue->size()
$4 = 0
(gdb) print _mode
$5 = osgDB::DatabasePager::DatabaseThread::HANDLE_NON_HTTP


(gdb) print _pager->_fileRequestQueue
$6 = {_ptr = 0x3b905d40}
(gdb) print _pager->_fileRequestQueue->size()
$7 = 0
(gdb) print _pager->_fileRequestQueue->_childrenToDeleteList
$8 = {<std::_List_base<osg::ref_ptr<osg::Object>, std::allocator<osg::ref_ptr<osg::Object> > >> = {
    _M_impl = {<std::allocator<std::_List_node<osg::ref_ptr<osg::Object> > >> = {<__gnu_cxx::new_allocator<std::_List_node<os
g::ref_ptr<osg::Object> > >> = {<No data fields>}, <No data fields>}, _M_node = {_M_next = 0x3b905d7c,
        _M_prev = 0x3b905d7c}}}, <No data fields>}
(gdb) print _pager->_fileRequestQueue->_childrenToDeleteList->size()
Cannot resolve method osgDB::DatabasePager::ObjectList::size to any overloaded instance
(gdb) print _pager->_fileRequestQueue->_childrenToDeleteList->size
$9 = {std::list<osg::ref_ptr<osg::Object>, std::allocator<osg::ref_ptr<osg::Object> > >::size_type (const std::list<osg::ref_
ptr<osg::Object>, std::allocator<osg::ref_ptr<osg::Object> > > * const)} 0x61d3e460 <std::list<osg::ref_ptr<osg::Object>, std
::allocator<osg::ref_ptr<osg::Object> > >::size() const>
(gdb) print _pager->_fileRequestQueue->_childrenToDeleteList.size()
$10 = 0

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=66732#66732








More information about the osg-users mailing list