# SystemError: mmap the operation completed successfully issue with SharedArrays

**URL:** <https://discourse.julialang.org/t/systemerror-mmap-the-operation-completed-successfully-issue-with-sharedarrays/31579>\
**Category:** General Usage\
**Tags:** parallel, distributed\
**Created:** [November 27, 2019, 2:12pm UTC](https://discourse.julialang.org/t/systemerror-mmap-the-operation-completed-successfully-issue-with-sharedarrays/31579 "2019-11-27T14:12:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmcastro2109](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmcastro2109/32/38427_2.png) [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Post date:** [November 27, 2019, 2:12pm UTC](https://discourse.julialang.org/t/systemerror-mmap-the-operation-completed-successfully-issue-with-sharedarrays/31579/1 "2019-11-27T14:12:19Z")

</div>

I am confronting a very weird problem when parallelizing some function. The following MWE shows the problem

```julia
using Distributed, SharedArrays

rmprocs()
addprocs()
big_array = rand(100,11,20000)

function donothing(a)
   shared_array = convert(SharedArray,a)
end

for i=1:1000
    donothing(big_array)
end

```

This function is being called by another function in an iterative procedure. In the first iteration it works, but in the second iteration I get the following error

```julia
SystemError: mmap: The operation completed successfully. 
#windowserror#45(::Nothing, ::typeof(Base.windowserror), ::Symbol, ::Bool) at error.jl:148
windowserror at error.jl:148 [inlined]
#mmap#1(::Bool, ::Bool, ::typeof(Mmap.mmap), ::Mmap.Anonymous, ::Type{Array{Float64,3}}, ::Tuple{Int64,Int64,Int64}, ::Int64) at Mmap.jl:218
mmap(::Mmap.Anonymous, ::Type{Array{Float64,3}}, ::Tuple{Int64,Int64,Int64}, ::Int64) at Mmap.jl:186
_shm_mmap_array(::Type, ::Tuple{Int64,Int64,Int64}, ::String, ::UInt16) at SharedArrays.jl:670
shm_mmap_array(::Type, ::Tuple{Int64,Int64,Int64}, ::String, ::UInt16) at SharedArrays.jl:649
#call#3(::Bool, ::Array{Int64,1}, ::Type{SharedArray{Float64,3}}, ::Tuple{Int64,Int64,Int64}) at SharedArrays.jl:118
Type at SharedArrays.jl:105 [inlined]
Type at SharedArrays.jl:357 [inlined]
convert at SharedArrays.jl:369 [inlined]
donothing(::Array{Float64,3}) at mwproblem.jl:8
top-level scope at mwproblem.jl:12

```
