Skip to content

Rewrite frame_cb tests to avoid coroutine_handle UB#240

Merged
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:pr/fix-build
Mar 21, 2026
Merged

Rewrite frame_cb tests to avoid coroutine_handle UB#240
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:pr/fix-build

Conversation

@mvandeberg
Copy link
Contributor

The original tests used from_address to create a coroutine_handle from a fake frame_cb struct. This violates [coroutine.handle.export.import] and LLVM exploits the UB at -O1+, compiling the tests to unreachable.

Tests 1-3: call frame_cb function pointers directly instead of routing through coroutine_handle.

Tests 4-5: replace fake frame + from_address with real task
coroutines that co_await custom IoAwaitables, using run_blocking (sync) and run_async + thread_pool (async).

The original tests used from_address to create a coroutine_handle
from a fake frame_cb struct. This violates [coroutine.handle.export.import]
and LLVM exploits the UB at -O1+, compiling the tests to `unreachable`.

Tests 1-3: call frame_cb function pointers directly instead of
routing through coroutine_handle.

Tests 4-5: replace fake frame + from_address with real task<int>
coroutines that co_await custom IoAwaitables, using run_blocking
(sync) and run_async + thread_pool (async).
@coderabbitai
Copy link

coderabbitai bot commented Mar 21, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • test/unit/ex/frame_cb.cpp is excluded by !**/test/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3f1c3a8d-6a9d-4bfe-80b9-bec1beb4d0c5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cppalliance-bot
Copy link

An automated preview of the documentation is available at https://240.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-03-21 02:06:46 UTC

@mvandeberg mvandeberg merged commit 150ee20 into cppalliance:develop Mar 21, 2026
36 of 37 checks passed
@mvandeberg mvandeberg deleted the pr/fix-build branch March 21, 2026 02:15
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.37%. Comparing base (fcd2854) to head (cae9c9f).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #240      +/-   ##
===========================================
- Coverage    92.38%   92.37%   -0.02%     
===========================================
  Files          168      168              
  Lines         9327     9327              
===========================================
- Hits          8617     8616       -1     
- Misses         710      711       +1     
Flag Coverage Δ
linux 92.35% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcd2854...cae9c9f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants