-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fld and div failure inside a testset #23866
Comments
Most likely LLVM issue? julia> using Base.Test
julia> @testset begin
@test fld(0.3,0.01) == 29.0
@test div(0.3,0.01) == 29.0
end
Test Summary: | Pass Total
test set | 2 2
Base.Test.DefaultTestSet("test set", Any[], 2, false)
julia> @test fld(0.3,0.01) == 29.0
Test Passed
julia> @test div(0.3,0.01) == 29.0
Test Passed |
You are on a newer version than |
Yes. 5.0 |
I'm not sure this is related, but I found another case of function having a different behavior inside a julia> begin
ptr = cfunction(x -> x*x, Cdouble, Tuple{Cdouble})
g(x) = ccall(ptr, Cdouble, (Cdouble,), x)
g(3.0)
end
9.0 vs julia> Base.Test.@testset begin
ptr = cfunction(x -> x*x, Cdouble, Tuple{Cdouble})
g(x) = ccall(ptr, Cdouble, (Cdouble,), x)
g(3.0)
end
Internal error: encountered unexpected error in runtime:
BoundsError(a=Array{Any, 1}[Expr(:return, Expr(:foreigncall, Expr(:block, SSAValue(1) = Expr(:call, Core.getfield, SlotNumber(id=1), :(:ptr))::Any, Expr(:if, Expr(:call, Core.isdefined, SSAValue(1), :(:contents))::Any, nothing, Expr(:block, <newvar #<3>>, SlotNumber(id=3))::Any)::Any, Expr(:call, Core.getfield, SSAValue(1), :(:contents))::Any)::Any, Float64, svec(Float64), :(:ccall), 1, SlotNumber(id=2))::Float64)::Any], i=(0,))
rec_backtrace at /home/mose/repo/julia/src/stackwalk.c:87
record_backtrace at /home/mose/repo/julia/src/task.c:246
jl_throw at /home/mose/repo/julia/src/task.c:568
jl_bounds_error_ints at /home/mose/repo/julia/src/rtutils.c:182
getindex at ./array.jl:768
_getfield_elim_pass! at ./inference.jl:5599
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
_getfield_elim_pass! at ./inference.jl:5583
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
_getfield_elim_pass! at ./inference.jl:5583
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
_getfield_elim_pass! at ./inference.jl:5583
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
getfield_elim_pass! at ./inference.jl:5576
optimize at ./inference.jl:3402
typeinf at ./inference.jl:3303
typeinf_frame at ./inference.jl:2984 [inlined]
typeinf_code at ./inference.jl:3066
jlcall_typeinf_code_794 at /home/mose/repo/julia/usr/lib/julia/sys.so (unknown line)
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
typeinf_ext at ./inference.jl:3105
jlcall_typeinf_ext_0 at /home/mose/repo/julia/usr/lib/julia/sys.so (unknown line)
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
jl_apply at /home/mose/repo/julia/src/julia.h:1451 [inlined]
jl_apply_with_saved_exception_state at /home/mose/repo/julia/src/rtutils.c:249
jl_type_infer at /home/mose/repo/julia/src/gf.c:263
jl_compile_for_dispatch at /home/mose/repo/julia/src/gf.c:1691
jl_compile_method_internal at /home/mose/repo/julia/src/julia_internal.h:334 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:381 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
macro expansion at ./REPL[1]:4 [inlined]
macro expansion at ./test.jl:942 [inlined]
anonymous at ./<missing> (unknown line)
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_toplevel_eval_flex at /home/mose/repo/julia/src/toplevel.c:628
jl_toplevel_eval_in at /home/mose/repo/julia/src/builtins.c:625
eval at ./repl/REPL.jl:3
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
eval_user_input at ./repl/REPL.jl:69
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
macro expansion at ./repl/REPL.jl:100 [inlined]
#1 at ./event.jl:96
jl_call_fptr_internal at /home/mose/repo/julia/src/julia_internal.h:366 [inlined]
jl_call_method_internal at /home/mose/repo/julia/src/julia_internal.h:385 [inlined]
jl_apply_generic at /home/mose/repo/julia/src/gf.c:1980
jl_apply at /home/mose/repo/julia/src/julia.h:1451 [inlined]
start_task at /home/mose/repo/julia/src/task.c:268
unknown function (ip: 0xffffffffffffffff)
test set: Error During Test
Got an exception of type ErrorException outside of a @test
error compiling g: unsupported or misplaced expression "block" in function g
Stacktrace:
[1] macro expansion at ./REPL[1]:4 [inlined]
[2] macro expansion at ./test.jl:942 [inlined]
[3] anonymous at ./<missing>:?
[4] eval(::Module, ::Expr) at ./repl/REPL.jl:3
[5] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./repl/REPL.jl:69
[6] macro expansion at ./repl/REPL.jl:100 [inlined]
[7] (::getfield(Base.REPL, Symbol("##1#2")){Base.REPL.REPLBackend})() at ./event.jl:96
Test Summary: | Error Total
test set | 1 1
ERROR: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken. With git-bisect I found this started to happen with #23698. First reported on Discourse: https://discourse.julialang.org/t/function-erroring-inside-testset-but-not-outside/6064 |
That's a different issue. |
Fine, I opened a new ticket: #23878. |
Any update on this? |
Dup of #14089 |
From #23862. Reduced to the following:
The above two tests fail while inside a
@testset
:Without the testset they pass just fine:
The text was updated successfully, but these errors were encountered: