-
-
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
codegen assertion failure, problem with code_native #15971
Comments
I get
|
perhaps an effect of #15617? |
Do you think it's a good idea to add a test here, something kinda like this? On v0.4.5: julia> function test_native()
orig = STDOUT
temp = redirect_stdout()[1]
@code_native 1 + 1
println("END")
lines = []
while true
line = readline(temp)
if line == "END\n"
break
end
push!(lines, line)
end
redirect_stdout(orig)
join(lines, "")
end
test_native (generic function with 1 method)
julia> native_test = "\t.text\nFilename: int.jl\nSource line: 8\n\tpushq\t%rbp\n\tmovq\t%rsp, %rbp\nSource line: 8\n\taddq\t%rsi, %rdi\n\tmovq\t%rdi, %rax\n\tpopq\t%rbp\n\tret\n"
"\t.text\nFilename: int.jl\nSource line: 8\n\tpushq\t%rbp\n\tmovq\t%rsp, %rbp\nSource line: 8\n\taddq\t%rsi, %rdi\n\tmovq\t%rdi, %rax\n\tpopq\t%rbp\n\tret\n"
julia> using Base.Test
julia> @test test_native() == native_test The expected output seems to be consistent except on ARM, but could be tailored, I don't know if it's a good idea, but I allways show off the |
That is the meaning of the |
@yuyichao I understand that, but I mean is the way I'm testing is a good idea, that's the only way of testing this that came up to me, if it is I can send PR for review, thanks! |
No, every optimization, debug option, line number change, different architecture, available instructions set is going to break this badly. Just test for the length should be good enough to notice the difference.
I don't see the point of sending a PR with a failing test while there's already an open issue to track the problem. |
That's what I wanted to know. I had the impression that the expected native output for
Me neither, of course was I meant to send a PR with a working test (since there are any for this yet, even when there is an issue), not the snippet above (I just said something like that), which is why I'm asking.
Oh, I didn't know that, it's not documented, except for I'm still not good enough to help you here, so I'll go document that stuff. |
I didn't realize it wasn't..... FYI both |
Try |
ade5a90 doesn't address the testing part of this issue. function test_bin_reflection(freflect, f, types, n)
iob = IOBuffer()
freflect(iob, f, types)
str = takebuf_string(iob)
@test !isempty(str)
lines = length(split(str, "\n"))
@test lines ≤ n
end ❓ |
that looks fine too. there's an assertion failure that it was 50-50 likely to hit also, depending on how various functions got placed in the object file. |
and yet the assertion failure never seemed to happen on CI? |
the assertion isn't enabled on CI |
Line 69 in e8601e8
We should build LLVM with assertions enabled on CI. |
The actual output is too long to post here but it looks like
Piping to
tail
suggest that the end is always the same so it seems that the disassembler works until it reaches the end of the file.Bisect result. ad37021
@vtjnash
The text was updated successfully, but these errors were encountered: