-
Notifications
You must be signed in to change notification settings - Fork 160
Crash when attempting to open a TCP socket. #1438
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
Comments
Please remember to include the platform on which you are observing the issue 😄 I can reproduce this on macOS but not Linux. In this case the issue is that fd 3 is special on macOS due to something known as a "NECP descriptor": http://newosxbook.com/bonus/vol1ch16.html. You can see this by inserting a Lines 467 to 468 in ffbfaf6
The same failure occurs with macOS /bin/ksh (ksh93u+) and ksh93v-. Thus I'm marking this as an enhancement for improved compatibility with macOS rather than a bug since, at this time, there isn't an obvious bug in the usual sense. |
Apologies for omitting platform information; yes, macOS (10.14.6). The failure isn't the same for me under
whereas |
Here are two more datapoints:
where (2) is essentially the originally reported issue. |
I tested this on macOS 10.15.1 using it's ksh93u+ binary and saw your problem:
However, it only happens when running that specific command. Starting an interactive |
Thanks for testing. Just to clarify: do you agree that this is a bug? (I see that the label was removed just before your first reply.) |
Additional datapoint: crash in 93u+ with
while this doesn't crash |
Whether this issue documents a bug or long standing behavior that should be changed is unclear. Is the behavior a ksh bug or a platform behavior that needs to be accommodated by ksh? The unwanted, unexpected, behavior occurs even with a 7+ year old ksh version. Not just the current source. After sleeping on the issue I've decided this should be classified as a bug. Primarily because, even if this is due to a macOS quirk, a straightforward C program that performs the same action would "just work". This may be an implementation bug but I won't be surprised if it turns out to be a design bug. Specifically, with how fd numbers are dynamically remapped using |
Should that make a difference? I thought the intent of this repository was to continue KornShell development, which would include fixing historic bugs as well as newly introduced ones?
Alternative reading: From a user perspective, crashing unexpectedly is buggy behaviour. |
No to #1 and yes to #2, with a huge caveat. There are currently only two people who have contributed more than a single change in the past two years. Therefore, we have to characterize bugs that have existed for at least 7 years (back to the ksh93u+ release) as lower priority than bugs introduced since that release. If and when we have at least a handful of people regularly contributing or reviewing changes I'll be happy to prioritize old and new bugs based solely on the impact of the bug rather than its age. For now we have to care more about any bug people will notice that was not present in the ksh93u+ release. |
Thanks for the explanation; this approach to prioritisation wasn't clear to me. |
Description of problem:
ksh
crashes when attempting to establish a TCP connection withexec
under certain situations.Ksh version:
Version A 2020.0.0-beta1-166-g1025e369
.How reproducible:
Consistently, for certain inputs.
Steps to reproduce:
ksh
sessionexec 3<>/dev/tcp/ntp-b.nist.gov/13
Actual results:
Expected results:
Additional info:
Compare the above with the following, which seems to work as intended (at least, there's no immediate crash):
So, not all host/port pairs are triggering the problem. UDP not tested.
The text was updated successfully, but these errors were encountered: