Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on loading skybox texture asset #394

Closed
hhyyrylainen opened this issue Aug 22, 2019 · 12 comments
Closed

Crash on loading skybox texture asset #394

hhyyrylainen opened this issue Aug 22, 2019 · 12 comments
Labels
type: bug Something isn't working
Milestone

Comments

@hhyyrylainen
Copy link
Contributor

https://discourse.bsframework.io/t/random-skybox-texture-loading-crash/500?u=hhyyrylainen

Applying this diff to examples:

diff --git a/Source/SkeletalAnimation/Main.cpp b/Source/SkeletalAnimation/Main.cpp
index 3c9b87a..778d3a9 100644
--- a/Source/SkeletalAnimation/Main.cpp
+++ b/Source/SkeletalAnimation/Main.cpp
@@ -88,7 +88,8 @@ namespace bs
                assets.exampleMaterial->setTexture("gMetalnessTex", assets.exampleMetalnessTex);
 
                // Load an environment map
-               assets.exampleSkyCubemap = ExampleFramework::loadTexture(ExampleTexture::EnvironmentRathaus, false, true, true);
+        assets.exampleSkyCubemap = bs::gResources().load<bs::Texture>(exampleDataPath + "Materials/Thrive_ocean_skybox.asset");
+        // assets.exampleSkyCubemap = ExampleFramework::loadTexture(ExampleTexture::EnvironmentRathaus, false, true, true);
 
                return assets;
        }
@@ -212,4 +213,4 @@ int main()
        Application::shutDown();
 
        return 0;
-}
\ No newline at end of file
+}

And putting this: https://boostslair.com/files/temp/thrive/Thrive_ocean_skybox.asset asset in: bsfExamples/Data/Materials
Results in this crash:

