Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrelated module wrapped in closure with --inline=no only #15766

Closed
andreasnoack opened this issue Apr 5, 2016 · 6 comments
Closed

Unrelated module wrapped in closure with --inline=no only #15766

andreasnoack opened this issue Apr 5, 2016 · 6 comments
Labels
bug Indicates an unexpected problem or unintended behavior needs tests Unit tests are required for this change regression Regression in behavior compared to a previous version

Comments

@andreasnoack
Copy link
Member

The following code snippet fails when julia is launched --inline=no but works fine in normal mode. This causes the DistributedArrays.jl tests to fail.

import FactCheck

addprocs(1)

using DistributedArrays

g = () -> begin
    f = x -> Int(x)
    A = [1,2]
    DA = distribute(A)
    mapreduce(f, +, A)
    mapreduce(f, +, DA)
end

g()

Notice that FactCheck is not used for anything in g but the worker fails with

WARNING: Module FactCheck not defined on process 2
fatal error on 2: ERROR: UndefVarError: FactCheck not defined
 in deserialize(::SerializationState{TCPSocket}, ::Type{Module}) at ./serialize.jl:542
 [inlined code] from ./promotion.jl:135
 in handle_deserialize(::SerializationState{TCPSocket}, ::Int32) at ./serialize.jl:515
 [inlined code] from ./sysimg.jl:48
 in deserialize_datatype(::SerializationState{TCPSocket}) at ./serialize.jl:740
 in handle_deserialize(::SerializationState{TCPSocket}, ::Int32) at ./serialize.jl:505
 [inlined code] from ./sysimg.jl:48
 in deserialize(::SerializationState{TCPSocket}, ::Type{SimpleVector}) at ./serialize.jl:522
 [inlined code] from ./promotion.jl:135
 in handle_deserialize(::SerializationState{TCPSocket}, ::Int32) at ./serialize.jl:515
 [inlined code] from ./sysimg.jl:48
 in deserialize_datatype(::SerializationState{TCPSocket}) at ./serialize.jl:747
 in handle_deserialize(::SerializationState{TCPSocket}, ::Int32) at ./serialize.jl:505
 in deserialize_array(::SerializationState{TCPSocket}) at ./serialize.jl:640
 in handle_deserialize(::SerializationState{TCPSocket}, ::Int32) at ./serialize.jl:503
 [inlined code] from ./sysimg.jl:48
...

I've tried to reduce it but this is as small as I could make it. E.g. if either Int is used directly or removed from the f then the error goes away. If one of the mapreduce lines is commented out or if the order is reversed the error also goes away.

I've tried with a few other packages instead of FactCheck and they don't fail. However, since this has different behavior with and without inlining, I think the bug report is appropriate here.

My system is

Julia Version 0.5.0-dev+3390
Commit a9e7e86* (2016-04-04 12:47 UTC)
DEBUG build
Platform Info:
  System: Darwin (x86_64-apple-darwin15.4.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT NO_AFFINITY HASWELL)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
@andreasnoack andreasnoack added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version labels Apr 5, 2016
andreasnoack added a commit to JuliaParallel/DistributedArrays.jl that referenced this issue Apr 5, 2016
andreasnoack added a commit to JuliaParallel/DistributedArrays.jl that referenced this issue Apr 5, 2016
@andreasnoack
Copy link
Member Author

I've bisected this to f6e9f8d.

@andreasnoack
Copy link
Member Author

This popped up again in https://travis-ci.org/JuliaParallel/DistributedArrays.jl/builds/125829660 and it can be reproduced consistently with --inline=no.

@yuyichao
Copy link
Contributor

Ah, this is the issue. Close #15996 as a dup of this. I think this is caused by serialization of the lambdainfo/method.

@amitmurthy
Copy link
Contributor

Same as #15451 ?

@vtjnash
Copy link
Member

vtjnash commented Jul 19, 2016

fixed on master, by #16692?

julia> import FactCheck

julia> addprocs(1)
1-element Array{Int64,1}:
 2

julia> using DistributedArrays

julia> using Primes

julia> g = () -> begin
           f = x -> Int(x)
           A = [1,2]
           DA = distribute(A)
           mapreduce(f, +, A)
           mapreduce(f, +, DA)
       end
(::#1) (generic function with 1 method)

julia> factor(1,)
Dict{Int64,Int64} with 0 entries

julia> g()
WARNING: specialized_binary(f::Function) is deprecated, use f instead.
 in depwarn(::String, ::Symbol) at ./deprecated.jl:64
 in specialized_binary(::Function) at deprecated.jl:50
 in mapreduce(::Function, ::Function, ::DistributedArrays.DArray{Int64,1,Array{Int64,1}}) at /Users/jameson/.julia/v0.5/DistributedArrays/src/DistributedArrays.jl:679
 in (::##1#3)() at REPL[5]:6
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval(::Module, ::Expr) at REPL.jl:3
 in macro expansion; at REPL.jl:92 [inlined]
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at event.jl:46
while loading no file, in expression starting on line 0
3

@andreasnoack
Copy link
Member Author

I think so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior needs tests Unit tests are required for this change regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

5 participants