test: verify the number of fds on start#3490
Conversation
Helps ensure that we do not accidentally leak an fd unintentionally during uv_spawn.
| if ((argc == 2 || argc == 4) && strcmp(argv[1], "spawn_helper5") == 0) { | ||
| uv__check_nfd(4); | ||
| } else if ((argc == 2 || argc == 4) && strcmp(argv[1], "spawn_tcp_server_helper") == 0) { | ||
| uv__check_nfd(4); | ||
| } else if ((argc == 2 || argc == 4) && strcmp(argv[1], "spawn_helper8") == 0) { | ||
| /* skip */ | ||
| } else { | ||
| uv__check_nfd(3); | ||
| } |
There was a problem hiding this comment.
Style: long lines.
Substance: might be problematic when trying to debug in gdb, it spawns the process with (three?) extra file descriptors.
There was a problem hiding this comment.
I haven't seen any issues with gdb or lldb locally, but I will note that the GitHub Actions CI system test harness does appear have a number of problems with excess file descriptors, so it might be bad to merge this for that reason.
| return errno; | ||
|
|
||
| return 0; | ||
| } |
There was a problem hiding this comment.
Tangential: this is uv__cloexec_fcntl() from src/unix/core.c, right? We could simplify that to just a F_SETFD call because FD_CLOEXEC is the only defined flag anyway.
|
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Helps ensure that we do not accidentally leak an fd unintentionally
during uv_spawn.