[M108 Aura Migration] Fix crash with memory sanitizer 26/289126/2
authorzhaosy <shiyusy.zhao@samsung.com>
Thu, 2 Mar 2023 02:07:53 +0000 (10:07 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 2 Mar 2023 08:45:41 +0000 (08:45 +0000)
With memory sanitizer or some utility, there can be another thread,
which is created for their purpose.

i.e.)
With VD duma, libduma makes an agent thread as static variable
before ZygoteMain() is called.

  efl_webprocess(5483)---{duma_comm}(5497)

Referenece:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/252992/

Change-Id: I5da2bf0e8eaa8632790d9f0bcb2b6f426d0f621c
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
content/zygote/zygote_main_linux.cc

index 4f2383d..8525df0 100644 (file)
@@ -159,8 +159,15 @@ static void EnterLayerOneSandbox(sandbox::policy::SandboxLinux* linux_sandbox,
 // It's not just our code which may do so - some system-installed libraries
 // are known to be culprits, e.g. lttng.
 #if !defined(THREAD_SANITIZER)
+#if BUILDFLAG(IS_TIZEN)
+  // With memory sanitizer or something utility enabled, there can be another
+  // thread created for its purpose.
+  //   i.e. VD DUMA makes 'duma_comm' thread for communication with host PC.
+  DCHECK(sandbox::ThreadHelpers::IsSingleThreaded());
+#else
   CHECK(sandbox::ThreadHelpers::IsSingleThreaded());
 #endif
+#endif
 
   sandbox::SetuidSandboxClient* setuid_sandbox =
       linux_sandbox->setuid_sandbox_client();