[llvm] [flang] [compiler-rt] [clang] [clang-tools-extra] [flang] use setsid to assign the child to prevent zombie as it will be clean up by init process (PR #77944)

Yi Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 01:26:48 PST 2024


yi-wu-arm wrote:

Sorry, let me rebase on main, there are patches has been uploaded to solve this problem.

The problem is listed here: https://github.com/llvm/llvm-project/issues/77803 In short, once a async ` EXECUTE_COMMAND_LINE` is called, all future `EXECUTE_COMMAND_LINE` will have a `cmdstat` of 2 (execution error) because `std:::system` return -1. It will fail on gfortran llvm test suite.

A simple reproducer would be 
```fortran
program test()
call execute_command_line("echo hi", .false.)
call execute_command_line("echo hi")
end program test
```
console output
```
hi

fatal Fortran runtime error(/home/yiwu02/gitrepo/llvm-project/test_fortran_code/test.f90:3): Execution error with system status code: -1
hi

fatal Fortran runtime error(/home/yiwu02/gitrepo/llvm-project/test_fortran_code/test.f90:2): Execution error with system status code: -1
Aborted (core dumped)
```


https://github.com/llvm/llvm-project/pull/77944


More information about the llvm-commits mailing list