0  in ?? of /lib64/libnvidia-glcore.so.430.40
1  in ?? of /lib64/libnvidia-glcore.so.430.40
2  in ?? of /lib64/libnvidia-glcore.so.430.40
3  in ?? of /lib64/libnvidia-glcore.so.430.40
4  in ?? of /lib64/libnvidia-glcore.so.430.40
5  in ?? of /lib64/libnvidia-glcore.so.430.40
6  in ?? of /lib64/libnvidia-glcore.so.430.40
7  in bs::ct::GLTextureBuffer::upload of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Plugins/bsfGLRenderAPI/BsGLPixelBuffer.cpp:263
8  in bs::ct::GLTexture::writeDataImpl of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Plugins/bsfGLRenderAPI/BsGLTexture.cpp:445
9  in bs::ct::Texture::writeData of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Foundation/bsfCore/Image/BsTexture.cpp:358
10 in bs::Texture::<lambda(bs::SPtr<bs::ct::Texture>&, bs::UINT32, bs::UINT32, bs::SPtr<bs::PixelData>&, bool, bs::AsyncOp&)>::operator()(const bs::SPtr &, bs::UINT32, bs::UINT32, const bs::SPtr &, bool, bs::AsyncOp &) const of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Foundation/bsfCore/Image/BsTexture.cpp:127
11 in std::_Function_handler<void(const std::shared_ptr<bs::ct::Texture>&, unsigned int, unsigned int, const std::shared_ptr<bs::PixelData>&, bool, bs::AsyncOp&), bs::Texture::writeData(bs::SPtr<bs::PixelData>&, bs::UINT32, bs::UINT32, bool)::<lambda(bs::SPtr<bs::ct::Texture>&, bs::UINT32, bs::UINT32, bs::SPtr<bs::PixelData>&, bool, bs::AsyncOp&)> >::_M_invoke(const std::_Any_data &, const std::shared_ptr<bs::ct::Texture> &, unsigned int &&, unsigned int &&, const std::shared_ptr<bs::PixelData> &, bool &&, bs::AsyncOp &) of /usr/include/c++/8/bits/std_function.h:297
12 in std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)>::operator()(std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&) const of /usr/include/c++/8/bits/std_function.h:687
13 in std::__invoke_impl<void, std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)>&, std::shared_ptr<bs::ct::Texture>&, unsigned int&, unsigned int&, std::shared_ptr<bs::PixelData>&, bool&, bs::AsyncOp&>(std::__invoke_other, std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)>&, std::shared_ptr<bs::ct::Texture>&, unsigned int&, unsigned int&, std::shared_ptr<bs::PixelData>&, bool&, bs::AsyncOp&) of /usr/include/c++/8/bits/invoke.h:60
14 in std::__invoke<std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)>&, std::shared_ptr<bs::ct::Texture>&, unsigned int&, unsigned int&, std::shared_ptr<bs::PixelData>&, bool&, bs::AsyncOp&>(std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)>&, std::shared_ptr<bs::ct::Texture>&, unsigned int&, unsigned int&, std::shared_ptr<bs::PixelData>&, bool&, bs::AsyncOp&) of /usr/include/c++/8/bits/invoke.h:95
15 in std::_Bind<std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)> (std::shared_ptr<bs::ct::Texture>, unsigned int, unsigned int, std::shared_ptr<bs::PixelData>, bool, std::_Placeholder<1>)>::__call<void, bs::AsyncOp&, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul>(std::tuple<bs::AsyncOp&>&&, std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul, 5ul>) of /usr/include/c++/8/functional:400
16 in std::_Bind<std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)> (std::shared_ptr<bs::ct::Texture>, unsigned int, unsigned int, std::shared_ptr<bs::PixelData>, bool, std::_Placeholder<1>)>::operator()<bs::AsyncOp&, void>(bs::AsyncOp&) of /usr/include/c++/8/functional:484
17 in std::_Function_handler<void (bs::AsyncOp&), std::_Bind<std::function<void (std::shared_ptr<bs::ct::Texture> const&, unsigned int, unsigned int, std::shared_ptr<bs::PixelData> const&, bool, bs::AsyncOp&)> (std::shared_ptr<bs::ct::Texture>, unsigned int, unsigned int, std::shared_ptr<bs::PixelData>, bool, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&, bs::AsyncOp&) of /usr/include/c++/8/bits/std_function.h:297
18 in std::function<void (bs::AsyncOp&)>::operator()(bs::AsyncOp&) const of /usr/include/c++/8/bits/std_function.h:687
19 in bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*, std::function<void (unsigned int)>) of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Foundation/bsfCore/CoreThread/BsCommandQueue.cpp:113
20 in bs::CommandQueueBase::playback of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Foundation/bsfCore/CoreThread/BsCommandQueue.cpp:140
21 in std::__invoke_impl<void, void (bs::CommandQueueBase::*&)(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*), bs::CommandQueueBase*&, std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*&> of /usr/include/c++/8/bits/invoke.h:73
22 in std::__invoke<void (bs::CommandQueueBase::*&)(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*), bs::CommandQueueBase*&, std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*&> of /usr/include/c++/8/bits/invoke.h:95
23 in std::_Bind<void (bs::CommandQueueBase::*(bs::CommandQueueBase*, std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*))(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) of /usr/include/c++/8/functional:400
24 in std::_Bind<void (bs::CommandQueueBase::*(bs::CommandQueueBase*, std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*))(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*)>::operator()<, void>() of /usr/include/c++/8/functional:484
25 in std::_Function_handler<void (), std::_Bind<void (bs::CommandQueueBase::*(bs::CommandQueueBase*, std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*))(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*)> >::_M_invoke(std::_Any_data const&) of /usr/include/c++/8/bits/std_function.h:297
26 in std::function<void ()>::operator()() const of /usr/include/c++/8/bits/std_function.h:687
27 in bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*, std::function<void (unsigned int)>) of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Foundation/bsfCore/CoreThread/BsCommandQueue.cpp:124
28 in bs::CoreThread::runCoreThread of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Foundation/bsfCore/CoreThread/BsCoreThread.cpp:117
29 in std::__invoke_impl<void, void (bs::CoreThread::*&)(), bs::CoreThread*&> of /usr/include/c++/8/bits/invoke.h:73
30 in std::__invoke<void (bs::CoreThread::*&)(), bs::CoreThread*&> of /usr/include/c++/8/bits/invoke.h:95
31 in std::_Bind<void (bs::CoreThread::*(bs::CoreThread*))()>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) of /usr/include/c++/8/functional:400
32 in std::_Bind<void (bs::CoreThread::*(bs::CoreThread*))()>::operator()<, void>() of /usr/include/c++/8/functional:484
33 in std::_Function_handler<void (), std::_Bind<void (bs::CoreThread::*(bs::CoreThread*))()> >::_M_invoke(std::_Any_data const&) of /usr/include/c++/8/bits/std_function.h:297
34 in std::function<void ()>::operator()() const of /usr/include/c++/8/bits/std_function.h:687
35 in bs::PooledThread::run of /home/hhyyrylainen/Projects/bsfExamples/bsf/Source/Foundation/bsfUtility/Threading/BsThreadPool.cpp:122
36 in std::__invoke_impl<void, void (bs::PooledThread::*&)(), bs::PooledThread*&> of /usr/include/c++/8/bits/invoke.h:73
37 in std::__invoke<void (bs::PooledThread::*&)(), bs::PooledThread*&> of /usr/include/c++/8/bits/invoke.h:95
38 in std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) of /usr/include/c++/8/functional:400
39 in std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()>::operator()<, void>() of /usr/include/c++/8/functional:484
40 in std::__invoke_impl<void, std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()>>(std::__invoke_other, std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()>&&) of /usr/include/c++/8/bits/invoke.h:60
41 in std::__invoke<std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()>>(std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()>&&) of /usr/include/c++/8/bits/invoke.h:95
42 in std::thread::_Invoker<std::tuple<std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()> > >::_M_invoke<0ul>(std::_Index_tuple<0ul>) of /usr/include/c++/8/thread:244
43 in std::thread::_Invoker<std::tuple<std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()> > >::operator()() of /usr/include/c++/8/thread:253
44 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (bs::PooledThread::*(bs::PooledThread*))()> > > >::_M_run() of /usr/include/c++/8/thread:196
45 in ?? of /lib64/libstdc++.so.6
46 in start_thread of /lib64/libpthread.so.0
47 in clone of /lib64/libc.so.6

