Commit 73252f349884dedd66a130e08d7d42d4b4c315c3

Igor Nazarov 2023-09-20T16:46:47

Fix ASSERT and potential bug with UnlockedTailCall ASSERT happened in the Instagram application. - record REEL using camera; - press "Next" button; - return to the previous screen; - ASSERT happens. Crash details: pid: 31451, tid: 2938, name: mediacompositio >>> com.instagram.android <<< signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- Abort message: 'FATAL: entry_points_egl_autogen.cpp:437 (EGL_GetError): ! Assert failed in EGL_GetError (../../src/libGLESv2/entry_points_egl_autogen.cpp:437): backtrace: ... #07 pc 0000000000627740 /vendor/lib64/egl/libGLESv2_samsung.so (gl::LogMessage::~LogMessage()+140) (BuildId: acced3587e668343) #08 pc 000000000027e79c /vendor/lib64/egl/libGLESv2_samsung.so (EGL_GetError+360) (BuildId: acced3587e668343) #09 pc 000000000007c14c /system/lib64/libEGL.so (android::eglGetErrorImpl()+28) (BuildId: 5b32b014e5c062afdd3d1abd3ba13dd2) #10 pc 0000000000079464 /system/lib64/libEGL.so (eglDestroyImageKHR+20) (BuildId: 5b32b014e5c062afdd3d1abd3ba13dd2) #11 pc 000000000000e540 /system/lib64/libnativedisplay.so (android::EGLConsumer::EglImage::~EglImage()+44) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) #12 pc 000000000000e598 /system/lib64/libnativedisplay.so (android::EGLConsumer::EglImage::~EglImage()+16) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) #13 pc 000000000000e434 /system/lib64/libnativedisplay.so (android::EGLConsumer::onFreeBufferLocked(int)+156) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) #14 pc 000000000000bda0 /system/lib64/libnativedisplay.so (android::SurfaceTexture::freeBufferLocked(int)+48) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) #15 pc 00000000000bc294 /system/lib64/libgui.so (android::ConsumerBase::onBuffersReleased()+172) (BuildId: f219f4196018eeed01e28ec428c73c99) #16 pc 000000000008d9d4 /system/lib64/libgui.so (android::BufferQueue::ProxyConsumerListener::onBuffersReleased()+92) (BuildId: f219f4196018eeed01e28ec428c73c99) #17 pc 0000000000099608 /system/lib64/libgui.so (android::BufferQueueProducer::disconnect(int, android::IGraphicBufferProducer::DisconnectMode)+184) (BuildId: f219f4196018eeed01e28ec428c73c99) #18 pc 00000000000eb3ec /system/lib64/libgui.so (android::Surface::disconnect(int, android::IGraphicBufferProducer::DisconnectMode)+268) (BuildId: f219f4196018eeed01e28ec428c73c99) #19 pc 00000000000eaf04 /system/lib64/libgui.so (android::Surface::hook_perform(ANativeWindow*, int, ...)+264) (BuildId: f219f4196018eeed01e28ec428c73c99) #20 pc 0000000000031214 /system/lib64/libvulkan.so (vulkan::driver::DestroySurfaceKHR(VkInstance_T*, VkSurfaceKHR_T*, VkAllocationCallbacks const*)+56) (BuildId: 44c563855311012ead3ce5e7afdb9792) #21 pc 000000000039bb40 /vendor/lib64/egl/libGLESv2_samsung.so (void std::__Cr::__function::__policy_invoker<void (void*)>::__call_impl<std::__Cr::__function::__default_alloc_func<rx::WindowSurfaceVk::destroy(egl::Display const*)::$_0, void (void*)> >(std::__Cr::__function::__policy_storage const*, void*)+140) (BuildId: acced3587e668343) #22 pc 0000000000522114 /vendor/lib64/egl/libGLESv2_samsung.so (angle::UnlockedTailCall::runImpl(void*)+56) (BuildId: acced3587e668343) #23 pc 000000000027dcec /vendor/lib64/egl/libGLESv2_samsung.so (EGL_DestroySurface+260) (BuildId: acced3587e668343) This CL will fix the ASSERT as well as remove possibility of calling same callback twice. Bug: angleproject:8127 Change-Id: I8e56981d0db2ef5723afedc22d5286421237444b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4874040 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>