Skip to content

Intermittent failure causing print -u2 breakage #975

@JohnoKing

Description

@JohnoKing

This is a dedicated issue for an intermittent test failure in subshell.sh (#344 (comment)).
I've managed to make it reproduce more consistently:

# Note: This problem exhibits with print -u2, but not 1>&2
function foo
{
	typeset -li i
	print -u2 foobar
	for	((i=0; i < 8000; i++))
	do	print abcdefghijk
	done
	print -u2 done
}
out=$(eval "foo | cat" 2>&1)
print "${#out}" >out
for ((i=0; i!=25; i++)); do ksh /tmp/repro; cat out; done
96006
96006
96011
96006
96006
96006
96011
96006
96006
96006
96006
96011
96006
96006
96006
96006
96011
96011
96006
96011
96006
96006
96006
96011
96006

This bug occurs in all 93u+m releases AFAICT, as well as ksh93u+, ksh2020, ksh93v- 2012-08-24 and 93v- 2012-10-04. It does not occur in 93v- releases 2012-10-12 through 2016-01-10. At some point this bug was fixed in 93v-, then unfixed in ksh2020. (Edit: That's likely because ksh93v- defaults cat calls to use the AST builtin, not the external cat.) I may trace this problem further, but my schedule is packed today so no guarantees.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions