fix(io): guard null target in any_* rollback; raise test coverage to …#302
Conversation
…~98%
Fix a memory-safety bug in the any_* type-erased wrappers: the owning-
construction rollback guard called vt_->destroy(target_) unconditionally,
but if the wrapped stream/source/sink move-constructor throws, the
placement-new never assigns the target pointer, so destroy ran ~T() on a
null pointer (SIGSEGV for any type whose destructor touches a member).
Guard the destroy on a non-null target across all six wrappers. Confirmed
to crash before the fix and pass under ASan after.
Raise library line coverage from ~94% to ~98% by closing real gaps:
- throw_* helpers and error/cond category messages incl. default branches
- run_callbacks handler_pair specializations and frame_memory_resource
- call_await_suspend void/bool/handle branches and get_awaiter paths
- executor_ref/any_executor work-tracking, cross-type equality, target<>
- every any_* wrapper: type-erased await_suspend forwarding (via resuming
mocks the always-ready test mocks never reached), owning move-assign
teardown, and throwing-move construction regression tests
- run_async value-type allocator trampoline
- read_until multi-buffer linearize, lvalue buffer, and match_delim hint
- buffer operator+= clamping
Remaining uncovered lines are defensive/unreachable: local awaiter
methods that never suspend, terminate() paths, allocation-failure
rollback, and reentrancy guards.
|
An automated preview of the documentation is available at https://302.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-06-05 15:01:51 UTC |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #302 +/- ##
===========================================
+ Coverage 92.27% 96.46% +4.19%
===========================================
Files 164 164
Lines 8862 8951 +89
===========================================
+ Hits 8177 8635 +458
+ Misses 685 316 -369
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 32 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
GCOVR code coverage report https://302.capy.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-06-05 15:23:36 UTC |
…~98%
Fix a memory-safety bug in the any_* type-erased wrappers: the owning- construction rollback guard called vt_->destroy(target_) unconditionally, but if the wrapped stream/source/sink move-constructor throws, the placement-new never assigns the target pointer, so destroy ran ~T() on a null pointer (SIGSEGV for any type whose destructor touches a member). Guard the destroy on a non-null target across all six wrappers. Confirmed to crash before the fix and pass under ASan after.
Raise library line coverage from ~94% to ~98% by closing real gaps:
Remaining uncovered lines are defensive/unreachable: local awaiter methods that never suspend, terminate() paths, allocation-failure rollback, and reentrancy guards.