Repository navigation
Parser view-lifetime UAF fix, quiet idle close, framing/soak gates - #11
Merged
Merged
Conversation
Request::method/target/version/body were string_views into the parser's working buffer: any feed() that reallocated it after the request line was parsed left the handler and keepAlive() reading freed memory (caught by ASan in the new suites). The parser now copies those fields when a request completes, so a Request owns its bytes. Idle keep-alive connections that finished their last request are now closed quietly (RFC 9112); 408 stays reserved for stalled requests. Adds tests/test_smuggling.cpp (server-level framing corpus incl. slow-body budgets), tests/test_threads.cpp (restored multi-reactor coverage, TSan), tests/test_soak.cpp (env-gated 60 s churn soak, RSS drift < 16 MiB: 109k iterations, 0 errors) plus a linux-soak CI job. .gitignore now ignores all build* trees.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Product bugs fixed
Requestfields werestring_views into the parser's working buffer; a laterfeed()that reallocated it left handler/keepAlive()reading freed memory. Repro path: byte-at-a-time feeds (slow clients).Requestnow owns its bytes (copied at completion).408: after ≥1 served request, an idle stream is now closed quietly per RFC 9112; 408 remains for stalled requests (fresh-connection 408 test still passes).Hardening coverage added
tests/test_smuggling.cpp— server-level framing corpus (CL+TE, TE variants, dup/signed/garbage CL, bare-LF, NUL-in-value, obs-fold, poison-behind-valid): exact status trace + the stream is dead after a rejection + rejected requests never reach the handler. Slow-body: 408 past budget, served inside budget.tests/test_threads.cpp— restored multi-reactor suite (keep-alive×4 reactors, stop-drain from every reactor, cross-reactor pipelined storms, idle-poll stop). Now genuinely executed by the TSan job.tests/test_soak.cpp—HTTP_SERVER_SOAK_SECONDS-gated 60 s churn soak (short/keep-alive/slow-read/abort/pipelined clients, 24 workers), RSS sampled via /proc. Measured: 109 110 iterations, 0 errors, 15.6→17.9 MB (2.3 MB drift). CI: newlinux-soakjob.Honest audit note
A
commit --amendchain earlier in this project silently droppedtest_connection.cpp,test_threads.cpp,test_util.cpp,test_range.cppand anhttp::Rangeextraction from their commits — they were never on GitHub, so every CI run since executed a smaller suite than reported (functionality itself was committed and is green). The threading suite is restored here; range/date coverage was verified to live inside the committedtest_static.cpp/test_date.cpp. Details recorded in PLAN.md.Verified locally: MinGW ck.ps1; Docker ASan (4 full runs clean incl. SIGINT smoke); Docker TSan (with the restored threading suite); 60 s soak in-container.