Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

On Windows the .size ShmemConf parameter is not respected

Aperta
#107 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust

Direzione di ricerca

Inizia da tests/general.rs, in particolare dal test share_data intorno alla riga 109, ed esegui cargo test su Windows per riprodurre la discrepanza di dimensione. Segui il percorso di apertura della memoria condivisa di Windows e confronta la lunghezza del buffer riportata con la dimensione ShmemConf richiesta; il lavoro è completo quando il test passa per un buffer piccolo senza modificare il comportamento su Linux.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
Rust
Stelle
442
Fork
63
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di elast0ny/shared_memory

Tutte le issue di elast0ny/shared_memory

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.