Bug 14061

Summary: ash: Broken source command when used with a function with redirection
Product: Busybox Reporter: Koichi Nakashima <koichi>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Koichi Nakashima 2021-08-02 12:35:21 UTC
```sh:test.sh
#!/bin/sh

foo() {
  echo START
  source ./script.sh
  echo END
}
foo 2>/dev/null
```

```sh:script.sh
echo "script"
```

```console
$ busybox ash test.sh
START
script
```

The `source` does not complete and running at 100% CPU usage.

This issue has been introduced in the following commits.
ash: add process substitution in bash-compatibility mode
https://git.busybox.net/busybox/commit/?id=a1b0d3856d9a0419cb74bf4c87525265871b5868