You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last command wrongly imposed a 1-second CPU time limit on the main shell.
So all these checks need updating. They need a fix similar to the one applied to sh_assignok() in 911d6b0. That fix should be applied to sh_subfork(), but it will be complicated.
The places to look are:
$ grep -rwn sh_subfork src/cmd/ksh93/
src/cmd/ksh93//include/shell.h:229:extern void sh_subfork(void);
src/cmd/ksh93//bltins/typeset.c:188: sh_subfork(); /* avoid affecting main shell's alias table */
src/cmd/ksh93//bltins/typeset.c:709: sh_subfork();
src/cmd/ksh93//bltins/typeset.c:1148: sh_subfork();
src/cmd/ksh93//bltins/typeset.c:1255: sh_subfork();
src/cmd/ksh93//bltins/ulimit.c:140: sh_subfork();
src/cmd/ksh93//bltins/cd_pwd.c:121: sh_subfork();
src/cmd/ksh93//bltins/misc.c:142: sh_subfork();
src/cmd/ksh93//sh/io.c:1157: sh_subfork();
src/cmd/ksh93//sh/xec.c:1603: sh_subfork();
src/cmd/ksh93//sh/xec.c:2437: sh_subfork();
src/cmd/ksh93//sh/fault.c:108: sh_subfork();
src/cmd/ksh93//sh/fault.c:553: sh_subfork();
src/cmd/ksh93//sh/subshell.c:188:void sh_subfork(void)
src/cmd/ksh93//sh/subshell.c:679: sh_subfork(); /* ...we have to fork, as we cannot fchdir back to it. */
src/cmd/ksh93//sh/subshell.c:689: sh_subfork();
The text was updated successfully, but these errors were encountered:
After some experimentation I think it's not currently feasible to fix virtual subshells to coexist correctly with shared-state command substitutions.
An easy fix/workaround to ensure correct behaviour is to fork a virtual subshell before executing a shared-state command substitution within it. That is what I'll do for the time being.
In the long term I think shared-state command substitutions should probably be redesigned to disassociate them completely from the virtual subshell mechanism.
The code contains various checks to see if a subshell needs to fork, like this one in the
ulimit
builtin:ksh/src/cmd/ksh93/bltins/ulimit.c
Lines 139 to 140 in 090b65e
All checks of this form are fatally broken, as each one of them causes shared-state command substitutions to ignore parent virtual subshells.
Taking
ulimit
as an example again:The last command wrongly imposed a 1-second CPU time limit on the main shell.
So all these checks need updating. They need a fix similar to the one applied to
sh_assignok()
in 911d6b0. That fix should be applied tosh_subfork()
, but it will be complicated.The places to look are:
The text was updated successfully, but these errors were encountered: