summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
43 hoursFix static analysis issuesHwankyu Jhun2-20/+3
Checker: - UNREACHABLE_CODE Change-Id: I55e3bc5de380aeac81bf3220a12d5a4813a65a41 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
12 daysChange log levelsHwankyu Jhun3-3/+3
This patch changes log levels to error level for debugging. Change-Id: I0cd74abbd2ba001457258f9d9730af4c3ab506e8 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-06-05Fix build error for gcc-14accepted/tizen/unified/x/asan/20240625.092457accepted/tizen/unified/x/20240610.223224accepted/tizen/unified/toolchain/20240610.172637accepted/tizen/unified/dev/20240620.005106accepted/tizen/unified/20240611.123058accepted/tizen_unified_x_asanaccepted/tizen_unified_toolchainHwankyu Jhun3-14/+15
Change-Id: I93629f9daabf6cde9c5cdf9b1d8730baf4e3f5af Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-05-08Add log messages for debuggingHwankyu Jhun1-0/+3
To check a loading time of the executable file, this patch adds log messages. Change-Id: I4b1ceb722d59ca0156c0896bfde24d69c65a947b Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-04-01Fix passing wrong argumentsHwankyu Jhun1-0/+5
When the application is executed using gdbserver, the export tag of the bundle is deleted unintentionally. To pass arguments properly, the launchpad encloses the string with a ''. Change-Id: Ide6a9624b7cf3d9fdb3ab3441a49a47368aae3bd Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-02-26Remove log print related to fdsHwankyu Jhun1-1/+0
This patch removes the log print from the CloseAllFds(). Change-Id: I51a90345e39242ca4a9dd8ba913d67c28543db46 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-02-23Print logs related to app and loader executionsHwankyu Jhun4-2/+4
Before calling execv(), the process will be printed for debugging. Change-Id: Id9c0b8c8f0ff87f4aa4c9d75db04b568d4beed25 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-02-20Validate gadget resource pathsHwankyu Jhun1-0/+14
The gadget resource path will be changed to "/<package root path>/res/allowed/<res-type>". Before mounting the gadget paths, the launchpad checks whether the path exists or not. If it does not exist, the gadget path will be modified to remove the "<res-type>". Change-Id: Ib7d28fb0df986e56269351c5a2f94446b82ab0f2 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-02-19Fix overlay mount for resource packageSangyoon Jang1-2/+3
The specified lower directories will be stacked beginning from the rightmost one and going left. Change-Id: Ifaec0366ed5f8e17e596bcbc61c82de345e358a6 Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
2024-02-19Revert "Change launch mode to previous operation"Hwankyu Jhun2-2/+2
This reverts commit bc550e7e7c90b6f17b06de7815e0cd2e99662d08. Change-Id: Ic54458ee7d0288a46f3a8c58b81d86f0fa7e1a2c
2024-01-31Add to mount lib directory for rpkSukhyungKang6-2/+31
- The RPK supports Libs sharing. Libs are packaged in /lib directory in rpk package. And then it's mounted to user package's /lib directory path. Change-Id: If9120038f644e85bc6688d27d5ee5e902239a9b3 Signed-off-by: SukhyungKang <shine.kang@samsung.com>
2024-01-25Remove setting RES_PKGIDS environment variableHwankyu Jhun2-14/+0
The NUIGadget uses GADGET_PKGIDS instead of RES_PKGIDS. The RES_PKGIDS environment variable is not needed. Change-Id: Id09cbb79dcd9afc6c31bd85850f172b8c9f52b85 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-01-24Fix crash issueHwankyu Jhun1-6/+6
Currently, __stack_chk_fail occurs by array accessment. Change-Id: I7e4aca03777c61b59a640c9a1e1bee8007dbc6e4 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-01-24Fix invalid accessHwankyu Jhun1-1/+1
The array size is 2. Change-Id: If65b54963abee9d06ca7926aedd30be698371ca9 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-01-23Mount gadget resource paths for NUIGadgetHwankyu Jhun15-26/+508
After this patch is applied, the launchpad tries to mount the gadget resource package separately. And, the gadget packages will be mounted to the bin directory of the application. The 'loader-mount' process is added for mounting gadget packages. Change-Id: Id6c4e6b5a3525eb5cc8687fbb28b6292e895ff3e Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-01-08Remove MCJ file for dotnet appsHwankyu Jhun2-6/+22
The pal layer of coreclr creates the temporary file. If the process is terminated by SIGKILL, the file is not deleted normally. To prevent SMACK issue, the launchpad-process-pool removes the MCJ file. Change-Id: I63eac7ee30008195ff9dcd5572b7c3222d83501b Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2024-01-02Register application info when ping deliveredHwankyu Jhun7-9/+91
If the application is executed using fast launch option of the app_launcher tool, there is a timing issue. When the app process is slow to enter the main function, amd does not know the process existence. To prevent the timing issue, launchpad sends the launches process list to amd when ping request is received. Change-Id: If7dea099493e0442b2a09137467238682c63d66e Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-12-21Fix build fail issue for gcc13Changgyu Choi1-0/+1
Change-Id: If85456e7b588255c95b0d3315859bef0be9b1487 Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
2023-12-20Handle SIGCHLD event for process-poolHwankyu Jhun8-11/+45
If the process pool is terminated, the launchpad should remove the process information. And, if sending the request to the process pool is failed, the launchpad must create a new process to execute an application. Change-Id: I1d5096394593fe3db92fbd125f468bd9b73c498f Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-12-20Except file descriptors from closing listHwankyu Jhun1-3/+21
There is a smack issue by closing fds in the process-pool. In launchpad-process-pool, when using dlog, create a file descriptor with vlog_init(). - When creating a process-pool, close all file descriptors except for the dlog fd (at this time, the vlog fd is closed). - When using the security-manager, attempt to output dlog. Attempt to write using the vlog fd by calling vlog_write(), but at this time, actually use the fd created by the security-manager. - This fd points to /sys/fs/smackfs. - SMACK error occurred. Change-Id: I50b3f4860454f002dd550311bf48e7ef5a2916dc Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-12-15Use access() instead of std::filesystem::existsHwankyu Jhun1-2/+2
The std::filesystem::exists uses stat() internally. The read permission is needed to use stat(). It can cause the smack issues. This patch changes the implementation to using access() with F_OK option. Change-Id: I367487b010c7abf50015004e86c3bb6ad88aa0e6 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-12-13Revert "Increase cpu boosting interval"Changgyu Choi1-1/+1
This reverts commit e6d5bee452cc2548fecc48dc6ddd6dc8a64a2c9e. Change-Id: Ifb5a779f45e05ed0b78de47efd9fcb2e3daa7b79
2023-11-29Increase cpu boosting intervalChanggyu Choi1-1/+1
Some low-end devices have a problem of delaying app execution at boot time. This patch improves this problem by increasing cpu boosting interval. Change-Id: Ic4c22e5a23c45a8fa31b61f0d2a460a4cf8f6dbf Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
2023-11-21Add restart loader conditionChanggyu Choi1-1/+1
When handling the RESTART_LOADER command, it is necessary to check whether the loader_context is launchable. In some cases, a problem occurred by launching a loader in a non-executable state. This patch fixes this case. Change-Id: I835799364d4dcd4e0d8c30e0d60a52f5ec08ff10 Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
2023-11-20Rollback SendStartupSignal()Changgyu Choi2-0/+8
For apps that do not use some aul api, roll back previous patch. Rollback: - https://review.tizen.org/gerrit/c/platform/core/appfw/launchpad/+/301173 Change-Id: I6383e998cdaa55e790b7d5bf0c8031c7cbc4d40c Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
2023-11-15Send Startup signalHwankyu Jhun2-0/+10
In the loader case, the process already loaded the aul library. AppStartupSignal is sent while loading the aul library. Sending AppStartupSignal is needed in the loader case. Change-Id: I4968fe72992f24d6bf19c957f43967080602f5f0 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-11-14Set a new environment variable for fast launchHwankyu Jhun2-25/+31
If an application is executed by the fast launch option, the launchpad adds the "AUL_FAST_LAUNCH" variable to the environment. Change-Id: Ia43ce56a34dc103b1ae1b8ff740f90b2e861e8c6 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-11-14Remove SendStartupSignal stepChanggyu Choi4-18/+0
This step is moved to aul lib constuctor. Change-Id: I35b7f791c3c5c9ed8e33233c7ef88506d10c3cfc Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
2023-11-07Change launch mode to previous operationHwankyu Jhun2-2/+2
This patch changes the launch mode of loader management to the previous operation. Change-Id: I426a16dc1c2f58eb46132d8a789c73a6199aaa9a Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-11-06Modify thread controlHwankyu Jhun1-2/+5
This patch uses std::condition_variable::wait_for() instead of std::condition_variable::wait(). The timeout is 5 seconds. Change-Id: I6a5f89bbf4450679c8527121f76966c6451eab52 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-11-03Remove CPU boosting of loader processHwankyu Jhun1-2/+0
Recently, the launchpad-process-pool sends a boosting request when the loader process is not prepared. This patch removes that. In the product model, the module of amd sends a boosting request for executing the process. Change-Id: Iebf96954919be250447f19ee0d37f4274db39bf2 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-10-31Fix typoChanggyu Choi1-1/+1
Change-Id: I4c17ea4c8253e46b26237c63326bf8ded5f136f6 Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
2023-10-19Change log messages of executing echoHwankyu Jhun1-5/+7
The error message is added. Change-Id: I18518c4806e2de0bdd9d6515940798fda8b7849a Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-10-18Fix double closeHwankyu Jhun1-2/+0
This patch removes input_file.close() call from debugger info parser. Change-Id: Ib430ee0f6f715f55aa6f23a28b65634700e98ade Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-10-18Add SIGUSR1 signal handlerHwankyu Jhun2-0/+89
Currently, the launchpad-process-pool suddenly gets the SIGUSR1 signal. To debug the reason, the SIGUSR1 signal handler is added. While getting the signal, the launchpad-process-pool prints the sender pid and the backtrace. Change-Id: I842e374b836b83a635722baafa628bea10f072d0 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-10-12Remove previous files at forkHwankyu Jhun1-0/+20
This patch uses pthread_atfork() to register a fork handler. While creating a children process, we should remove previous files related to the process ID. Change-Id: I04a646feefeb7dd21cc102c4ab2bb43f10a259b5 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-10-12Exclude dlog fds from closing fdsHwankyu Jhun1-1/+26
To print dlogs, the process pool checks whether the file descriptor is dlog fd or not. And then, the dlog fds will be excluded from closing fds. Change-Id: I86aee6554ec3ba7ad8cfbac395a84e75b629b52b Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-10-11Fix external package activationHwankyu Jhun1-2/+8
The argument must be const char**. The dbus message must have a uid. Change-Id: I7be2121233b1a801d3f4190f529d14d1f57c79e6 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-10-05Check SCHED_PRIORITY valueHwankyu Jhun3-2/+7
If the SCHED_PRIORITY value is not 0, the app-defined-loader and the launchpad-loader set the scheduling priority to 0. Change-Id: I0281548e724f2d3a7caba981630d48d3a790a6e2 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-27Change stdio redirect bufferChanggyu Choi1-1/+1
Changes buffer from LOG_ID_APPS to LOG_ID_MAIN Change-Id: I1863031404dafb8551e27f6c6769e1c2f92a33a9 Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
2023-09-21Fix wrong log messageHwankyu Jhun1-1/+1
The SchedPriority::Set() log message is fixed. Change-Id: I7187a0e48aa914563c6a47f2b701d9e03bb0440a Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-21Fix wrong implmenetation of launchpad libraryHwankyu Jhun1-3/+3
The argc should be the size of the result of Bundle::Export(). Change-Id: Id4ec0eab4bdec0c750ef9553c001e2620703dffa Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-21Modify argv creation of liblaunchpad libraryHwankyu Jhun1-2/+2
The last element of the argv should be nullptr. If the last element is not nullptr, the following error can be occurred: "Failed to execute a file. path: <executable file path>, errno: 14(Bad address)" Change-Id: I5d691492171caf2e8a33ca72e874de6d609cabfb Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-19Fix static analysis issuesHwankyu Jhun2-12/+13
Issues: - COPY_INSTEAD_OF_MOVE Change-Id: I1487405d8664a3fc2b056ac747927eb817943312 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-19Fix static analysis issueHwankyu Jhun1-0/+3
Checker: - DEREF_OF_NULL.RET_STAT Change-Id: Ifc95e098d24ccd2d80c83bee5f3340b4e13c5a66 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-14Modify disposal loader handlerHwankyu Jhun1-1/+1
The result should be delivered to the caller before sending SIGKILL signal. Change-Id: I829d244b16aa4472ea6935349c5bf0e1353fc553 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-14Modify launchpad_loader_dispose() functionHwankyu Jhun4-23/+22
The type of the return value is changed to 'int' from 'void'. Change-Id: I7af938e048d36348a9ad6d070c6ab9feaa8e9978 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-14Add a new function for loader terminationHwankyu Jhun7-17/+76
The launchpad_loader_dispose() function is added to dispose the loader iself. The function sends a disposal request to the launchpad-process-pool. When the launchpad-process-pool gets the request, it sends SIGKILL signal to the running loader process. Change-Id: I74ed0b2b5fa42d47220b335e84fb1776b7b748f5 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-13Lock and unlock mutex for process creationHwankyu Jhun3-0/+49
To prevent memory corruption issue, this patch adds locking and unlocking a mutex. If the memory allocation occurs when creating a children process using fork(), the children process has a memory problem. Change-Id: I6abc980533686421b30a7cbdac52f370cc352748 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
2023-09-11Reset scheduling priorityHwankyu Jhun3-1/+5
This patch removes calling the SchedPriority::Set(0) from the launchpad library. After this patch is applied, the loader process should reset the priority to zero itself. Change-Id: I93b1e435ab4ebbe9d21b790c547010e39321dabe Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>