Conversation
Reporter tolerance check: (average - 1) wraps to ULONG_MAX when average is 0 (first cycle or short TM_TEST_DURATION runs), producing spurious ERROR messages. Guard with average > 0 before the check. Reporter snapshot: volatile counters were read multiple times per report cycle: once for the total sum, again for each per-counter tolerance comparison. Workers keep incrementing between reads, making the check self-inconsistent. Snapshot all counters into locals in a single pass, then compute total/average/tolerance from the snapshot. Porting layer bounds checks: all 13 API entry points in both ThreadX and FreeRTOS ports now validate thread_id, queue_id, semaphore_id, pool_id, and priority range, returning TM_ERROR for out-of-bounds values instead of silently indexing past array ends.
Thread-Metric Benchmark Results✅ All tests passed — Summary
Per-Test Results
|
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.
Reporter tolerance check: (average - 1) wraps to ULONG_MAX when average is 0 (first cycle or short TM_TEST_DURATION runs), producing spurious ERROR messages. Guard with average > 0 before the check.
Reporter snapshot: volatile counters were read multiple times per report cycle: once for the total sum, again for each per-counter tolerance comparison. Workers keep incrementing between reads, making the check self-inconsistent. Snapshot all counters into locals in a single pass, then compute total/average/tolerance from the snapshot.
Porting layer bounds checks: all 13 API entry points in both ThreadX and FreeRTOS ports now validate thread_id, queue_id, semaphore_id, pool_id, and priority range, returning TM_ERROR for out-of-bounds values instead of silently indexing past array ends.
Summary by cubic
Fixes false ERRORs in test reporters by snapshotting counters and avoiding unsigned wraparound, and adds bounds checks to all port APIs to prevent out-of-range access. Improves correctness on short test runs and hardens the FreeRTOS/ThreadX ports.
Written for commit b7e37b6. Summary will update on new commits.