This is on Linux with OpenGL and Vulkan (there's a slightly different crash there, but I don't have a callstack on hand for it right now).

There might be an additional crash lurking somewhere, but I can't try to locate it (see the thread I linked) because this crash always happens.

@BearishSun BearishSun added this to the v1.2 milestone Aug 22, 2019
@BearishSun BearishSun added the type: bug Something isn't working label Aug 22, 2019
@BearishSun
Copy link
Member

How was this texture asset created? The texture is a cubemap with 4 array slices which is strange.

@BearishSun
Copy link
Member

Never mind that, was looking at the wrong place in the debugger.

@hhyyrylainen
Copy link
Contributor Author

I didn't have an actual skybox. So I used the option to import a single texture as all the skybox faces. bs::CubemapSourceType::Single

@BearishSun
Copy link
Member

I cannot reproduce this issue, tried with OpenGL on Windows and Ubuntu, using the Skeletal Example and the provided cubemap asset, both debug and release build configurations.

It could be something hardware specific. What is your GPU?

@hhyyrylainen
Copy link
Contributor Author

My GPU is GTX 1080 Ti

@BearishSun
Copy link
Member

That's the same as mine. Since I cannot reproduce the only option is you to debug it on your end. Try breaking with the debugger when it crashes and see if you can deduce in more detail which part failed and if any of the input values look weird.

@hhyyrylainen
Copy link
Contributor Author

hhyyrylainen commented Aug 24, 2019

To me everything just looks initialized, and with possible sizes:

