Bug 14061 - ash: Broken source command when used with a function with redirection
Summary: ash: Broken source command when used with a function with redirection
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-02 12:35 UTC by Koichi Nakashima
Modified: 2021-08-02 12:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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