Skip to content

memdebug: stop tracking send and recv#20097

Closed
bagder wants to merge 2 commits intomasterfrom
bagder/memdebug-no-recv-send
Closed

memdebug: stop tracking send and recv#20097
bagder wants to merge 2 commits intomasterfrom
bagder/memdebug-no-recv-send

Conversation

@bagder
Copy link
Member

@bagder bagder commented Dec 25, 2025

  • they rarely catch any problems
  • we have other ways to test different send/recv problems
  • the number of such calls vary much more per invoke than others, making memdebugging harder
  • reducing the total number of fallible functions per test is good
  • they were not used as intended anyway

- they rarely catch any problems
- we have other ways to test different send/recv problems
- the number of such calls vary much more per invoke than others, making
  memdebugging harder
- reducing the total number of fallible functions per test is good
@bagder bagder added the tests label Dec 25, 2025
@bagder
Copy link
Member Author

bagder commented Dec 25, 2025

Also: due to changes over time, the macros were barely used. Contrary to original intention.

@bagder bagder requested a review from Copilot December 25, 2025 22:32
@bagder bagder marked this pull request as ready for review December 25, 2025 22:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes send/recv tracking from the memdebug system to improve test stability and reduce the number of fallible functions tracked during memory debugging. The tracking was deemed unnecessary as send/recv calls rarely catch problems and have high variability across test invocations.

Key changes:

  • Removed curl_dbg_send() and curl_dbg_recv() debug wrapper functions
  • Removed CURL_SEND and CURL_RECV macros that redirected to debug wrappers
  • Updated all callsites to use native send() and recv() functions directly

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/memdebug.c Removed the curl_dbg_send() and curl_dbg_recv() debug wrapper function implementations
lib/curl_setup.h Removed function declarations and macro definitions for CURL_SEND and CURL_RECV
tests/memanalyzer.pm Removed send/recv counters from memory analysis statistics and calculations
scripts/checksrc.pl Removed "send" and "recv" from the banned functions list (no longer need wrappers)
src/tool_doswin.c Changed CURL_SEND macro call to direct send() function call
src/tool_cb_rea.c Changed CURL_RECV macro call to direct recv() function call
lib/vquic/vquic.c Changed CURL_SEND macro call to direct send() function call
lib/multi.c Changed CURL_SEND macro call to direct send() function call

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder
Copy link
Member Author

bagder commented Dec 25, 2025

augment review

@augmentcode
Copy link

augmentcode bot commented Dec 25, 2025

🤖 Augment PR Summary

Summary: This PR simplifies the memdebug facility by stopping debug tracking/failure-injection for socket send() and recv() calls.

Changes:

  • Removed curl_dbg_send()/curl_dbg_recv() and the CURL_SEND/CURL_RECV macros from lib/curl_setup.h and lib/memdebug.c
  • Updated the remaining callsites to call the native send()/recv() functions directly
  • Adjusted scripts/checksrc.pl to no longer treat send/recv as banned functions
  • Updated tests/memanalyzer.pm to stop counting SEND/RECV operations in its memdebug log analysis

Technical Notes: This reduces the number of “fallible” operations tracked by memdebug and removes highly variable SEND/RECV counts from memdebug-derived test statistics.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@bagder bagder closed this in a585cc3 Dec 26, 2025
@bagder bagder deleted the bagder/memdebug-no-recv-send branch December 26, 2025 09:27
vszakats added a commit that referenced this pull request Jan 28, 2026
Also:
- checksrc: ban `send` and `recv`, as documented in `CODE_STYLE.md`.

Follow-up to 9a26633 #17572
Ref: a585cc3 #20097
Ref: #20441

Closes #20459
vszakats added a commit to vszakats/curl that referenced this pull request Jan 28, 2026
They were masked by `()`, which was also not necessary anymore.

Follow-up to a585cc3 curl#20097
Follow-up to bf7375e curl#18503
vszakats added a commit that referenced this pull request Jan 28, 2026
They were masked by `()`, which was also not necessary anymore.

Follow-up to 483f429 #20459
Follow-up to a585cc3 #20097
Follow-up to bf7375e #18503

Closes #20460
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants