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

Type inference error due to precompilation #18449

Closed
yuyichao opened this issue Sep 12, 2016 · 2 comments
Closed

Type inference error due to precompilation #18449

yuyichao opened this issue Sep 12, 2016 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules needs tests Unit tests are required for this change regression Regression in behavior compared to a previous version

Comments

@yuyichao
Copy link
Contributor

yuyichao commented Sep 12, 2016

A.jl

__precompile__()

module A
function f1()
    warn("")
end
precompile(f1, ())
end

B.jl

__precompile__()

module B
function f2()
    warn("")
end
precompile(f2, ())
end

runtests.jl (in the same directory as A.jl and B.jl)

#

unshift!(Base.LOAD_PATH, dirname(@__FILE__))

using B
using A

B.f2()
A.f1()

Running on current master gives,

WARNING: 
WARNING: An error occurred during inference. Type inference is now partially disabled.
ErrorException("type inference data-flow error: tried to double infer a function")
rec_backtrace at /build/julia-git/src/julia-avx2/src/stackwalk.c:84
record_backtrace at /build/julia-git/src/julia-avx2/src/task.c:238
jl_throw at /build/julia-git/src/julia-avx2/src/task.c:560
abstract_eval at ./inference.jl:1186
unknown function (ip: 0x7fee9cbdb506)
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
abstract_interpret at ./inference.jl:1238
unknown function (ip: 0x7fee9cbd9c26)
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
typeinf_frame at ./inference.jl:1733
typeinf_loop at ./inference.jl:1679
unknown function (ip: 0x7fee9cbd95db)
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
typeinf_edge at ./inference.jl:1598
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
typeinf_ext at ./inference.jl:1622
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
jl_apply at /build/julia-git/src/julia-avx2/src/julia.h:1364 [inlined]
jl_type_infer at /build/julia-git/src/julia-avx2/src/gf.c:212
emit_invoke at /build/julia-git/src/julia-avx2/src/codegen.cpp:2724 [inlined]
emit_expr at /build/julia-git/src/julia-avx2/src/codegen.cpp:3190
emit_function at /build/julia-git/src/julia-avx2/src/codegen.cpp:4792
jl_compile_linfo at /build/julia-git/src/julia-avx2/src/codegen.cpp:810
jl_compile_for_dispatch at /build/julia-git/src/julia-avx2/src/gf.c:1312
jl_call_method_internal at /build/julia-git/src/julia-avx2/src/julia_internal.h:180
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
do_call at /build/julia-git/src/julia-avx2/src/interpreter.c:66
eval at /build/julia-git/src/julia-avx2/src/interpreter.c:205
jl_interpret_toplevel_expr at /build/julia-git/src/julia-avx2/src/interpreter.c:31 [inlined]
jl_toplevel_eval_flex at /build/julia-git/src/julia-avx2/src/toplevel.c:619
jl_parse_eval_all at /build/julia-git/src/julia-avx2/src/ast.c:735
jl_load at /build/julia-git/src/julia-avx2/src/toplevel.c:657
jl_load_ at /build/julia-git/src/julia-avx2/src/toplevel.c:666
include_from_node1 at ./loading.jl:541
unknown function (ip: 0x7fee9cd0864b)
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
process_options at ./client.jl:262
_start at ./client.jl:326
unknown function (ip: 0x7fee9cd2e308)
jl_apply_generic at /build/julia-git/src/julia-avx2/src/gf.c:1944
unknown function (ip: 0x40181c)
unknown function (ip: 0x401276)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
unknown function (ip: 0x4012d9)
WARNING: 

This causes a failure in Gadfly test.
Doesn't happen on 0.4 or 0.5.

@yuyichao yuyichao added regression Regression in behavior compared to a previous version compiler:precompilation Precompilation of modules labels Sep 12, 2016
vtjnash added a commit that referenced this issue Sep 12, 2016
…lizer

fix #18449
(the real, non-buggy fix is in #18413 for v0.6-dev master)
vtjnash added a commit that referenced this issue Sep 12, 2016
…lizer

fix #18449
(the real, non-buggy fix is in #18413 for v0.6-dev master)
@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Sep 13, 2016
@yuyichao
Copy link
Contributor Author

Fixed by #18413

@tkelman tkelman added the needs tests Unit tests are required for this change label Sep 17, 2016
@tkelman
Copy link
Contributor

tkelman commented Sep 17, 2016

#18413 did not add a test for this on master, did it?

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 compiler:precompilation Precompilation of modules 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

3 participants