-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ksh coprocess tests are flakey #563
Comments
When the hang occurs there are four ksh processes running. One of them has an interesting stack (see below). It is stuck inside
|
Prior to removing AST Vmalloc src/cmd/ksh93/include/jobs.h had the following block of code defining a
|
Note that we can't just do
|
Not surprisingly the simple solution, option #1 above, doesn't work. Deferring all |
Refactoring the code to get unsafe stuff out of signal handlers was only ever the right thing to do. The C-language standard committee (ISO) says so. POSIX says so. CERT says so. And most other organizations which care about code correctness say so. The code should have been refactored years ago. This whole discussion about the problem of putting non-async-safe code within a signal handler (talking about the KSH code base here) already happened -- over 10 years ago! Everyone can read the standards for themselves, but in the end, one either pretty much simply does the async-sig-safe things (defined by ISO or POSIX) or processes signals synchronously within the mainline code itself (many ways to do this). The code should -- finally -- be refactored. |
Patches are welcome. 😄 The only reason I'm doing any of this work is because: a) This was the first UNIX shell I used three decades ago that didn't suck and it therefore is special to me. b) I like trying to fix broken things. |
|
The ksh
coprocess
unit test has always been flakey as of mid 2017 when I started contributing to this project. But since the switch from AST Vmalloc to the system malloc the failure rate has increased dramatically. Specifically, it is now timing out roughly 25% of the time. Whether this is due to a use-after-free bug or a failure exposed only because the layout of malloc()'ed memory is different is TBD (to be determined). Simply increasing that unit test timeout value does not help (see PR #560).The text was updated successfully, but these errors were encountered: