osgearth icon indicating copy to clipboard operation
osgearth copied to clipboard

OSX: crash with TRACY profiler

Open remoe opened this issue 3 years ago • 4 comments

    tracy_force_inline void DeferItem( const QueueItem& item )
    {
        m_deferredLock.lock(); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        auto dst = m_deferredQueue.push_next();
        memcpy( dst, &item, sizeof( item ) );
        m_deferredLock.unlock();
    }

DisplaySettings::SHADER_GL3
_shaderPipelineNumTextureUnits = 4
libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
#11	0x00000001011888f1 in tracy::Profiler::DeferItem(tracy::QueueItem const&) [inlined] at tracy-0.7.8/include/client/TracyProfiler.hpp:578
#12	0x00000001011888d8 in tracy::LockableCtx::LockableCtx(tracy::SourceLocationData const*) [inlined] at tracy-0.7.8/include/client/TracyLock.hpp:33
#13	0x00000001011886d9 in tracy::LockableCtx::LockableCtx(tracy::SourceLocationData const*) [inlined] at tracy-0.7.8/include/client/TracyLock.hpp:23
#14	0x00000001011886ac in tracy::Lockable<std::__1::mutex>::Lockable(tracy::SourceLocationData const*) [inlined] at tracy-0.7.8/include/client/TracyLock.hpp:186
#15	0x000000010118866f in tracy::Lockable<std::__1::mutex>::Lockable(tracy::SourceLocationData const*) [inlined] at tracy-0.7.8/include/client/TracyLock.hpp:187
#16	0x0000000101188653 in osgEarth::Threading::Mutex::Mutex(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, unsigned int) at osgearth.git/src/osgEarth/Threading.cpp:87
#17	0x0000000101188afb in osgEarth::Threading::Mutex::Mutex(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, unsigned int) at osgearth.git/src/osgEarth/Threading.cpp:77
#18	0x0000000101068875 in osgEarth::Util::SymbolRegistry::instance() at osgearth.git/src/osgEarth/Symbol.cpp:31
#19	0x000000010030b235 in osgEarth::Util::RegisterSymbolProxy<osgEarth::Util::SimpleSymbolFactory<osgEarth::AltitudeSymbol> >::RegisterSymbolProxy(osgEarth::Util::SimpleSymbolFactory<osgEarth::AltitudeSymbol>*) at osgearth.git/src/osgEarth/Symbol:142
#20	0x00000001002fc55d in osgEarth::Util::RegisterSymbolProxy<osgEarth::Util::SimpleSymbolFactory<osgEarth::AltitudeSymbol> >::RegisterSymbolProxy(osgEarth::Util::SimpleSymbolFactory<osgEarth::AltitudeSymbol>*) at osgearth.git/src/osgEarth/Symbol:142
#21	0x000000010030d00c in ::__cxx_global_var_init.3() at osgearth.git/src/osgEarth/AltitudeSymbol.cpp:24
#22	0x000000010030d088 in _GLOBAL__sub_I_AltitudeSymbol.cpp ()

remoe avatar May 22 '21 13:05 remoe

It runs when one undef TRACY_ON_DEMAND in metrics.

remoe avatar May 22 '21 14:05 remoe

Is it sufficient to ifdef that out on Apple?

gwaldron avatar Jul 14 '21 17:07 gwaldron

when you mean undef TRACY_ON_DEMAND for Apple, yes.

remoe avatar Jul 24 '21 15:07 remoe

It throw an exception on other places in osgEarth like:

https://github.com/gwaldron/osgearth/blob/078e212dca6315aae8b153c8b4e1a11458ab4c43/src/osgEarth/Elevation.cpp#L206

    frame #8: 0x000000010391731f libosgEarthd.117.dylib`__clang_call_terminate + 15
    frame #9: 0x0000000103c9690a libosgEarthd.117.dylib`osgEarth::Threading::ScopedGate<void*>::~ScopedGate(this=0x000070000d4f0588) at Threading:454:23
    frame #10: 0x0000000103c8ef15 libosgEarthd.117.dylib`osgEarth::Threading::ScopedGate<void*>::~ScopedGate(this=0x000070000d4f0588) at Threading:452:9
  * frame #11: 0x0000000103c8d26e libosgEarthd.117.dylib`osgEarth::ElevationTexture::generateNormalMap(this=0x00000001204959f0, map=0x000000010f014800, workingSet=0x000000010c0985f8, progress=0x000000010e329e00) at Elevation.cpp:205:5

when 2 threads call "generateNormalMap"

Some information: https://stackoverflow.com/questions/66773247/libcabi-dylib-terminating-with-uncaught-exception-of-type-std-1system-er

remoe avatar Aug 20 '21 15:08 remoe