Skip to content

rs_port: UB stopgap fixes for future/pointer (#618)#629

Draft
Rahul-2k4 wants to merge 2 commits into
metacall:developfrom
Rahul-2k4:fix/rs-port-ub-stopgap-618
Draft

rs_port: UB stopgap fixes for future/pointer (#618)#629
Rahul-2k4 wants to merge 2 commits into
metacall:developfrom
Rahul-2k4:fix/rs-port-ub-stopgap-618

Conversation

@Rahul-2k4
Copy link
Copy Markdown

@Rahul-2k4 Rahul-2k4 commented Feb 20, 2026

Description

Summary of changes:

  • Avoid ownership-taking Box::from_raw in Debug implementations of
    MetaCallFuture and MetaCallPointer.
  • Add null guards before destructive raw-pointer drop/destroy paths.
  • Make MetaCallPointer::clone deep-clone Rust-side boxed value storage to
    avoid clone-based double-free.
  • Added regression tests for:
    • debug_on_null_raw_future_does_not_take_ownership
    • clone_and_consume_value_does_not_share_owned_box

Fixes #618

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code.
  • My changes generate no new warnings.
  • I have added tests/screenshots (if any) that prove my fix is effective or that my feature works.
  • I have tested the tests implicated (if any) by my own code and they pass (make test or ctest -VV -R <test-name>).
  • If my change is significant or breaking, I have passed all tests with ./docker-compose.sh test &> output and attached the output.
  • I have tested my code with OPTION_BUILD_ADDRESS_SANITIZER or ./docker-compose.sh test-address-sanitizer &> output and OPTION_TEST_MEMORYCHECK.
  • I have tested my code with OPTION_BUILD_THREAD_SANITIZER or ./docker-compose.sh test-thread-sanitizer &> output.
  • I have tested with Helgrind in case my code works with threading.
  • I have run make clang-format in order to format my code and my code follows the style guidelines.

Additional verification:

  • Offline ASAN build/install passed:
    • cmake -B build-asan-offline ... -DOPTION_BUILD_ADDRESS_SANITIZER=On
    • cmake --build build-asan-offline --target install -j
  • Offline TSAN build/install passed:
    • cmake -B build-tsan-offline ... -DOPTION_BUILD_THREAD_SANITIZER=On
    • cmake --build build-tsan-offline --target install -j

@viferga viferga marked this pull request as draft March 24, 2026 23:03
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.

Potential unsoundness

1 participant