change dll/so searching path for app (#356)
author조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Mon, 27 Dec 2021 08:19:11 +0000 (17:19 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 27 Dec 2021 08:19:11 +0000 (17:19 +0900)
Change the path "/proc/self/fd/bin" used to find dll/so for the candidate process to "/proc/[pid]/fd/bin"
When debugging, the library loaded in the location of "/proc/self/fd/bin" cannot be accessed by the debugger, so symbol loading fails.
To avoid this failure, change finding path to "/proc/[pid]/fd/bin".

NativeLauncher/util/path_manager.cc

index 97db862411da2a4c16a421a2a208fe6fd604642d..6ecd556ec905c09bc9eab46637bd7bcd1bd7f332 100644 (file)
@@ -101,8 +101,10 @@ PathManager::PathManager() :
                throw std::ios_base::failure("Fail to open /proc/self");
        }
 
-       appRootPath = std::string("/proc/self/fd/") + std::to_string(rootFD);
-       appNIRootPath = std::string("/proc/self/fd/") + std::to_string(niRootFD);
+       std::string fdPath = "/proc/" + std::to_string(getpid()) + "/fd/";
+       appRootPath = fdPath + std::to_string(rootFD);
+       appNIRootPath = fdPath + std::to_string(niRootFD);
+
        updateAppRelatedPath(appRootPath, appNIRootPath);
 
        // Set native library searching path