Comments (6)
It appears that the root cause is probably the fact that ksh only properly disables job control in non-forked/virtual subshells if they are command substitutions. I'm testing a fix for #89 and that fix makes this bug go away as well.
from ksh.
This diff fixes it for me. For some reason I can't fathom, sh_fork()
did not reset shp->savesig
when in a virtual subshell, causing SIGINT
to be ignored after running an external command using sh_fork()
for the duration of the virtual subshell. The patch does not cause any regression test failures for me, on a ksh compiled with and without -DSHOPT_SPAWN=0
.
diff --git a/src/cmd/ksh93/sh/xec.c b/src/cmd/ksh93/sh/xec.c
index a6ad507..baa8d6d 100644
--- a/src/cmd/ksh93/sh/xec.c
+++ b/src/cmd/ksh93/sh/xec.c
@@ -2951,13 +2951,10 @@ pid_t sh_fork(Shell_t *shp,int flags, int *jobid)
shp->savesig = -1;
while(_sh_fork(shp,parent=fork(),flags,jobid) < 0);
sh_stats(STAT_FORKS);
- if(!shp->subshell)
- {
- sig = shp->savesig;
- shp->savesig = 0;
- if(sig>0)
- kill(getpid(),sig);
- }
+ sig = shp->savesig;
+ shp->savesig = 0;
+ if(sig>0)
+ kill(getpid(),sig);
job_fork(parent);
return(parent);
}
from ksh.
This bug is not present in ksh2020, which has removed spawnveg
.
from ksh.
This probably doesn't need to be a blocking bug now that #79 is fixed.
from ksh.
Actually, after the fix for #79, now this bug still occurs when compiled with SHOPT_SPAWN
on, and if the shell is interactive and has job control on:
$ arch/*/bin/ksh -i -c '(/usr/bin/true; while :; do :; done); exit'
^C^C^C^C^C
from ksh.
It appears that the root cause is probably the fact that ksh only properly disables job control in non-forked/virtual subshells if they are command substitutions. I'm testing a fix for #89 and that fix makes this bug go away as well.
Of course it does; the #89 fix makes ksh use sh_ntfork()
instead of sh_fork()
, where the bug is. So that was a false lead.
from ksh.
Related Issues (20)
- FreeBSD: termcap detection fails, causing multiline errors HOT 3
- globstar fails to resolve symlink HOT 1
- [Heads up] Build broken this morning HOT 12
- When multiline is off, the first line entered after shell start or window resize starts scrolling too late HOT 1
- FreeBSD arm64: Various pty.sh test failures HOT 17
- macOS Ventura detects termcap support, not terminfo support HOT 3
- ${var+set} still does not work correctly within loops HOT 4
- `typeset -p` output for `[type]` syntax needs quoting HOT 1
- Upon new shell or TERM change, command completion fails outside of the default path HOT 6
- `unset -f whence` removes `whence` builtin in comsub? HOT 9
- `(unset -f fun)` fails within namespace HOT 1
- Spurious syntax error in `case` with extended expression HOT 6
- Tab completion fails on functions and shell builtins when an autoloaded function is "undefined" HOT 7
- pty test random failure HOT 18
- Race condition in job notification HOT 1
- regression - glob expansion with brace expansion and parameter exapansion HOT 11
- Intermittent types test failure on Debian 11 aarch64 box HOT 5
- Intermittent pty test failure on Kali Linux ARM64 HOT 2
- Still problems building in strict C99 mode HOT 4
- can't expand a function name from an alias
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksh.