Fix: Harden clock interception safety, improve documentation, and enforce CI regression coverage - #9
Open
mertcano wants to merge 2 commits into
Open
Fix: Harden clock interception safety, improve documentation, and enforce CI regression coverage#9mertcano wants to merge 2 commits into
mertcano wants to merge 2 commits into
Conversation
…orce CI regression coverage ### Description This PR addresses memory layout safety, documentation maintainability, and testing gaps within the `deterministic-simulator` repository, as identified in the workspace-wide security audit. **Quality & Security Defects Remediated:** * **Clock Interceptor Memory/Layout Safety (`msim/src/sim/time/mod.rs`):** The Linux monotonic-clock path previously relied on a dangerous `transmute` operation to convert the opaque `std::time::Instant` representation directly into `libc::timespec`. This unstable ABI contract led to invalid timestamp failures under the current Rust toolchain. The interceptor has been refactored to safely and explicitly serialize the simulated duration into the `tv_sec` and `tv_nsec` fields. * **Documentation and Maintainability (`msim/src/sim/runtime/mod.rs`):** Existing inline code comments and documentation have been normalized into complete, grammatically correct English sentences. This improves code readability and ensures better maintainability for future development. * **Regression Coverage and CI Masking (`.github/workflows/ci.yml`):** The exclusions for the TCP hangup-read tests have been removed from the CI configuration. By re-enabling these tests, the recently repaired TCP connection liveness behavior is now strictly enforced and automatically validated on every future pull request.
Removed exclusions for TCP hangup tests to ensure all tests run, enforcing repaired liveness behavior in simulated CI.
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.
Description
This PR addresses memory layout safety, documentation maintainability, and testing gaps within the
deterministic-simulatorrepository, as identified in the workspace-wide security audit.Quality & Security Defects Remediated:
Clock Interceptor Memory/Layout Safety (
msim/src/sim/time/mod.rs): The Linux monotonic-clock path previously relied on a dangeroustransmuteoperation to convert the opaquestd::time::Instantrepresentation directly intolibc::timespec. This unstable ABI contract led to invalid timestamp failures under the current Rust toolchain. The interceptor has been refactored to safely and explicitly serialize the simulated duration into thetv_secandtv_nsecfields.Documentation and Maintainability (
msim/src/sim/runtime/mod.rs): Existing inline code comments and documentation have been normalized into complete, grammatically correct English sentences. This improves code readability and ensures better maintainability for future development.Regression Coverage and CI Masking (
.github/workflows/ci.yml): The exclusions for the TCP hangup-read tests have been removed from the CI configuration. By re-enabling these tests, the recently repaired TCP connection liveness behavior is now strictly enforced and automatically validated on every future pull request.