Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Windows the .size ShmemConf parameter is not respected #107

Open
3tilley opened this issue Dec 20, 2023 · 0 comments
Open

On Windows the .size ShmemConf parameter is not respected #107

3tilley opened this issue Dec 20, 2023 · 0 comments

Comments

@3tilley
Copy link

3tilley commented Dec 20, 2023

Hello,

On linux if I ask to open a piece of Memory created somewhere else with a size, that size is the size of the buffer returned. On Windows if I do this (for a small buffer) I get 4096 - which I assume is the default smallest size for a piece of Windows shared memory. This means that the producer thinks it has buffer len x, while the consumer thinks it's working with buffer len 4096 (for a small buffer).

I think instead of using MEMORY_BASIC_INFORMATION.RegionSize the size from the opts should be taken, do you agree?

I've updated a test here to demonstrate this.

$ cargo test
   Compiling shared_memory v0.12.5 (C:\Users\Max\Documents\GitHub\shared_memory)
    Finished test [unoptimized + debuginfo] target(s) in 0.66s
     Running unittests src\lib.rs (target\debug\deps\shared_memory-baddeea1e8dc4909.exe)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests\general.rs (target\debug\deps\general-356fc0d2e34d7138.exe)

running 5 tests
test share_data ... FAILED
test create_new ... ok
test open_os_id ... ok
test create_with_flink ... ok
test open_flink ... ok

failures:

---- share_data stdout ----
thread 'share_data' panicked at tests\general.rs:109:5:
assertion `left == right` failed
  left: 4
 right: 4096
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    share_data

test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass `--test general`

Would you be happy for me to make this change?

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

No branches or pull requests

1 participant