-
Notifications
You must be signed in to change notification settings - Fork 627
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
fix a freeze when returning from fullscreen to maximized @nvidia #20
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
CLAs look good, thanks! |
Hey, the ANGLE project only accepts patches on our code review site. Please follow the directions here: https://github.com/google/angle/blob/master/doc/ContributingCode.md |
…ors on map operations The wrapper should be a no-op on builds with assertions disabled. The wrapper should be useful on ASAN and MSAN builds. gn args out/release-asan --args="is_debug=false is_asan=true" ninja -C out/release-asan angle_end2end_tests ^ out\release-asan\angle_end2end_tests ^ --gtest_filter=Texture2DArrayCopy.SnormFormats* --gtest_catch_exceptions=0 ^ --gtest_repeat=-1 Output when the fix payload of angleproject:2865 is removed: ... Repeating all tests (iteration 1) . . . Note: Google Test filter = Texture2DArrayCopy.SnormFormats* [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from Texture2DArrayCopy [ RUN ] Texture2DArrayCopy.SnormFormats/ES3_D3D11 ================================================================= ==500==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x12b2c4777040 at pc 0x7fff9602216b bp 0x00c0eaafd090 sp 0x00c0eaafd0d8 READ of size 1 at 0x12b2c4777040 thread T0 #0 0x7fff9602216a in angle::R8G8B8A8::readColor c:\Users\kkinnunen\angle\src\image_util\imageformats.cpp:333 google#1 0x7fff9618dbf0 in rx::CopyImageCHROMIUM c:\Users\kkinnunen\angle\src\libANGLE\renderer\renderer_utils.cpp:377 google#2 0x7fff96186bb2 in rx::Image11::CopyImage c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\d3d11\Image11.cpp:113 google#3 0x7fff95e90410 in rx::Renderer11::copyImage c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\d3d11\Renderer11.cpp:3009 google#4 0x7fff9617b447 in rx::TextureD3D_2DArray::copyTexture c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\TextureD3D.cpp:3293 google#5 0x7fff95afd7e1 in gl::Texture::copyTexture c:\Users\kkinnunen\angle\src\libANGLE\Texture.cpp:1196 google#6 0x7fff95977f19 in gl::Context::copyTexture3D c:\Users\kkinnunen\angle\src\libANGLE\Context.cpp:4347 google#7 0x7fff9568b04a in gl::CopyTexture3DANGLE c:\Users\kkinnunen\angle\src\libGLESv2\entry_points_gles_ext_autogen.cpp:57 google#8 0x7ff7d1d8fc97 in angle::CopyTexture3DTest::testCopy c:\Users\kkinnunen\angle\src\tests\gl_tests\CopyTexture3DTest.cpp:90 google#9 0x7ff7d1dadd10 in angle::Texture2DArrayCopy_SnormFormats_Test::TestBody c:\Users\kkinnunen\angle\src\tests\gl_tests\CopyTexture3DTest.cpp:1272 google#10 0x7ff7d2c22891 in testing::Test::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:2522 google#11 0x7ff7d2c243c0 in testing::TestInfo::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:2698 google#12 0x7ff7d2c253e8 in testing::TestSuite::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:2828 google#13 0x7ff7d2c3f33e in testing::internal::UnitTestImpl::RunAllTests c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:5285 google#14 0x7ff7d2c3e72d in testing::UnitTest::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:4873 google#15 0x7ff7d2bf10a2 in main c:\Users\kkinnunen\angle\src\tests\angle_end2end_tests_main.cpp:15 google#16 0x7ff7d2d27897 in __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283 google#17 0x7ff801ec7973 in BaseThreadInitThunk+0x13 (C:\WINDOWS\System32\KERNEL32.DLL+0x180017973) google#18 0x7ff804cea270 in RtlUserThreadStart+0x20 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18006a270) 0x12b2c4777040 is located 0 bytes to the right of 256-byte region [0x12b2c4776f40,0x12b2c4777040) allocated by thread T0 here: #0 0x7ff7d2c6d574 in malloc C:\b\s\w\ir\k\src\third_party\llvm\projects\compiler-rt\lib\asan\asan_malloc_win.cc:68 google#1 0x7fff95af47b2 in angle::MemoryBuffer::resize c:\Users\kkinnunen\angle\src\common\MemoryBuffer.cpp:40 google#2 0x7fff9648c9a6 in rx::MappedSubresourceVerifier11::wrap c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\d3d11\MappedSubresourceVerifier11.cpp:51 google#3 0x7fff961864b5 in rx::Image11::map c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\d3d11\Image11.cpp:648 google#4 0x7fff9618676c in rx::Image11::CopyImage c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\d3d11\Image11.cpp:93 google#5 0x7fff95e90410 in rx::Renderer11::copyImage c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\d3d11\Renderer11.cpp:3009 google#6 0x7fff9617b447 in rx::TextureD3D_2DArray::copyTexture c:\Users\kkinnunen\angle\src\libANGLE\renderer\d3d\TextureD3D.cpp:3293 google#7 0x7fff95afd7e1 in gl::Texture::copyTexture c:\Users\kkinnunen\angle\src\libANGLE\Texture.cpp:1196 google#8 0x7fff95977f19 in gl::Context::copyTexture3D c:\Users\kkinnunen\angle\src\libANGLE\Context.cpp:4347 google#9 0x7fff9568b04a in gl::CopyTexture3DANGLE c:\Users\kkinnunen\angle\src\libGLESv2\entry_points_gles_ext_autogen.cpp:57 google#10 0x7ff7d1d8fc97 in angle::CopyTexture3DTest::testCopy c:\Users\kkinnunen\angle\src\tests\gl_tests\CopyTexture3DTest.cpp:90 google#11 0x7ff7d1dadd10 in angle::Texture2DArrayCopy_SnormFormats_Test::TestBody c:\Users\kkinnunen\angle\src\tests\gl_tests\CopyTexture3DTest.cpp:1272 google#12 0x7ff7d2c22891 in testing::Test::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:2522 google#13 0x7ff7d2c243c0 in testing::TestInfo::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:2698 google#14 0x7ff7d2c253e8 in testing::TestSuite::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:2828 google#15 0x7ff7d2c3f33e in testing::internal::UnitTestImpl::RunAllTests c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:5285 google#16 0x7ff7d2c3e72d in testing::UnitTest::Run c:\Users\kkinnunen\angle\third_party\googletest\src\googletest\src\gtest.cc:4873 google#17 0x7ff7d2bf10a2 in main c:\Users\kkinnunen\angle\src\tests\angle_end2end_tests_main.cpp:15 google#18 0x7ff7d2d27897 in __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283 google#19 0x7ff801ec7973 in BaseThreadInitThunk+0x13 (C:\WINDOWS\System32\KERNEL32.DLL+0x180017973) google#20 0x7ff804cea270 in RtlUserThreadStart+0x20 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18006a270) Bug: angleproject:2865 Change-Id: I6c8fc203d075014ba8ce31c728982eed73812d04 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1640212 Commit-Queue: Kimmo Kinnunen FI <[email protected]> Reviewed-by: Geoff Lang <[email protected]>
This CL improves performance compared to the existing code as well as allows using non-std mutex implementations. Also acts as a base for future changes. CL adds new build option: angle_enable_global_mutex_recursion = is_android && angle_enable_vulkan "mutex_recursion" work same way as `std::recursive_mutex` before. It will help in situations when Vulkan API may return back to the ANGLE. For example: RenderDoc layer EGL deadlock. Automatic loading of "libVkLayer_GLES_RenderDoc.so" layer causes deadlock in EGL. Recursion stack: google#1 pc 000000000029ea80 /vendor/lib64/egl/libGLESv2_angle.so (egl::GlobalMutexHelper::lock(int)+596) google#2 pc 000000000029c59c /vendor/lib64/egl/libGLESv2_angle.so (EGL_GetError+32) google#4 pc 0000000000062368 /system/lib64/libEGL.so (eglQueryString+20) google#5 pc 0000000000508fec /data/local/debug/vulkan/libVkLayer_GLES_RenderDoc.so google#20 pc 0000000000016690 /system/lib64/libvulkan.so (vulkan::api::EnumerateInstanceLayerProperties(unsigned int*, VkLayerProperties*)+40) google#21 pc 00000000005aa030 /vendor/lib64/egl/libGLESv2_angle.so (rx::RendererVk::initialize(rx::DisplayVk*, egl::Display*, char const*, char const*)+292) google#26 pc 000000000029c7e8 /vendor/lib64/egl/libGLESv2_angle.so (EGL_Initialize+192) Additionally, recursive mutex will partially solve Android SurfaceTexture deadlock (angleproject:4354). Some performance numbers for 1000'000 `eglGetError()` calls. Mutex Time (ms.) Android S906B egl::GetGlobalMutex()(std::recursive_mutex) 41.4 (Default) GlobalMutex (std::recursive_mutex) 39.1 (Recursive) GlobalMutex (std::mutex) 34.9 (Debug) GlobalMutex (std::mutex) 34.7 (Default) GlobalMutex (std::mutex) 34.4 Windows egl::GetGlobalMutex()(std::recursive_mutex) 20.5 (Default) GlobalMutex (std::recursive_mutex) 20.0 (Recursive) GlobalMutex (std::mutex) 21.9 (Debug) GlobalMutex (std::mutex) 20.5 (Default) GlobalMutex (std::mutex) 19.9 Note: Recursive GlobalMutex enabled only for Android Vulkan by default. Original fix: https://chromium-review.googlesource.com/c/angle/angle/+/2029218 Bug: angleproject:8101 Bug: angleproject:4354 Test: angle_unittests --gtest_filter=GlobalMutexTest.* Change-Id: I9e9d9b5c598ad1177ffa147ea690bd955946a712 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4401940 Commit-Queue: Igor Nazarov <[email protected]> Reviewed-by: Charlie Lao <[email protected]> Reviewed-by: Shahbaz Youssefi <[email protected]>
Option is for Android Vulkan. Fixes the recursion problem: #00 pc 000000000004d69c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) (BuildId: dda896312b8ac9c639f6aeb0175b8a0a) #1 pc 0000000000051e84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+144) (BuildId: dda896312b8ac9c639f6aeb0175b8a0a) #2 pc 00000000000b41b4 /apex/com.android.runtime/lib64/bionic/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+236) (BuildId: dda896312b8ac9c639f6aeb0175b8a0a) #3 pc 00000000003d8274 /vendor/lib64/egl/libGLESv2_angle.so (std::__Cr::mutex::lock()+12) (BuildId: 203fee8f1cfe9c18) google#4 pc 0000000000336494 /vendor/lib64/egl/libGLESv2_angle.so (egl::SharedContextMutex<std::__Cr::mutex>::doLock()+132) (BuildId: 203fee8f1cfe9c18) google#5 pc 000000000033668c /vendor/lib64/egl/libGLESv2_angle.so (egl::SharedContextMutex<std::__Cr::mutex>::lock()+124) (BuildId: 203fee8f1cfe9c18) google#6 pc 00000000001d6e08 /vendor/lib64/egl/libGLESv2_angle.so (EGL_ClientWaitSyncKHR+100) (BuildId: 203fee8f1cfe9c18) google#7 pc 00000000000674f0 /system/lib64/libEGL.so (android::eglClientWaitSyncKHRImpl(void*, void*, int, unsigned long)+112) (BuildId: c4698b8b366f6519dbd7bd3a5f6239f2) google#8 pc 0000000000086648 /system/lib64/libgui.so (android::BufferQueueProducer::dequeueBuffer(int*, android::sp<android::Fence>*, unsigned int, unsigned int, int, unsigned long, unsigned long*, android::FrameEventHistoryDelta*)+3240) (BuildId: ff35b91736084ee7c49efe908fb9f8f3) google#9 pc 00000000000e24fc /system/lib64/libgui.so (android::Surface::dequeueBuffer(ANativeWindowBuffer**, int*)+392) (BuildId: ff35b91736084ee7c49efe908fb9f8f3) google#10 pc 0000000000755770 /system/lib64/libhwui.so (android::uirenderer::renderthread::ReliableSurface::hook_dequeueBuffer(ANativeWindow*, int (*)(ANativeWindow*, ANativeWindowBuffer**, int*), void*, ANativeWindowBuffer**, int*)+80) (BuildId: 0ab7d7584ac800860c4d180557441d1b) google#11 pc 00000000000e0b48 /system/lib64/libgui.so (android::Surface::hook_dequeueBuffer(ANativeWindow*, ANativeWindowBuffer**, int*)+92) (BuildId: ff35b91736084ee7c49efe908fb9f8f3) google#12 pc 000000000002cc8c /system/lib64/libvulkan.so (vulkan::driver::AcquireNextImageKHR(VkDevice_T*, VkSwapchainKHR_T*, unsigned long, VkSemaphore_T*, VkFence_T*, unsigned int*)+280) (BuildId: 0c72f8685858f73fbb13fd68d401bba5) google#13 pc 0000000000266f08 /vendor/lib64/egl/libGLESv2_angle.so (rx::(anonymous namespace)::TryAcquireNextImageUnlocked(VkDevice_T*, VkSwapchainKHR_T*, rx::impl::ImageAcquireOperation*)+128) (BuildId: 203fee8f1cfe9c18) google#14 pc 000000000026495c /vendor/lib64/egl/libGLESv2_angle.so (rx::WindowSurfaceVk::acquireNextSwapchainImage(rx::vk::Context*)+140) (BuildId: 203fee8f1cfe9c18) google#15 pc 0000000000265800 /vendor/lib64/egl/libGLESv2_angle.so (rx::WindowSurfaceVk::doDeferredAcquireNextImageWithUsableSwapchain(gl::Context const*)+148) (BuildId: 203fee8f1cfe9c18) google#16 pc 0000000000267bb4 /vendor/lib64/egl/libGLESv2_angle.so (rx::WindowSurfaceVk::getBufferAge(gl::Context const*, int*)+196) (BuildId: 203fee8f1cfe9c18) google#17 pc 000000000034143c /vendor/lib64/egl/libGLESv2_angle.so (egl::Surface::getBufferAge(gl::Context const*, int*)+36) (BuildId: 203fee8f1cfe9c18) google#18 pc 000000000036c354 /vendor/lib64/egl/libGLESv2_angle.so (egl::QuerySurfaceAttrib(egl::Display const*, gl::Context const*, egl::Surface*, int, int*)+812) (BuildId: 203fee8f1cfe9c18) google#19 pc 00000000001d1674 /vendor/lib64/egl/libGLESv2_angle.so (egl::QuerySurface(egl::Thread*, egl::Display*, egl::SurfaceID, int, int*)+176) (BuildId: 203fee8f1cfe9c18) google#20 pc 00000000001d3658 /vendor/lib64/egl/libGLESv2_angle.so (EGL_QuerySurface+200) (BuildId: 203fee8f1cfe9c18) Happens only on platforms that use "EGL_KHR_fence_sync" instead of "EGL_ANDROID_native_fence_sync" for synchronization. Happens only on specific Surface types, that using `EGLConsumer`/`GLConsumer`, such as `SurfaceTexture`. The Android's "testDrawingHardwareBitmapNotLeaking" test may be used for testing the issue. Note: in order to reproduce, `SingleContextMutex` must not be used by context. The "Fix ExternalImageTarget EGLImage race" CL will achieve that. To check what extension is used, call: adb shell "dumpsys SurfaceFlinger | grep 'Sync configuration'" Possible results: Sync configuration: [using: EGL_KHR_fence_sync EGL_KHR_wait_sync] Sync configuration: [using: EGL_ANDROID_native_fence_sync EGL_KHR_wait_sync] Bug: angleproject:4354 Change-Id: I915a2c026b59af0a2098ae6b3300f773b29cbfbb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4733831 Commit-Queue: Igor Nazarov <[email protected]> Reviewed-by: Shahbaz Youssefi <[email protected]>
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: ... google#7 pc 0000000000627740 /vendor/lib64/egl/libGLESv2_samsung.so (gl::LogMessage::~LogMessage()+140) (BuildId: acced3587e668343) google#8 pc 000000000027e79c /vendor/lib64/egl/libGLESv2_samsung.so (EGL_GetError+360) (BuildId: acced3587e668343) google#9 pc 000000000007c14c /system/lib64/libEGL.so (android::eglGetErrorImpl()+28) (BuildId: 5b32b014e5c062afdd3d1abd3ba13dd2) google#10 pc 0000000000079464 /system/lib64/libEGL.so (eglDestroyImageKHR+20) (BuildId: 5b32b014e5c062afdd3d1abd3ba13dd2) google#11 pc 000000000000e540 /system/lib64/libnativedisplay.so (android::EGLConsumer::EglImage::~EglImage()+44) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) google#12 pc 000000000000e598 /system/lib64/libnativedisplay.so (android::EGLConsumer::EglImage::~EglImage()+16) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) google#13 pc 000000000000e434 /system/lib64/libnativedisplay.so (android::EGLConsumer::onFreeBufferLocked(int)+156) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) google#14 pc 000000000000bda0 /system/lib64/libnativedisplay.so (android::SurfaceTexture::freeBufferLocked(int)+48) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd) google#15 pc 00000000000bc294 /system/lib64/libgui.so (android::ConsumerBase::onBuffersReleased()+172) (BuildId: f219f4196018eeed01e28ec428c73c99) google#16 pc 000000000008d9d4 /system/lib64/libgui.so (android::BufferQueue::ProxyConsumerListener::onBuffersReleased()+92) (BuildId: f219f4196018eeed01e28ec428c73c99) google#17 pc 0000000000099608 /system/lib64/libgui.so (android::BufferQueueProducer::disconnect(int, android::IGraphicBufferProducer::DisconnectMode)+184) (BuildId: f219f4196018eeed01e28ec428c73c99) google#18 pc 00000000000eb3ec /system/lib64/libgui.so (android::Surface::disconnect(int, android::IGraphicBufferProducer::DisconnectMode)+268) (BuildId: f219f4196018eeed01e28ec428c73c99) google#19 pc 00000000000eaf04 /system/lib64/libgui.so (android::Surface::hook_perform(ANativeWindow*, int, ...)+264) (BuildId: f219f4196018eeed01e28ec428c73c99) google#20 pc 0000000000031214 /system/lib64/libvulkan.so (vulkan::driver::DestroySurfaceKHR(VkInstance_T*, VkSurfaceKHR_T*, VkAllocationCallbacks const*)+56) (BuildId: 44c563855311012ead3ce5e7afdb9792) google#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) google#22 pc 0000000000522114 /vendor/lib64/egl/libGLESv2_samsung.so (angle::UnlockedTailCall::runImpl(void*)+56) (BuildId: acced3587e668343) google#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 <[email protected]> Commit-Queue: Igor Nazarov <[email protected]>
proceeding to 'if (FAILED(result))' block freezes my application. happens at least on windows 7, 8.1 and 10