Fix crash on browser shutdown during SAML PIN
Skip making the closePinDialog() JavaScript call when the state says that no JavaScript calls are allowed. This may happen inside the GaiaScreenHandler destructor if the security token PIN dialog is active. Before this CL, the implementation was trying to close the active PIN dialog, which was causing a crash. Part of the example stack trace: base::debug::CollectStackTrace() base::debug::StackTrace::StackTrace() base::debug::(anonymous namespace)::StackDumpSignalHandler() <unknown> gsignal abort std::__terminate() __cxxabiv1::failed_throw() __cxa_throw std::__Cr::__throw_length_error() std::__Cr::__vector_base_common<>::__throw_length_error() std::__Cr::vector<>::__emplace_back_slow_path<>() chromeos::BaseWebUIHandler::CallJS<>() chromeos::GaiaScreenHandler::CloseSecurityTokenPinDialog() chromeos::PinDialogManager::CloseActiveDialog() chromeos::PinDialogManager::RemovePinDialogHost() chromeos::GaiaScreenHandler::~GaiaScreenHandler() chromeos::GaiaScreenHandler::~GaiaScreenHandler() content::WebUIImpl::~WebUIImpl() content::WebUIImpl::~WebUIImpl() content::RenderFrameHostManager::ClearWebUIInstances() content::WebContentsImpl::~WebContentsImpl() content::WebContentsImpl::~WebContentsImpl() views::WebView::SetWebContents() views::WebView::~WebView() views::View::~View() chromeos::OobeWebDialogView::~OobeWebDialogView() views::View::DoRemoveChildView() views::View::RemoveAllChildViews() views::Widget::~Widget() views::(anonymous namespace)::BubbleWidget::~BubbleWidget() Bug: 964069 Test: enroll a "target_os=chromeos" build, configure device policies to force-install smart card middleware onto Login Screen, start logging in using a SAML account that uses smart card authentication, wait until PIN dialog appears, close Chrome by clicking "x", check that there was no crash Change-Id: I3f2f927830d71209c61c7e4b66250d16bb1039ac Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750003 Commit-Queue: Denis Kuznetsov <antrim@chromium.org> Reviewed-by:Denis Kuznetsov <antrim@chromium.org> Cr-Commit-Position: refs/heads/master@{#692024}
Showing
Please register or sign in to comment