Unable to retrieve instances of user-defined types from remote processes #13861 Closed mrfrank8176 opened this Issue on Nov 3, 2015 · 4 comments Projects None yet Labels parallel Milestone No milestone Assignees No one assigned 3 participants @mrfrank8176 @amitmurthy @jakebolewski Notifications You’re not receiving notifications from this thread. @mrfrank8176 mrfrank8176 commented on Nov 3, 2015 Here's the code: julia> addprocs() 4-element Array{Int64,1}: 2 3 4 5 julia> @everywhere begin type Test values::Array{Any,1} addValue::Function function Test() this = new() this.values = Any[] this.addValue = function(v) push!(this.values,v) end return this end end end julia> @spawnat 2 whos() RemoteRef{Channel{Any}}(2,1,9) julia> From worker 2: Base 13039 KB Module : Base From worker 2: Core 1959 KB Module : Core From worker 2: Main 14945 KB Module : Main From worker 2: Test 124 bytes DataType : Test julia> @spawnat 2 whos() RemoteRef{Channel{Any}}(2,1,14) julia> From worker 2: Base 13041 KB Module : Base From worker 2: Core 1959 KB Module : Core From worker 2: Main 14946 KB Module : Main From worker 2: Test 124 bytes DataType : Test From worker 2: t 16 bytes Test : Test(Any[],(anonymous funct… julia> @everywhere t.addValue(myid()) julia> @spawnat 2 whos() RemoteRef{Channel{Any}}(2,1,19) julia> From worker 2: Base 13044 KB Module : Base From worker 2: Core 1959 KB Module : Core From worker 2: Main 14949 KB Module : Main From worker 2: Test 124 bytes DataType : Test From worker 2: t 24 bytes Test : Test(Any[2],(anonymous func… julia> r = @spawnat 2 t and then I get a huge error ending in: in serialize at serialize.jl:414 (repeats 2 times) in serialize at serialize.jl:127 in serialize at serialize.jl:298 in serialize at serialize.jl:414 (repeats 2 times) in serialize at serialize.jl:127 in serialize at serialize.jl:298 in serialize at serialize.jl:414 (repeats 2 times) in serialize at serialize.jl:127 in serialize at serialize.jl:298 in serialize at serialize.jl:414 in serialize at serialize.jl:127 in serialize at serialize.jl:298 in serialize at serialize.jl:414 in send_msg_ at multi.jl:222 in remotecall at multi.jl:710 in spawnat at multi.jl:1320 in eval_user_input at REPL.jl:64 [inlined code] from REPL.jl:93 in anonymous at task.jl:68 ArgumentError: stream is closed or unusable ERROR (unhandled task failure): EOFError: read end of file This leads me to believe there is an issue serializing user-defined types. Any ideas? Thanks. @mrfrank8176 mrfrank8176 commented on Nov 3, 2015 A related approach also fails: julia> r = remotecall_fetch(3,()->t) Worker 3 terminated.ERROR: ProcessExitedException() in yieldto at ./task.jl:76 in wait at ./task.jl:372 in wait at ./task.jl:287 in wait at ./channels.jl:93 in take! at ./channels.jl:82 in take! at ./multi.jl:792 in remotecall_fetch at multi.jl:729 in remotecall_fetch at multi.jl:734 in eval_user_input at REPL.jl:64 [inlined code] from REPL.jl:93 in anonymous at task.jl:68 ERROR (unhandled task failure): StackOverflowError: @jakebolewski jakebolewski added the parallel label on Nov 3, 2015 @mrfrank8176 mrfrank8176 commented on Nov 3, 2015 Here is a simpler example with what appears to be a similar error: addprocs() @everywhere begin type Test values::Array{Any,1} addValue::Function function Test() this = new() this.values = Any[] this.addValue = function(v) push!(this.values,v) end return this end end end t = Test() R = RemoteRef() put!(R,t) @spawnat 2 println(fetch(R)) @amitmurthy The Julia Language member amitmurthy commented on Nov 19, 2015 Which version of Julia are you on? I tested the above on master and 0.4.1, both work fine on Linux. @mrfrank8176 mrfrank8176 commented on Nov 19, 2015 This issue was resolved in the most recent release. Also works fine in 0.5.0 @mrfrank8176 mrfrank8176 closed this on Nov 19, 2015