Fix crash issue of first dotnet application to be executed 22/291822/1
authorHwankyu Jhun <h.jhun@samsung.com>
Sun, 23 Apr 2023 22:32:02 +0000 (22:32 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Sun, 23 Apr 2023 22:32:02 +0000 (22:32 +0000)
There is a problem about loading the launcher info in the AppExecutor class.
In the previous implementation, the AppExecutor created the process pool
before initializing the launcher info. It causes the crash issue.
If the launch request is for dotnet or dotnet-nui app-types, the process pool
cannot execute it properly. Because, there is no launcher info.
This patch modifies the process pool initialization of the AppExecutor.

Change-Id: Icf41ab3584d85963d793b497290010805f1bab91
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/app_executor.cc
src/launchpad-process-pool/app_executor.hh

index a4155aa..fc79d1c 100644 (file)
@@ -59,7 +59,7 @@ std::shared_ptr<AppInfo> CreateAppInfoFromAppPacket(
 }  // namespace
 
 AppExecutor::AppExecutor()
-    : Executor(this), process_pool_(new ProcessPool(2, this)) {
+    : Executor(this) {
   LauncherInfoInflator inflator;
   launcher_infos_ = inflator.Inflate("/usr/share/aul");
 
@@ -91,6 +91,7 @@ AppExecutor::AppExecutor()
       std::bind(&AppExecutor::StepPrepareAppSocketAndIdFile, this));
   prepare_funcs_.push_back(
       std::bind(&AppExecutor::StepSendStartupSignal, this));
+  process_pool_ = std::unique_ptr<ProcessPool>(new ProcessPool(2, this));
 }
 
 pid_t AppExecutor::Execute(const AppInfo* app_info) {
index 2977219..ea964af 100644 (file)
@@ -68,9 +68,9 @@ class AppExecutor : public Executor::Delegator,
  private:
   using PrepareFunc = std::function<int()>;
 
-  std::unique_ptr<ProcessPool> process_pool_;
   std::vector<LauncherInfoPtr> launcher_infos_;
   std::vector<PrepareFunc> prepare_funcs_;
+  std::unique_ptr<ProcessPool> process_pool_;
   const AppInfo* app_info_ = nullptr;
 };