https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90038

            Bug ID: 90038
           Summary: execute_command_line should not use fork()
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jb at gcc dot gnu.org
  Target Milestone: ---

Occasionally there are problems like
https://stackoverflow.com/questions/55120720/fortran-execute-command-line-runtime-error-depends-on-memory-consumption
where execute_command_line (or system()) fails because the calling process uses
a lot of memory.

As of October 2018 glibc system() uses posix_spawn() instead of fork(), so this
problem should largely solve itself over time on Linux/glibc targets.

However, in execute_command_line there is still a usage of fork() remaining (in
case WAIT=.FALSE.). This should be fixed.

See also
https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf

Reply via email to