From dcbb2425d99a0c6093732040d4abadf2ddf19a49 Mon Sep 17 00:00:00 2001 From: uzair Date: Fri, 8 Dec 2023 17:21:38 +0530 Subject: [PATCH] Fix for zygote crash during browser launch Zygote process was crashing as its launch path overiding api from efl port failed. Hence below change adds needed CHECK macro and partially reverts [1] as CreateDirectory api call failed in earlier version of tizen as well due to platform specific "ISDIR" call failure. [1]https://chromium-review.googlesource.com/c/chromium/src/+/4685555 Change-Id: I0a69511728fdf2d75dd0b44188e5fa8817e1d0b6 Signed-off-by: uzair --- base/path_service.cc | 6 +++++- tizen_src/ewk/efl_integration/content_main_delegate_efl.cc | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/base/path_service.cc b/base/path_service.cc index 6350fc8..2645060 100644 --- a/base/path_service.cc +++ b/base/path_service.cc @@ -278,7 +278,11 @@ bool PathService::OverrideAndCreateIfNeeded(int key, // Create the directory if requested by the caller. Do this before resolving // `file_path` to an absolute path because on POSIX, MakeAbsoluteFilePath // requires that the path exists. - if (create && !CreateDirectory(file_path)) { + if (create && +#if BUILDFLAG(IS_EFL) + !PathExists(file_path) && +#endif + !CreateDirectory(file_path)) { return false; } diff --git a/tizen_src/ewk/efl_integration/content_main_delegate_efl.cc b/tizen_src/ewk/efl_integration/content_main_delegate_efl.cc index 5841bf5..44751f5 100644 --- a/tizen_src/ewk/efl_integration/content_main_delegate_efl.cc +++ b/tizen_src/ewk/efl_integration/content_main_delegate_efl.cc @@ -83,11 +83,15 @@ ContentMainDelegateEfl::ContentMainDelegateEfl() { void ContentMainDelegateEfl::PreSandboxStartupBrowser() { - LocaleEfl::Initialize(); - base::PathService::Override(base::FILE_EXE, base::FilePath(SubProcessPath())); - base::PathService::Override(base::FILE_MODULE, - base::FilePath(SubProcessPath())); + if (!base::PathService::Override(base::FILE_EXE, + base::FilePath(SubProcessPath())) || + !base::PathService::Override(base::FILE_MODULE, + base::FilePath(SubProcessPath()))) { + LOG(ERROR) << " failed to override path for efl port "; + return; + } + LocaleEfl::Initialize(); InitializeUserDataDir(); InitializeDiskCacheDir(); -- 2.7.4