New issue
Advanced search Search tips

Issue 921276 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 14
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 2
Type: Bug



Sign in to add a comment

failed vulkan init leads to crash in VulkanImplementation::Destroy

Project Member Reported by spang@google.com, Jan 12

Issue description

#01: pc 0x48c9315b28dc sp 0x39c67d001a78 (libc.so,0x168dc)                     
#02: base::debug::BreakDebugger() at debugger_posix.cc:?                                                        
#03: logging::LogMessage::~LogMessage() at logging.cc:?                               
#04: gpu::VulkanInstance::Destroy() at vulkan_instance.cc:?                           
#05: gpu::VulkanInstance::~VulkanInstance() at vulkan_instance.cc:?                   
#06: ui::VulkanImplementationScenic::~VulkanImplementationScenic() at vulkan_implementation_scenic.cc:?
#07: ui::VulkanImplementationScenic::~VulkanImplementationScenic() at vulkan_implementation_scenic.cc:?
#08: gpu::GpuInit::InitializeAndStartSandbox(base::CommandLine*, gpu::GpuPreferences const&) at gpu_init.cc:?
#09: content::GpuMain(content::MainFunctionParams const&) at gpu_main.cc:?            
#10: content::ContentMainRunnerImpl::Run(bool) at content_main_runner_impl.cc:?       
#11: service_manager::Main(service_manager::MainParams const&) at main.cc:?           
#12: content::ContentMain(content::ContentMainParams const&) at content_main.cc:?     
#13: main at shell_main.cc:?
#14: pc 0x48c9315b5f68 sp 0x39c67d002ee0 (libc.so,0x19f68)
#15: pc 0 sp 0x39c67d003000

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/263ece62deb62c7dc0920afdf8127ab8e5ae0709

commit 263ece62deb62c7dc0920afdf8127ab8e5ae0709
Author: Michael Spang <spang@chromium.org>
Date: Mon Jan 14 21:39:22 2019

gpu: vulkan: Fix double free of debug report callback after failed init

If VulkanInstance fails to initialize, Destroy() will be called twice,
once in VulkanImplementation::InitializeVulkanInstance() and once in the
destructor. The VkInstanceKHR is not double freed because there is a null
check.

Add a null check for the debug report callback, and also remove the
explicit Destroy() calls since there isn't a care where we'll retry a
failed vulkan initialization with the same object.

Bug:  921276 
Test: Run on fuchsia with partial vulkan layer/ext naming transition

Change-Id: I02b3b7dfba5bcebdc2d4010bcb2f2690f125e78e

Reviewed-on: https://chromium-review.googlesource.com/c/1407254
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622613}
[modify] https://crrev.com/263ece62deb62c7dc0920afdf8127ab8e5ae0709/gpu/vulkan/android/vulkan_implementation_android.cc
[modify] https://crrev.com/263ece62deb62c7dc0920afdf8127ab8e5ae0709/gpu/vulkan/vulkan_instance.cc
[modify] https://crrev.com/263ece62deb62c7dc0920afdf8127ab8e5ae0709/gpu/vulkan/vulkan_instance.h
[modify] https://crrev.com/263ece62deb62c7dc0920afdf8127ab8e5ae0709/gpu/vulkan/win32/vulkan_implementation_win32.cc
[modify] https://crrev.com/263ece62deb62c7dc0920afdf8127ab8e5ae0709/gpu/vulkan/x/vulkan_implementation_x11.cc
[modify] https://crrev.com/263ece62deb62c7dc0920afdf8127ab8e5ae0709/ui/ozone/platform/drm/gpu/vulkan_implementation_gbm.cc
[modify] https://crrev.com/263ece62deb62c7dc0920afdf8127ab8e5ae0709/ui/ozone/platform/scenic/vulkan_implementation_scenic.cc

Status: Fixed (was: Started)

Sign in to add a comment