[issue39655] Shared_Memory attaching to incorrect Address in Windows

2020-02-16 Thread Orwell


New submission from Orwell :

Shared Memory is attaching to incorrect memory location ,
ex : retried the documentation example.

>>> import numpy as np
>>> a = np.array([1, 1, 2, 3, 5, 8])
>>> from multiprocessing import shared_memory
>>> shm = shared_memory.SharedMemory(create=True, size=a.nbytes)
>>> b = np.ndarray(a.shape, dtype=a.dtype, buffer=shm.buf)
>>> b[:] = a[:]
>>> b
array([1, 1, 2, 3, 5, 8])
>>> type(b)

>>> type(a)

>>> shm.name
'wnsm_62040dca'
>>> shm.buf


# In either the same shell or a new Python shell on the same machine

>>> import numpy as np
>>> from multiprocessing import shared_memory
>>> existing_shm = shared_memory.SharedMemory(name='wnsm_62040dca')
>>> c = np.ndarray((6,), dtype=np.int64, buffer=existing_shm.buf)
>>> c
array([ 4294967297, 12884901890, 34359738373,   0,   0,
 0], dtype=int64)
>>> c[-1]
0
>>> existing_shm.buf


--
components: Windows
messages: 362093
nosy: OH, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Shared_Memory attaching to incorrect Address in Windows
type: behavior
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue39655>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39655] Shared_Memory attaching to incorrect Address in Windows 10

2020-02-16 Thread Orwell


Change by Orwell :


--
title: Shared_Memory attaching to incorrect Address in Windows -> Shared_Memory 
attaching to incorrect Address in Windows 10

___
Python tracker 
<https://bugs.python.org/issue39655>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com