<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/77975>77975</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Intrinsic "execute_command_line" results in a seg fault
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          psteinfeld
      </td>
    </tr>
</table>

<pre>
    When I compile and execute the following program:
```
program bug
implicit none
integer :: i,j 
character(len=256)            :: msg
character(len=:), allocatable :: command
   command='notthere'
   call execute_command_line(command, exitstat=i, cmdstat=j)
   print *, "ok"
end program bug
```
I get a seg fault.

When I compile and execute it with gfortran, I get:
```
sh: notthere: command not found
 ok
```

@yi-wu-arm, please take note.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U91uszgQfRpzM0oEw1-44CLbKFKfYC8rYwZwa2xkD5v27VcmpK122y-KjObnnBnOMTIEPVqiVpR_ifKSyJUn59slMGk7kOmTzvUf7d8TWXgG5eZFGwJpe6B3UisT8EQwOGPcTdsRFu9GL2eRn0V6EelZVOn-38K9DN063hN6XoxWmsE6S3vKMo3kIXLkZ9ACn17hXlKT9FIxeYEnQ1bkFywrgQ18--2wOYy_YWIHNgKfQBrjlGTZGXrglJtnafs7FuAzzi8Ca-uYJ_IksP5qkMY8xHjZu1-MtiTw9ADjE9C75sCSRX6JbwRq7vfwNS7zYFu8tgwCz7FHILo3gXivku3hf_r9R99nGIlBQqARBrkaPu5t2_kHFzXDTfME4-A8e2nj-I3sNyfDFNX6FORLuZiDwa2fGrq3Hwn2s0g_9OG2HqSf48zFkAwELN8oEtG-f9K3ed_kjUyozeq0TJsM0yqZ2j6tG0pxKAZ1qrHLilOPpcrUqcryRg51oltMsUizDDHFqiiOWSEpz2XVlcPQkKxEkdIstTka8898dH5MdAgrtXXd1GViZEcmbF8HoqUbbMXoSXlJfBsxh24dgyhSowOHLxbWbKh9tuy1DVpFM3--JQiewmo4gLbfrUtWb9qJeQnbhb0KvI6ap7U7KjcLvMZJ--OwePdKigVet_2CwOu2_78BAAD__67BLac">