(gdb) p *this
$2 = (bs::ct::GLTextureBuffer) {
  <bs::ct::GLPixelBuffer> = {
    _vptr.GLPixelBuffer = 0x7ffff42d81e0 <vtable for bs::ct::GLTextureBuffer+16>, 
    mSizeInBytes = 16777216, 
    mUsage = bs::GBU_STATIC, 
    mIsLocked = false, 
    mWidth = 2048, 
    mHeight = 2048, 
    mDepth = 1, 
    mFormat = bs::PF_RGBA8, 
    mCurrentLock = {
      <bs::GpuResourceData> = {
        <bs::IReflectable> = {
          _vptr.IReflectable = 0x7ffff7f061b0 <vtable for bs::PixelData+16>
        }, 
        members of bs::GpuResourceData: 
        mData = 0x0, 
        mOwnsData = false, 
        mLocked = false
      }, 
      members of bs::PixelData: 
      mExtents = {
        left = 0, 
        top = 0, 
        right = 0, 
        bottom = 0, 
        front = 0, 
        back = 1
      }, 
      mFormat = bs::PF_UNKNOWN, 
      mRowPitch = 0, 
      mSlicePitch = 0
    }, 
    mLockedBox = {
      left = 0, 
      top = 0, 
      right = 1, 
      bottom = 1, 
      front = 0, 
      back = 1
    }, 
    mBuffer = {
      <bs::GpuResourceData> = {
        <bs::IReflectable> = {
          _vptr.IReflectable = 0x7ffff7f061b0 <vtable for bs::PixelData+16>
        }, 
        members of bs::GpuResourceData: 
        mData = 0x0, 
        mOwnsData = false, 
        mLocked = false
      }, 
      members of bs::PixelData: 
      mExtents = {
        left = 0, 
        top = 0, 
        right = 2048, 
        bottom = 2048, 
        front = 0, 
        back = 1
      }, 
      mFormat = bs::PF_RGBA8, 
      mRowPitch = 2048, 
      mSlicePitch = 4194304
    }, 
    mCurrentLockOptions = bs::GBL_READ_WRITE
  }, 
  members of bs::ct::GLTextureBuffer: 
  mTarget = 34067, 
  mFaceTarget = 34069, 
  mTextureID = 125, 
  mFace = 0, 
  mLevel = 0, 
  mMultisampleCount = 0, 
  mHwGamma = false
}
(gdb) info args
this = 0x7fffeae08aa0
data = @0x4715590: {
  <bs::GpuResourceData> = {
    <bs::IReflectable> = {
      _vptr.IReflectable = 0x7ffff7f061b0 <vtable for bs::PixelData+16>
    }, 
    members of bs::GpuResourceData: 
    mData = 0x7fffb9fec010 "\035\071M\377\035\071M\377\034\071M\377\034\071M\377\034\071M\377\035\071M\377\035:M\377\036;M\377\036;M\377\037;M\377\037;M\377\037;M\377\037;M\377\037;M\377\037;M\377\037;M\377\036:M\377\035\071M\377\035\071M\377\034\071M\377\034\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035:M\377\035:M\377\035:M\377\035:M\377\035:M\377\035\071M\377\035\071M\377\035\071M\377\035:M\377\035:M\377\035:M\377\035:M\377\035:M\377\035\071M\377\035\071M\377\035:M\377\035:M\377\035\071M\377\035\071M\377\035\071M\377\035:M\377\035:M\377"..., 
    mOwnsData = true, 
    mLocked = true
  }, 
  members of bs::PixelData: 
  mExtents = {
    left = 0, 
    top = 0, 
    right = 2048, 
    bottom = 2048, 
    front = 0, 
    back = 1
  }, 
  mFormat = bs::PF_RGBA8, 
  mRowPitch = 8192, 
  mSlicePitch = 16777216
}
dest = @0x7ffff4d7d220: {
  left = 0, 
  top = 0, 
  right = 2048, 
  bottom = 2048, 
  front = 0, 
  back = 1
}
(gdb) p data.getData()
$3 = (bs::UINT8 *) 0x7fffb9fec010 "\035\071M\377\035\071M\377\034\071M\377\034\071M\377\034\071M\377\035\071M\377\035:M\377\036;M\377\036;M\377\037;M\377\037;M\377\037;M\377\037;M\377\037;M\377\037;M\377\037;M\377\036:M\377\035\071M\377\035\071M\377\034\071M\377\034\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035\071M\377\035:M\377\035:M\377\035:M\377\035:M\377\035:M\377\035\071M\377\035\071M\377\035\071M\377\035:M\377\035:M\377\035:M\377\035:M\377\035:M\377\035\071M\377\035\071M\377\035:M\377\035:M\377\035\071M\377\035\071M\377\035\071M\377\035:M\377\035:M\377"...
(gdb) p data.getSize()
$4 = 67108864

Edit: except it looks like the data buffer size (67108864) is different than the texture's size property (16777216)...

@BearishSun
Copy link
Member

Is your app running on an older version of bsf, but the texture was imported using a newer version?

That would explain what I'm seeing:

  • mBuffer.mSlicePitch is 4194304, which is the number of pixels, not bytes
  • data.getSize() returns the 4 times the required number of bytes (again, its interpreting the mSlicePitch as the number of pixels and then multiplying by 4 to convert to number of bytes)

Meaning of mSlicePitch was recently changed to store number of bytes, which would explain the discrepancy.

@hhyyrylainen
Copy link
Contributor Author

That is likely correct reasoning. I'm using the default version of the samples, with the version of bsf it's set to use. git submodule update does nothing. But the asset was imported with the version my PR (#391). Then, this is different from the (likely) timing issue with the skybox loading causing a crash.

@hhyyrylainen
Copy link
Contributor Author

I have not gotten this crash after I did this change: https://discourse.bsframework.io/t/resource-caching-doesnt-work/499/10?u=hhyyrylainen
That may have fixed it? Maybe it was an issue with something not waiting for the resource properly without registering the asset path?

@BearishSun
Copy link
Member

I'll close it for now, if you get the issue again feel free to re-open.

@hhyyrylainen
Copy link
Contributor Author

hhyyrylainen commented Sep 1, 2019

I think I got this again (I cut the on exit handler code):

#17 0x00007f6ebd21fe50 in on_exit () at /lib64/libc.so.6
#18 0x00007f6ebdddd331 in bs::signalHandler(int, siginfo_t*, void*) (signal=11, info=<optimized out>, context=<optimized out>)
    at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfUtility/Private/Unix/BsUnixCrashHandler.cpp:38
#19 0x00007f6ebd6f7070 in <signal handler called> () at /lib64/libpthread.so.0
#20 0x00007f6e544e192c in std::__shared_ptr<bs::ct::GLPixelBuffer, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__shared_ptr<bs::ct::GLPixcelBuffer, (__gnu_cxx::_Lock_policy)2> const&) (this=0x7f6dd2fa50c0) at /usr/include/c++/8/bits/shared_ptr_base.h:1165
#21 0x00007f6e544e192c in std::shared_ptr<bs::ct::GLPixelBuffer>::shared_ptr(std::shared_ptr<bs::ct::GLPixelBuffer> const&) (this=0x7f6dd2fa50c0) at /usr/include/c++/8/bits/shared_ptr.h:129
#22 0x00007f6e544e192c in bs::ct::GLTexture::getBuffer(unsigned int, unsigned int) (this=this@entry=0x90c6040, face=0, mipmap=0) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Plugins/bsfGLRenderAPI/BsGLTexture.cpp:539
#23 0x00007f6e544ec05a in bs::ct::GLRenderTexture::initialize() (this=<optimized out>) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfCore/RenderAPI/BsTextureView.h:75
#24 0x00007f6ebe2048c8 in bs::ct::TextureManager::createRenderTexture(bs::ct::RENDER_TEXTURE_DESC const&, unsigned int) (this=<optimized out>, desc=..., deviceIdx=deviceIdx@entry=0) at /usr/include/c++/8/bits/shared_ptr_base.h:1018
#25 0x00007f6ebe0d8253 in bs::ct::RenderTexture::create(bs::ct::RENDER_TEXTURE_DESC const&, unsigned int) (desc=..., deviceIdx=deviceIdx@entry=0) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfCore/RenderAPI/BsRenderTexture.cpp:230
#26 0x00007f6e4c4dc304 in bs::ct::RenderBeastIBLUtility::downsampleCubemap(std::shared_ptr<bs::ct::Texture> const&, unsigned int, std::shared_ptr<bs::ct::Texture> const&, unsigned int) (src=std::shared_ptr<bs::ct::Texture> (use count 3, weak count 1) = {...}, srcMip=1, dst=std::shared_ptr<bs::ct::Texture> (use count 5, weak count 1) = {...}, dstMip=0) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Plugins/bsfRenderBeast/BsRenderBeastIBLUtility.cpp:586
#27 0x00007f6e4c4dc602 in bs::ct::RenderBeastIBLUtility::scaleCubemap(std::shared_ptr<bs::ct::Texture> const&, unsigned int, std::shared_ptr<bs::ct::Texture> const&, unsigned int) const (this=<optimized out>, src=std::shared_ptr<bs::ct::Texture> (use count 6, weak count 1) = {...}, srcMip=1, dst=std::shared_ptr<bs::ct::Texture> (use count 5, weak count 1) = {...}, dstMip=0) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Plugins/bsfRenderBeast/BsRenderBeastIBLUtility.cpp:572
#28 0x00007f6ebdf74f2e in bs::Skybox::<lambda()>::operator() (__closure=0x7948150) at /usr/include/c++/8/ext/atomicity.h:96
#29 0x00007f6ebdf74f2e in std::_Function_handler<bool(), bs::Skybox::filterTexture()::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/8/bits/std_function.h:282
#30 0x00007f6ebdf1a3f7 in std::function<bool ()>::operator()() const (this=<optimized out>) at /usr/include/c++/8/bits/std_function.h:682
#31 0x00007f6ebdf1a3f7 in bs::ct::Renderer::<lambda()>::operator() (__closure=<optimized out>) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfCore/Renderer/BsRenderer.cpp:113
#32 0x00007f6ebdf1a3f7 in bs::ct::Renderer::processTasks(bool, unsigned long) (this=this@entry=0x8f7990, forceAll=forceAll@entry=false, upToFrame=upToFrame@entry=1417) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfCore/Renderer/BsRenderer.cpp:114
#33 0x00007f6e4c460812 in bs::ct::RenderBeast::renderAllCore(bs::ct::FrameTimings, bs::PerFrameData) (this=0x8f7990, timings=..., perFrameData=...) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Plugins/bsfRenderBeast/BsRenderBeast.cpp:394
#34 0x00007f6ebddf1cb1 in std::function<void ()>::operator()() const (this=0xb861790) at /usr/include/c++/8/bits/std_function.h:682
#35 0x00007f6ebddf1cb1 in bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*, std::function<void (unsigned int)>) (this=<optimized out>, commands=<optimized out>, notifyCallback=...) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfCore/CoreThread/BsCommandQueue.cpp:126
#36 0x00007f6ebddf29aa in bs::CommandQueueBase::playback(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*) (this=<optimized out>, commands=<optimized out>) at /usr/include/c++/8/bits/std_function.h:395
#37 0x00007f6ebddf1cb1 in std::function<void ()>::operator()() const (this=0xab7e7f0) at /usr/include/c++/8/bits/std_function.h:682
#38 0x00007f6ebddf1cb1 in bs::CommandQueueBase::playbackWithNotify(std::queue<bs::QueuedCommand, std::deque<bs::QueuedCommand, bs::StdAlloc<bs::QueuedCommand, bs::GenAlloc> > >*, std::function<void (unsigned int)>) (this=this@entry=0xedb5a0, commands=<optimized out>, commands@entry=0x7f6dc4100b90, notifyCallback=...) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfCore/CoreThread/BsCommandQueue.cpp:126
#39 0x00007f6ebddfe28d in bs::CoreThread::runCoreThread() (this=0x902a40) at /usr/include/c++/8/bits/std_function.h:87
#40 0x00007f6ebdd6e46c in std::function<void ()>::operator()() const (this=0x7f6dd2fa7ba0) at /usr/include/c++/8/bits/std_function.h:682
#41 0x00007f6ebdd6e46c in bs::PooledThread::run() (this=0xb0ff00) at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Foundation/bsfUtility/Threading/BsThreadPool.cpp:115
#42 0x00007f6ebd60f9a3 in  () at /lib64/libstdc++.so.6
#43 0x00007f6ebd6ec58e in start_thread () at /lib64/libpthread.so.0
#44 0x00007f6ebd2e2713 in clone () at /lib64/libc.so.6

That's the core thread. The main thread is waiting for a frame to complete.

Some analysis:

(gdb) frame 20
#20 std::__shared_ptr<bs::ct::GLPixelBuffer, (__gnu_cxx::_Lock_policy)2>::__shared_ptr (this=0x7f6dd2fa50c0)
    at /usr/include/c++/8/bits/shared_ptr_base.h:1165
1165	      __shared_ptr(const __shared_ptr&) noexcept = default;
(gdb) list
1160		__shared_ptr(const __shared_ptr<_Yp, _Lp>& __r,
1161			     element_type* __p) noexcept
1162		: _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws
1163		{ }
1164	
1165	      __shared_ptr(const __shared_ptr&) noexcept = default;
1166	      __shared_ptr& operator=(const __shared_ptr&) noexcept = default;
1167	      ~__shared_ptr() = default;
1168	
1169	      template<typename _Yp, typename = _Compatible<_Yp>>
(gdb) info locals
No locals.
(gdb) frame 21
#21 std::shared_ptr<bs::ct::GLPixelBuffer>::shared_ptr (this=0x7f6dd2fa50c0) at /usr/include/c++/8/bits/shared_ptr.h:129
129	      shared_ptr(const shared_ptr&) noexcept = default;
(gdb) l
124	       *  @brief  Construct an empty %shared_ptr.
125	       *  @post   use_count()==0 && get()==0
126	       */
127	      constexpr shared_ptr() noexcept : __shared_ptr<_Tp>() { }
128	
129	      shared_ptr(const shared_ptr&) noexcept = default;
130	
131	      /**
132	       *  @brief  Construct a %shared_ptr that owns the pointer @a __p.
133	       *  @param  __p  A pointer that is convertible to element_type*.
(gdb) frame 22
#22 bs::ct::GLTexture::getBuffer (this=this@entry=0x90c6040, face=0, mipmap=0)
    at /home/hhyyrylainen/Projects/Leviathan/ThirdParty/bsf/Source/Plugins/bsfGLRenderAPI/BsGLTexture.cpp:539
539			return mSurfaceList[idx];
(gdb) list
534			if (mipmap > mProperties.getNumMipmaps())
535				BS_EXCEPT(InvalidParametersException, "Mipmap index out of range");
536	
537			unsigned int idx = face * (mProperties.getNumMipmaps() + 1) + mipmap;
538			assert(idx < mSurfaceList.size());
539			return mSurfaceList[idx];
540		}
541	
542		SPtr<TextureView> GLTexture::createView(const TEXTURE_VIEW_DESC& desc)
543		{
(gdb) info locals
__PRETTY_FUNCTION__ =   "bs::SPtr<bs::ct::GLPixelBuffer> bs::ct::GLTexture::getBuffer(bs::UINT32, bs::UINT32)"
idx = 0
(gdb) info args
this = 0x90c6040
face = 0
mipmap = 0
(gdb) p *this
$1 = (bs::ct::GLTexture) {
  <bs::ct::Texture> = {
    <bs::ct::CoreObject> = {
      _vptr.CoreObject = 0x7f6e54569830 <vtable for bs::ct::GLTexture+16>, 
      mFlags = 2 '\002', 
      mThis = std::weak_ptr<bs::ct::CoreObject> (use count 5, weak count 1) = {
        get() = 0x90c6040
      }
    }, 
    members of bs::ct::Texture: 
    mTextureViews = std::unordered_map with 1 element = {
      [{
        mostDetailMip = 0, 
        numMips = 1, 
        firstArraySlice = 0, 
        numArraySlices = 1, 
        usage = bs::GVU_RENDERTARGET
      }] = std::shared_ptr<bs::ct::TextureView> (use count 2, weak count 0) = {
        get() = 0x7f6da4b9c710
      }
    }, 
    mProperties = {
      mDesc = {
        type = bs::TEX_TYPE_CUBE_MAP, 
        format = bs::PF_RG11B10F, 
        width = 256, 
        height = 256, 
        depth = 1, 
        numMips = 8, 
        usage = 513, 
        hwGamma = false, 
        numSamples = 0, 
        numArraySlices = 1
      }
    }, 
    mInitData = std::shared_ptr<bs::PixelData> (empty) = {
      get() = 0x0
    }
  }, 
  members of bs::ct::GLTexture: 
  mTextureID = 0, 
  mGLFormat = 0, 
  mInternalFormat = bs::PF_UNKNOWN, 
  mGLSupport = @0xa85f30, 
  mLockedBuffer = std::shared_ptr<bs::ct::GLPixelBuffer> (empty) = {
    get() = 0x0
  }, 
  mSurfaceList = std::vector of length 0, capacity 0
}

Let me know if there's more info you'd like me to dig up from the core file.

Edit: apparently I can't reopen this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants