Permission denied using mmap on Windows
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
I have a Windows service that creates a memory mapped file using the global scope and a client that reads the global scope. The problem is that the current implementation calls CreateFileMapping() instead of OpenFileMapping(). So when the client tries to connect the global scope, its throws a permission error.
The expected behavior is: Only the server has the permission the create a global memory mapped file and any client can read the created memory mapped file.
Here is a sample code:
server.py
from mmap import mmap
from pickle import load, dump
mm = mmap(-1, 32, tagname=r'Global\test')
last_request_id = None
while True:
mm.seek(0)
try:
request_id = int(load(mm))
if request_id != last_request_id:
last_request_id = request_id
print(request_id)
except Exception:
pass
client.py
from mmap import mmap
from pickle import dump
with mmap(-1, 32, tagname='Global\test') as mm:
request_id = 1
dump(request_id, mm)
Your environment
- CPython versions tested on: 3.11
- Operating system and architecture: Windows 11 - Version 22H2 (OS Build 22621.819)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Modules/mmapmodule.c の 1531 行目付近から始め、Windows の mmap 処理を CreateFileMapping() と OpenFileMapping() のドキュメントと併せて読んでください。Windows 11 で server.py と client.py の例を再現してください。サーバーが Global マッピングを作成でき、クライアントが権限エラーなしでそれを開いて読み取れることが完了の条件です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100