Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates multi-threaded signal handling tests by removing the separate tests/multithread.rs file and integrating its tests into tests/api_thread.rs. The changes also introduce critical bug fixes for integer overflow handling in virtual memory operations and improve test reliability by fixing race condition detection logic.
Key changes:
- Added proper overflow protection in
VmIoimplementation usingchecked_subandchecked_addoperations - Fixed a bug in the
thread_handlertest that could produce false positives by using bit flags instead of counters to track distinct signal deliveries - Consolidated test utilities and test cases from a separate file into the main thread API test file
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/multithread.rs | Removed separate multithreading test file; tests moved to api_thread.rs |
| tests/api_thread.rs | Added overflow-safe arithmetic in VmIo methods, integrated multithreading tests with improved signal delivery tracking logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/api_thread.rs
Outdated
|
|
||
| static POOL: LazyLock<Mutex<Box<[u8]>>> = LazyLock::new(|| { | ||
| let size = 0x0100_0000; // 1 MiB | ||
| let size = 0x0100_0000; |
There was a problem hiding this comment.
The comment indicating the size unit "1 MiB" has been removed. The value 0x0100_0000 is actually 16 MiB (16,777,216 bytes), not 1 MiB (1,048,576 bytes). While removing the incorrect comment avoids misleading information, consider adding a correct comment such as "16 MiB" for clarity.
| let size = 0x0100_0000; | |
| let size = 0x0100_0000; // 16 MiB |
|
What's your idea on #10 (comment)? I think it is good to reduce code duplication. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
I understand... |
Supplement to #10