ksh93/ksh

Regression: Double redirection in command substitution causes shell hang

vmihalko opened this issue · 1 comments

Reproducer

#!/usr/bin/env ksh

BugFunction() {
  { echo "funA" >&2; } >&2
  echo A
}

NoBugFunction() {
  echo "funB" >&2; >&2
  echo B
}

Result=$(BugFunction)
echo $Result
Result2=$(NoBugFunction)
echo $Result2

Steps to reproduce

$ ./arch/linux.i386-64/bin/ksh test.ksh 
funA

funB
B

KSH version

sh (AT&T Research) 93u+m/1.1.0-alpha+7170ac01 2024-08-28

What happens

Double redirection seems to cause a hang or unexpected behavior.

Git Bisect

I've tracked the bug to a specific commit: 2d4a787