We're seeing a crash in our app sometimes when glDeleteTextures is being called from the main thread. Our stack traces look like this:
Main thread:
#0 0x00007fff8d666282 in __pthread_kill () #1 0x00007fff902124c3 in pthread_kill () #2 0x00007fff8739bb73 in abort () #3 0x00007fff949c7bd9 in gpusGenerateCrashLog () #4 0x000012340043395c in gpusKillClient () #5 0x00007fff949c8f73 in gpusSubmitDataBuffers () #6 0x0000123400003cd6 in IntelCommandBuffer::getNew(GLDContextRec*) () #7 0x0000123400106b35 in intelSubmitCommands () #8 0x00007fff94b55c52 in gleUnbindTextureObject () #9 0x00007fff94b23e65 in gleUnbindDeleteHashNamesAndObjects () #10 0x00007fff94a22766 in glDeleteTextures_Exec () #11 0x000000010057e5a7 in juce::OpenGLTexture::release() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLTexture.cpp:176 #12 0x000000010057e4b8 in juce::OpenGLTexture::~OpenGLTexture() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLTexture.cpp:41 #13 0x000000010057c045 in juce::OpenGLTexture::~OpenGLTexture() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLTexture.cpp:40 #14 0x000000010058ed79 in juce::OpenGLRendering::CachedImageList::CachedImage::~CachedImage() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp:102 #15 0x000000010058ec75 in juce::OpenGLRendering::CachedImageList::CachedImage::~CachedImage() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp:99 #16 0x000000010058ec4a in juce::ContainerDeletePolicy<juce::OpenGLRendering::CachedImageList::CachedImage>::destroy(juce::OpenGLRendering::CachedImageList::CachedImage*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/../juce_gui_extra/../juce_gui_basics/../juce_graphics/../juce_core/memory/juce_ContainerDeletePolicy.h:48 #17 0x000000010058ec04 in juce::ScopedPointer<juce::OpenGLRendering::CachedImageList::CachedImage>::~ScopedPointer() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/../juce_gui_extra/../juce_gui_basics/../juce_graphics/../juce_core/memory/juce_ScopedPointer.h:100 #18 0x000000010058ebe5 in juce::ScopedPointer<juce::OpenGLRendering::CachedImageList::CachedImage>::~ScopedPointer() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/../juce_gui_extra/../juce_gui_basics/../juce_graphics/../juce_core/memory/juce_ScopedPointer.h:100 #19 0x000000010058eacc in juce::OwnedArray<juce::OpenGLRendering::CachedImageList::CachedImage, juce::DummyCriticalSection>::remove(int, bool) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/../juce_gui_extra/../juce_gui_basics/../juce_graphics/../juce_core/containers/juce_OwnedArray.h:606 #20 0x000000010059cfaf in juce::OpenGLRendering::CachedImageList::imageDataBeingDeleted(juce::ImagePixelData*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp:161 #21 0x000000010059d09f in non-virtual thunk to juce::OpenGLRendering::CachedImageList::imageDataBeingDeleted(juce::ImagePixelData*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp:171 #22 0x00000001003550ee in void juce::ListenerList<juce::ImagePixelData::Listener, juce::Array<juce::ImagePixelData::Listener*, juce::DummyCriticalSection, 0> >::call<juce::ImagePixelData*>(void (juce::ImagePixelData::Listener::*)(juce::ImagePixelData*), juce::TypeHelpers::ParameterType<juce::ImagePixelData*>::type) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/../juce_events/broadcasters/juce_ListenerList.h:167 #23 0x00000001002d9b5c in juce::ImagePixelData::~ImagePixelData() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/images/juce_Image.cpp:34 #24 0x00000001003b4a89 in juce::CoreGraphicsImage::~CoreGraphicsImage() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm:52 #25 0x00000001003b4745 in juce::CoreGraphicsImage::~CoreGraphicsImage() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm:49 #26 0x00000001003b4769 in juce::CoreGraphicsImage::~CoreGraphicsImage() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm:49 #27 0x00000001003abb8e in juce::ContainerDeletePolicy<juce::ImagePixelData>::destroy(juce::ImagePixelData*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/../juce_core/memory/juce_ContainerDeletePolicy.h:48 #28 0x00000001003abb3c in juce::ReferenceCountedObjectPtr<juce::ImagePixelData>::decIfNotNull(juce::ImagePixelData*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/../juce_core/memory/juce_ReferenceCountedObject.h:366 #29 0x0000000100355559 in juce::ReferenceCountedObjectPtr<juce::ImagePixelData>::operator=(juce::ImagePixelData*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/../juce_core/memory/juce_ReferenceCountedObject.h:299 #30 0x00000001003553b0 in juce::ReferenceCountedObjectPtr<juce::ImagePixelData>::operator=(juce::ReferenceCountedObjectPtr<juce::ImagePixelData> const&) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/../juce_core/memory/juce_ReferenceCountedObject.h:274 #31 0x00000001002c17cf in juce::Image::operator=(juce::Image const&) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_graphics/images/juce_Image.cpp:226 #32 0x000000010053f053 in juce::StandardCachedComponentImage::releaseResources() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_gui_basics/components/juce_Component.cpp:815 #33 0x00000001003c4378 in juce::Component::setVisible(bool) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_gui_basics/components/juce_Component.cpp:532
OpenGL thread:
#0 0x00007fff8d666132 in __psynch_cvwait () #1 0x00007fff90210ea0 in _pthread_cond_wait () #2 0x00000001001f182a in juce::WaitableEvent::wait(int) const at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_core/native/juce_posix_SharedCode.h:97 #3 0x00000001002a95e7 in juce::MessageManagerLock::attemptLock(juce::Thread*, juce::ThreadPoolJob*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_events/messages/juce_MessageManager.cpp:315 #4 0x00000001002a941b in juce::MessageManagerLock::MessageManagerLock(juce::Thread*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_events/messages/juce_MessageManager.cpp:272 #5 0x00000001002a971d in juce::MessageManagerLock::MessageManagerLock(juce::Thread*) at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_events/messages/juce_MessageManager.cpp:274 #6 0x00000001005868b7 in juce::OpenGLContext::CachedImage::renderFrame() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLContext.cpp:168 #7 0x0000000100587d71 in juce::OpenGLContext::CachedImage::run() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLContext.cpp:375 #8 0x0000000100587e5c in non-virtual thunk to juce::OpenGLContext::CachedImage::run() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_opengl/opengl/juce_OpenGLContext.cpp:382 #9 0x00000001001f258e in juce::Thread::threadEntryPoint() at /Users/cbrown/Development/bittorrent-tv/deps/third-party/juce/modules/juce_core/threads/juce_Thread.cpp:101
This is on OS X (Yosemite). My instincts tell me that the call is being made when the OpenGL context isn't actually current. I don't believe our application-specific code is doing anything particular interesting here. We just have a full screen OpenGL context with some components on top.
I can try to make a minimal example app, but this crash is actually kind of rare.
I should also note that this is using a January 3rd build of JUCE. I scanned through the commit history and didn't see anything that looked relevant, but I'll definitely try this with the latest and confirm that it's still there (though it may take a while).
Any ideas?