oracle / graalpython

A Python 3 implementation built on GraalVM
Other
1.2k stars 104 forks source link

multiprocessing.Array is buggy #307

Closed oroppas closed 1 year ago

oroppas commented 1 year ago

Hi,

It appears that multiprocessing.Array stores the wrong sequence of integer:

(graalpy) [ryuta@fedora tmp]$ graalpy 
Python 3.10.8 (Tue Jan 17 21:41:01 JST 2023)
[Graal, GraalVM CE, Java 17.0.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing import Value, Array
>>> num = Value('d', 0.0)
>>> arr = Array('i', range(10))
>>> print(arr[:])
[0, 0, 0, 1, 2, 3, 4, 5, 6, 7]
[ryuta@fedora tmp]$ python3
Python 3.11.1 (main, Dec  7 2022, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing import Value, Array
>>> num = Value('d', 0.0)
>>> arr = Array('i', range(10))
>>> print(arr[:])
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]