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

Segfault on method error #24122

Closed
iblislin opened this issue Oct 13, 2017 · 15 comments
Closed

Segfault on method error #24122

iblislin opened this issue Oct 13, 2017 · 15 comments

Comments

@iblislin
Copy link
Member

iblislin commented Oct 13, 2017

Got segault on master (39f668c) and 0.6.1-pre.92

julia -e 'using Flux; struct A end; A() * 1'

I expect it will throw MethodError.

[removed spurious issue – mike]

@SimonDanisch
Copy link
Contributor

That's pretty much expected. Internals like pointer arithmetic uses *(::Int, ::Int), so redefining that to something else pretty much needs to segfault...

@martinholters
Copy link
Member

Dup of #20945, #22132, #23605, #21944, #24078

@iblislin
Copy link
Member Author

hmm 🤔 ... the original case is

julia -e 'using Flux; struct A end; A() * 1'

but I do not think Flux redefine *(::Int, ::Int)

@KristofferC
Copy link
Member

KristofferC commented Oct 13, 2017

So, what was the reason you put that in your first post?

@iblislin
Copy link
Member Author

just found it crashed as well, and guess the cause is the same...

@MikeInnes MikeInnes changed the title Segfault on CustomType * 1 Segfault on method error Oct 13, 2017
@MikeInnes
Copy link
Member

Lol, unfortunately Julia will segfault for more than one reason. Reopening to reflect the real issue.

@MikeInnes MikeInnes reopened this Oct 13, 2017
@iblislin
Copy link
Member Author

└─[iblis@kaladbolg Oops]% julia -e 'using Flux; struct A end; A() * 1'               
                                                                                   
ERROR:                                                                               
signal (11): Segmentation fault                                                      
while loading no file, in expression starting on line 0                              
jl_egal at /home/iblis/git/julia06/src/builtins.c:114                                
show at ./show.jl:1099                                                               
show at ./show.jl:208                                                                
unknown function (ip: 0x7f10f7d0ea1f)                    
jl_call_fptr_internal at /home/iblis/git/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/iblis/git/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/iblis/git/julia06/src/gf.c:1926                            
print at ./strings/io.jl:29                                                          
unknown function (ip: 0x7f10e8062e26)                    
jl_call_fptr_internal at /home/iblis/git/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/iblis/git/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/iblis/git/julia06/src/gf.c:1926
#print_to_string#229 at ./strings/io.jl:102
jl_call_fptr_internal at /home/iblis/git/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/iblis/git/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/iblis/git/julia06/src/gf.c:1926
string at ./strings/io.jl:120
jl_call_fptr_internal at /home/iblis/git/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/iblis/git/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/iblis/git/julia06/src/gf.c:1926
show_method_candidates at ./replutil.jl:511
unknown function (ip: 0x7f10e806187d)
jl_call_fptr_internal at /home/iblis/git/julia06/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/iblis/git/julia06/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/iblis/git/julia06/src/gf.c:1926
showerror at ./replutil.jl:415
#476 at ./replutil.jl:213
...

@martinholters
Copy link
Member

Reminds me of #22842.

@martinholters
Copy link
Member

With Julia 0.6.1-pre.92 and Flux 0.3.2, I get the expected MethodError, no crash.
With Julia 0.7.0-DEV.2157 (or 0.7.0-DEV.2136 corresponding to 39f668c) and Flux 0.3.2, using Flux errors (due to an assertion in Hiccup).
Can you provide the versions of Flux and its dependencies you were using?

@iblislin
Copy link
Member Author

Julia 0.6.1-pre.92 and Flux master (83cc77c) got randomly crashing.
(Sometimes it pop MethodError correctly.)

julia> Pkg.status.(["DataFlow", "Juno", "MacroTools", "NNlib", "ForwardDiff", "Requires"])
 - DataFlow                      0.3.0+             master
 - Juno                          0.3.1                                   
 - MacroTools                    0.3.7                                   
 - NNlib                         0.1.2+             act-elu
 - ForwardDiff                   0.6.0
 - Requires                      0.4.3
6-element Array{Void,1}:
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing

julia> versioninfo()
Julia Version 0.6.1-pre.92
Commit 389b23cf6e* (2017-10-07 01:18 UTC)
Platform Info:                                                                                                                                    
  OS: Linux (x86_64-pc-linux-gnu)                                                                                                                 
  CPU: Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz                                                                                                  
  WORD_SIZE: 64                                                                                                                                   
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)                                                                                
  LAPACK: libopenblas64_                                                                                                                          
  LIBM: libopenlibm                                                                                                                               
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

@iblislin
Copy link
Member Author

With Julia 0.7.0-DEV.2157 (or 0.7.0-DEV.2136 corresponding to 39f668c) and Flux 0.3.2, using Flux errors (due to an assertion in Hiccup).

well, got same error during using here.

@martinholters
Copy link
Member

Hm, I still don't see the crash with the versions you gave, where DataFlow master is 417105f, except for NNlib which I left at 0.1.2. Meanwhile, does using Flux; methods(*) crash for you? Can you try applying f4619d0 locally to see whether that fixes it?

@iblislin
Copy link
Member Author

iblislin commented Oct 16, 2017

Meanwhile, does using Flux; methods(*) crash for you?

Before patching, it does not crash... I ran it more than 10 times, no crashing.

Can you try applying f4619d0 locally to see whether that fixes it?

After patching, it does not run into any crash with using Flux; struct A end; A() * 1. 👍
Will this patch be shipped with 0.6.1 releasing?

@martinholters
Copy link
Member

Will this patch be shipped with 0.6.1 releasing?

#23831 has the backport pending tag and should be trivial to backport, but it was probably too late to be considered in #23670. OTOH, 0.6.1 isn't out, so... @ararslan?

@ararslan
Copy link
Member

Won't make it into 0.6.1 but we can always do a 0.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants