Conversation
|
I added a test because i noticed there wasn't one for async stdin, only for normal stdin upload. the failing test seems to be unrelated |
7a477fb to
481e91f
Compare
d68d1b2 to
971b83e
Compare
|
both tests are still failing in the torture test because of the socket fd which the main thread passes to the background thread. I don't see a solution other than making valgrind ignore it somehow because the socket needs to be alive throughout the whole program lifecycle. |
Is there perhaps a way to wait for that thread before exit, |
b4f3e7e to
f89318e
Compare
waiting for the thread is not really an option because it is inside a blocking read call most of the time and the fd needs to be open until exit. |
I don't really have a debugger setup on windows, so I tried to test it with But I guess it is fixed now if you can't reproduce it either. |
|
Viktor before this is landed I'd like more time to hear from @denandz to make sure everything is ok with his setup which may be more complicated than our tests. |
Sounds good to me. Short of his blessing, I'd be happy to land this on the next cycle, if no one else is reporting issues. Do we know specifics about @denandz setup? |
Yes:
|
* atexit: Clarify DLL behavior is the same as _onexit - Document that atexit called from within a DLL will register the routine to run when the DLL is unloaded. atexit is a wrapper around _onexit which already documents this behavior. Ref: curl/curl#22383 (comment) Reported-by: Michał Petryka Closes #xxxx * Revise atexit documentation for accuracy Update the date and clarify DLL behavior for atexit. --------- Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com>
|
Thank you for your patience, team. Busy week on my end. I've successfully tested these changes with httpstream2tcp and OpenSSH. No issues on my end, LGTM and blessings given! 🙏 |
…//github.com/MicrosoftDocs/cpp-docs (branch main) (#6788) * Update Vectorized STL algorithm documentation to reflect the current stae (#5937) Since the last update: * ARM64 and ARM64EC vectorization was added. Mention of x64 and x86 is removed, as vectorization is now supported on any target, except deprecated `/clr:pure` and `/clr:safe` modes. * `includes` is now manually vectorized too * `replace_copy` is now manually vectorized too Also moved `find_end` to `search` / `search_n` group, where it fits better. * Update header-files-cpp.md (#5938) Clarify intent of section * Update documentation on accessing System.String characters (#5940) * Update documentation on accessing System.String characters Added important note about treating interior pointers as const and linked to unsafe code best practices. * Update docs/dotnet/how-to-access-characters-in-a-system-string.md Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Clarify version prefix for Visual Studio Command Prompt (#5946) Updated instructions for starting Visual Studio Command Prompt to reflect changes in version specification. * Add new ARM64 feature arguments to documentation (#5950) Add new extensions `cssc` and `faminmax` to the `/feature` flag arguments documentation * atexit: Clarify DLL behavior is the same as _onexit (#5952) * atexit: Clarify DLL behavior is the same as _onexit - Document that atexit called from within a DLL will register the routine to run when the DLL is unloaded. atexit is a wrapper around _onexit which already documents this behavior. Ref: curl/curl#22383 (comment) Reported-by: Michał Petryka Closes #xxxx * Revise atexit documentation for accuracy Update the date and clarify DLL behavior for atexit. --------- Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> --------- Co-authored-by: learn-build-service-prod[bot] <113403604+learn-build-service-prod[bot]@users.noreply.github.com> Co-authored-by: Learn Build Service GitHub App <Learn Build Service LearnBuild@microsoft.com> Co-authored-by: Alex Guteniev <gutenev@gmail.com> Co-authored-by: veganaiZe <7102064+veganaiZe@users.noreply.github.com> Co-authored-by: Aaron R Robinson <arobins@microsoft.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Eric Brumer <ericbr@microsoft.com> Co-authored-by: Vít Knobloch <67308900+vitknobloch@users.noreply.github.com> Co-authored-by: Jay Satiro <raysatiro@yahoo.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com>
|
sry for the noise. I had committed a faulty change, which I now reverted by resetting to the previous commit, so nothing has changed in total. However, there is a flaky netbsd test which is failing now. I don't have anything more to add to this pr, its done from my side. |
It is a dangerous function. Remove usage by only starting the thread after setup completed successfully. Ref: https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread Ref: curl#21467 (comment) Ref: curl#18996 (comment) Ref: curl#18451 Follow-up to 9a26633 curl#17572 Closes curl#22383
|
I've squashed your commits and rebased on upstream/master to prepare for landing this. I've force-pushed the proposed final commit to your branch. Since there was dual author information I used the one with your real name (also the name on your github profile). Please amend the commit meta if necessary. After it passes CI I will take a final look. for example While reviewing this PR I found two issues related to this stdin upload area but separate from this PR so I will address them separately. The first is how curl can ignore truncated data on stdin (this is how I saw 0 content being uploaded in the debugger), filed as #22682. The second is CPU usage issue like if stdin is used like to type to peer and back and forth and it's waiting a lot, filed as #22640. |
It is a dangerous function. Remove usage by only starting the thread after setup completed successfully. Ref: https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread Ref: curl#21467 (comment) Ref: curl#18996 (comment) Ref: curl#18451 Follow-up to 9a26633 curl#17572 Closes curl#22383
done. Thank you for your work |
|
Thanks |
- Don't do premature write shutdown (SHUT_WR) on the socket used to read the stdin data (aka socket_r). - Remove broken setsockopt call for SO_DONTLINGER on socket_r. - Treat ReadFile receiving 0 bytes as valid (it seems this is allowed). Prior to this change a partial shutdown of the write side of the read socket that the main thread reads stdin data from (socket_r) happened before reading the data from the socket. The partial shutdown caused a FIN to be sent which lingered for ~2 minutes (typical OS configured time), and after that time the connection was terminated. Theory of operation to read stdin on windows is a connection is established to relay stdin from a dedicated thread (write to socket_w) to the main thread (read from socket_r) so reading stdin is non-blocking. Data truncation would occur if this process was not completed by the linger time. Ref: curl#22383 (comment) Closes #xxxx
…//github.com/MicrosoftDocs/cpp-docs (branch main) (#6797) * Update Vectorized STL algorithm documentation to reflect the current stae (#5937) Since the last update: * ARM64 and ARM64EC vectorization was added. Mention of x64 and x86 is removed, as vectorization is now supported on any target, except deprecated `/clr:pure` and `/clr:safe` modes. * `includes` is now manually vectorized too * `replace_copy` is now manually vectorized too Also moved `find_end` to `search` / `search_n` group, where it fits better. * Update header-files-cpp.md (#5938) Clarify intent of section * Update documentation on accessing System.String characters (#5940) * Update documentation on accessing System.String characters Added important note about treating interior pointers as const and linked to unsafe code best practices. * Update docs/dotnet/how-to-access-characters-in-a-system-string.md Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Clarify version prefix for Visual Studio Command Prompt (#5946) Updated instructions for starting Visual Studio Command Prompt to reflect changes in version specification. * Add new ARM64 feature arguments to documentation (#5950) Add new extensions `cssc` and `faminmax` to the `/feature` flag arguments documentation * atexit: Clarify DLL behavior is the same as _onexit (#5952) * atexit: Clarify DLL behavior is the same as _onexit - Document that atexit called from within a DLL will register the routine to run when the DLL is unloaded. atexit is a wrapper around _onexit which already documents this behavior. Ref: curl/curl#22383 (comment) Reported-by: Michał Petryka Closes #xxxx * Revise atexit documentation for accuracy Update the date and clarify DLL behavior for atexit. --------- Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> * Resolve syncing conflicts from FromPrivateLiveToMaster to main (#5953) --------- Co-authored-by: learn-build-service-prod[bot] <113403604+learn-build-service-prod[bot]@users.noreply.github.com> Co-authored-by: Learn Build Service GitHub App <Learn Build Service LearnBuild@microsoft.com> Co-authored-by: Alex Guteniev <gutenev@gmail.com> Co-authored-by: veganaiZe <7102064+veganaiZe@users.noreply.github.com> Co-authored-by: Aaron R Robinson <arobins@microsoft.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Eric Brumer <ericbr@microsoft.com> Co-authored-by: Vít Knobloch <67308900+vitknobloch@users.noreply.github.com> Co-authored-by: Jay Satiro <raysatiro@yahoo.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: Hector <v-ndat@microsoft.com>
…//github.com/MicrosoftDocs/cpp-docs (branch main) (#6802) * Update Vectorized STL algorithm documentation to reflect the current stae (#5937) Since the last update: * ARM64 and ARM64EC vectorization was added. Mention of x64 and x86 is removed, as vectorization is now supported on any target, except deprecated `/clr:pure` and `/clr:safe` modes. * `includes` is now manually vectorized too * `replace_copy` is now manually vectorized too Also moved `find_end` to `search` / `search_n` group, where it fits better. * Update header-files-cpp.md (#5938) Clarify intent of section * Update documentation on accessing System.String characters (#5940) * Update documentation on accessing System.String characters Added important note about treating interior pointers as const and linked to unsafe code best practices. * Update docs/dotnet/how-to-access-characters-in-a-system-string.md Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Clarify version prefix for Visual Studio Command Prompt (#5946) Updated instructions for starting Visual Studio Command Prompt to reflect changes in version specification. * Add new ARM64 feature arguments to documentation (#5950) Add new extensions `cssc` and `faminmax` to the `/feature` flag arguments documentation * atexit: Clarify DLL behavior is the same as _onexit (#5952) * atexit: Clarify DLL behavior is the same as _onexit - Document that atexit called from within a DLL will register the routine to run when the DLL is unloaded. atexit is a wrapper around _onexit which already documents this behavior. Ref: curl/curl#22383 (comment) Reported-by: Michał Petryka Closes #xxxx * Revise atexit documentation for accuracy Update the date and clarify DLL behavior for atexit. --------- Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> * Resolve syncing conflicts from FromPrivateLiveToMaster to main (#5953) * Clarify sentence about updating UI item states (#5955) Added a question mark to clarify the sentence about updating the state of user-interface items. * Update acquisition doc for vcpkg (#5957) * Update acquisition doc for vcpkg * remove en-us from URL * use relative link to vcpkg docs * Update docs/mfc/how-to-update-user-interface-objects.md Co-authored-by: learn-build-service-prod-08[bot] <274430765+learn-build-service-prod-08[bot]@users.noreply.github.com> --------- Co-authored-by: learn-build-service-prod[bot] <113403604+learn-build-service-prod[bot]@users.noreply.github.com> Co-authored-by: Learn Build Service GitHub App <Learn Build Service LearnBuild@microsoft.com> Co-authored-by: Alex Guteniev <gutenev@gmail.com> Co-authored-by: veganaiZe <7102064+veganaiZe@users.noreply.github.com> Co-authored-by: Aaron R Robinson <arobins@microsoft.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Eric Brumer <ericbr@microsoft.com> Co-authored-by: Vít Knobloch <67308900+vitknobloch@users.noreply.github.com> Co-authored-by: Jay Satiro <raysatiro@yahoo.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: Daniel Nikolov <114946180+danikolovv@users.noreply.github.com> Co-authored-by: Hector <v-ndat@microsoft.com> Co-authored-by: learn-build-service-prod-08[bot] <274430765+learn-build-service-prod-08[bot]@users.noreply.github.com>
- Don't do premature write shutdown (SHUT_WR) on the socket used to read the stdin data (aka socket_r). - Don't do premature read shutdown (SHUT_RD) on the socket used to write the stdin data (aka socket_w). - Remove broken setsockopt call for SO_DONTLINGER on socket_r. - Wait until all data sent from socket_w is acknowledged by socket_r. Prior to this change a partial shutdown of the write side of the read socket that the main thread reads stdin data from (socket_r) happened before reading the data from the socket. The partial shutdown caused a FIN to be sent which lingered for ~2 minutes (typical OS configured time), and after that time the connection was terminated. Theory of operation to read stdin on windows is a connection is established to relay stdin from a dedicated thread (write to socket_w) to the main thread (read from socket_r) so reading stdin is non-blocking. Data truncation would occur if this process was not completed by the OS FIN reply wait time. Note this FIN wait time is not the same as SO_LINGER wait time, the latter only used by closesocket. Ref: #22383 (comment) Closes #22682
* Filesystem (#6805) * sorting out deprecated filsystem * refactor <filesystem> docs so that experiemental stuff is in its own location and doesn't overlap * Apply batched suggestions from code review Co-authored-by: learn-build-service-prod-05[bot] <274429479+learn-build-service-prod-05[bot]@users.noreply.github.com> * Apply batched suggestions from code review Co-authored-by: learn-build-service-prod-05[bot] <274429479+learn-build-service-prod-05[bot]@users.noreply.github.com> * Fix formatting of function descriptions in documentation * small edits * tech review and add spaceship operator to the director_entry class --------- Co-authored-by: TylerMSFT <12305055+TylerMSFT@users.noreply.github.com> Co-authored-by: learn-build-service-prod-05[bot] <274429479+learn-build-service-prod-05[bot]@users.noreply.github.com> * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#6802) * Update Vectorized STL algorithm documentation to reflect the current stae (#5937) Since the last update: * ARM64 and ARM64EC vectorization was added. Mention of x64 and x86 is removed, as vectorization is now supported on any target, except deprecated `/clr:pure` and `/clr:safe` modes. * `includes` is now manually vectorized too * `replace_copy` is now manually vectorized too Also moved `find_end` to `search` / `search_n` group, where it fits better. * Update header-files-cpp.md (#5938) Clarify intent of section * Update documentation on accessing System.String characters (#5940) * Update documentation on accessing System.String characters Added important note about treating interior pointers as const and linked to unsafe code best practices. * Update docs/dotnet/how-to-access-characters-in-a-system-string.md Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> * Apply suggestions from code review Co-authored-by: Aaron R Robinson <arobins@microsoft.com> --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com> * Clarify version prefix for Visual Studio Command Prompt (#5946) Updated instructions for starting Visual Studio Command Prompt to reflect changes in version specification. * Add new ARM64 feature arguments to documentation (#5950) Add new extensions `cssc` and `faminmax` to the `/feature` flag arguments documentation * atexit: Clarify DLL behavior is the same as _onexit (#5952) * atexit: Clarify DLL behavior is the same as _onexit - Document that atexit called from within a DLL will register the routine to run when the DLL is unloaded. atexit is a wrapper around _onexit which already documents this behavior. Ref: curl/curl#22383 (comment) Reported-by: Michał Petryka Closes #xxxx * Revise atexit documentation for accuracy Update the date and clarify DLL behavior for atexit. --------- Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> * Resolve syncing conflicts from FromPrivateLiveToMaster to main (#5953) * Clarify sentence about updating UI item states (#5955) Added a question mark to clarify the sentence about updating the state of user-interface items. * Update acquisition doc for vcpkg (#5957) * Update acquisition doc for vcpkg * remove en-us from URL * use relative link to vcpkg docs * Update docs/mfc/how-to-update-user-interface-objects.md Co-authored-by: learn-build-service-prod-08[bot] <274430765+learn-build-service-prod-08[bot]@users.noreply.github.com> --------- Co-authored-by: learn-build-service-prod[bot] <113403604+learn-build-service-prod[bot]@users.noreply.github.com> Co-authored-by: Learn Build Service GitHub App <Learn Build Service LearnBuild@microsoft.com> Co-authored-by: Alex Guteniev <gutenev@gmail.com> Co-authored-by: veganaiZe <7102064+veganaiZe@users.noreply.github.com> Co-authored-by: Aaron R Robinson <arobins@microsoft.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Eric Brumer <ericbr@microsoft.com> Co-authored-by: Vít Knobloch <67308900+vitknobloch@users.noreply.github.com> Co-authored-by: Jay Satiro <raysatiro@yahoo.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: Daniel Nikolov <114946180+danikolovv@users.noreply.github.com> Co-authored-by: Hector <v-ndat@microsoft.com> Co-authored-by: learn-build-service-prod-08[bot] <274430765+learn-build-service-prod-08[bot]@users.noreply.github.com> --------- Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: TylerMSFT <12305055+TylerMSFT@users.noreply.github.com> Co-authored-by: learn-build-service-prod-05[bot] <274429479+learn-build-service-prod-05[bot]@users.noreply.github.com> Co-authored-by: learn-build-service-prod[bot] <113403604+learn-build-service-prod[bot]@users.noreply.github.com> Co-authored-by: Learn Build Service GitHub App <Learn Build Service LearnBuild@microsoft.com> Co-authored-by: Alex Guteniev <gutenev@gmail.com> Co-authored-by: veganaiZe <7102064+veganaiZe@users.noreply.github.com> Co-authored-by: Aaron R Robinson <arobins@microsoft.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Eric Brumer <ericbr@microsoft.com> Co-authored-by: Vít Knobloch <67308900+vitknobloch@users.noreply.github.com> Co-authored-by: Jay Satiro <raysatiro@yahoo.com> Co-authored-by: Daniel Nikolov <114946180+danikolovv@users.noreply.github.com> Co-authored-by: Hector <v-ndat@microsoft.com> Co-authored-by: learn-build-service-prod-08[bot] <274430765+learn-build-service-prod-08[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: v-regandowner <97987445+v-regandowner@users.noreply.github.com>
It is a dangerous function. Remove usage by only starting the thread after setup completed successfully.
Ref: https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread
Ref: #21467 (comment)
Ref: #18996 (comment)
Ref: #18451
Follow-up to 9a26633 #17572