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

Testing BSplineKit asserts in LLVM with Attribute after last parameter! #47245

Closed
KristofferC opened this issue Oct 20, 2022 · 15 comments · Fixed by #47482
Closed

Testing BSplineKit asserts in LLVM with Attribute after last parameter! #47245

KristofferC opened this issue Oct 20, 2022 · 15 comments · Fixed by #47482
Labels
regression Regression in behavior compared to a previous version
Milestone

Comments

@KristofferC
Copy link
Member

PkgEval:

(jl_XXRoRG) pkg> test BSplineKit
     Testing BSplineKit
      Status `/tmp/jl_UPK8kk/Project.toml`
...
Precompiling project...
  8 dependencies successfully precompiled in 3 seconds. 28 already precompiled.
     Testing Running tests...
Test Summary:   | Pass  Total  Time
DifferentialOps |   17     17  0.2s
Test Summary: | Pass  Total  Time
Knots         |   86     86  0.0s
Attribute after last parameter!
  %645 = call token (...) @llvm.julia.gc_preserve_begin(), !dbg !492
Attribute after last parameter!
  %646 = call token (...) @llvm.julia.gc_preserve_begin(), !dbg !494
Attribute after last parameter!
  %647 = call token (...) @llvm.julia.gc_preserve_begin(), !dbg !495
julia: /home/kc/julia/src/llvm-alloc-opt.cpp:1187: bool {anonymous}::AllocOpt::runOnFunction(llvm::Function&, llvm::function_ref<llvm::DominatorTree&()>): Assertion `!verifyFunction(F, &errs())' failed.

[151419] signal (6): Aborted
in expression starting at /home/kc/.julia/packages/BSplineKit/ltMBY/test/bsplines.jl:136
pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
raise at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fc5fe42871a)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
runOnFunction at /home/kc/julia/src/llvm-alloc-opt.cpp:1187 [inlined]
runOnFunction at /home/kc/julia/src/llvm-alloc-opt.cpp:1179
runOnFunction at /home/kc/julia/src/llvm-alloc-opt.cpp:1201
_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /home/kc/julia/usr/bin/../lib/libLLVM-14jl.so (unknown line)
_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /home/kc/julia/usr/bin/../lib/libLLVM-14jl.so (unknown line)
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /home/kc/julia/usr/bin/../lib/libLLVM-14jl.so (unknown line)
operator() at /home/kc/julia/src/jitlayers.cpp:1109 [inlined]
withModuleDo<(anonymous namespace)::OptimizerT::operator()(llvm::orc::ThreadSafeModule, llvm::orc::MaterializationResponsibility&)::<lambda(llvm::Module&)> > at /home/kc/julia/usr/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:136 [inlined]
operator() at /home/kc/julia/src/jitlayers.cpp:1081 [inlined]
CallImpl<(anonymous namespace)::OptimizerT> at /home/kc/julia/usr/include/llvm/ADT/FunctionExtras.h:222
`` 
@KristofferC KristofferC added the regression Regression in behavior compared to a previous version label Oct 20, 2022
@KristofferC KristofferC added this to the 1.9 milestone Oct 20, 2022
@apaz-cli
Copy link
Member

apaz-cli commented Nov 3, 2022

@KristofferC I cannot seem to reproduce this on my machine, all the tests pass and I can't get the assertion to fail. Do you have any guidance on this?

@gbaraldi
Copy link
Member

gbaraldi commented Nov 3, 2022

Are you testing with both FORCE_ASSERTIONS=1 and LLVM_ASSERTIONS=1?

@apaz-cli
Copy link
Member

apaz-cli commented Nov 3, 2022

@gbaraldi I am, yes.

@gbaraldi
Copy link
Member

gbaraldi commented Nov 3, 2022

It might be machine difference, or maybe something we did fixed it :)

@apaz-cli
Copy link
Member

apaz-cli commented Nov 3, 2022

I should mention that I tried running the tests on antarctic also, and they all passed there as well. And yeah, maybe a re-run would be useful.

@gbaraldi
Copy link
Member

gbaraldi commented Nov 3, 2022

If you have the time, get like a 15 day old master and see if it fails.

@vtjnash
Copy link
Member

vtjnash commented Nov 3, 2022

It failed for me, so maybe this is helpful:

julia> versioninfo()
Julia Version 1.9.0-DEV.1706
Commit 3661a08750 (2022-11-01 18:31 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin21.6.0)
  CPU: 8 × Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores

@gbaraldi
Copy link
Member

gbaraldi commented Nov 3, 2022

I also can reproduce on

julia> versioninfo()
Julia Version 1.9.0-DEV.1742
Commit d0ba259f63 (2022-11-03 16:22 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.1.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 4 on 4 virtual cores
Environment:
  JULIA_NUM_PRECOMPILE_TASKS = 4
  JULIA_NUM_THREADS = 4

@gbaraldi
Copy link
Member

gbaraldi commented Nov 3, 2022

@apaz-cli Did you do make cleanall? I think the LLVM toolchain doesn't get redownloaded if you don't do make cleanall.

@apaz-cli
Copy link
Member

apaz-cli commented Nov 4, 2022

I did make cleanall, then make debug, didn't work. Re-cloned the repo, copied my Make.user, did make debug, still didn't work. I also tried a ~15 day old julia (faa49a0ef62190e38f67f5b83cf00ad88fb997a5 because I already had it checked out), and couldn't get it to work there either.

@gbaraldi
Copy link
Member

gbaraldi commented Nov 4, 2022

What's your machine? It's quite interesting that you can't reproduce it, because it's there in two different OSs and architectures

@apaz-cli
Copy link
Member

apaz-cli commented Nov 4, 2022

I'm using Debian sid on an HP Elitebook 745. I've got an AMD Ryzen 5 PRO 2500U as my processor. But I also can't seem to reproduce it on antarctic either.

@gbaraldi
Copy link
Member

gbaraldi commented Nov 4, 2022

I can only reproduce this from inside the test harness .

@apaz-cli
Copy link
Member

apaz-cli commented Nov 4, 2022

I just reproduced it locally. I rebuilt from the same 15 day old master again, and I guess I must have missed something.

Now though, I'm running into the same problem as with #47247, minus the sycall_traced() issue.

I figured out how to demangle the function and make the call inside the assert

(rr) define srch
>c
>p !(bool)_ZN4llvm14verifyFunctionERKNS_8FunctionEPNS_11raw_ostreamE(F, null)
>end

And then I proceeded to srch through the entire trace. It never prints false.

@apaz-cli
Copy link
Member

apaz-cli commented Nov 4, 2022

It turns out that I was on the wrong process the whole time. Makes sense.

apaz-cli added a commit to apaz-cli/julia that referenced this issue Nov 7, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes JuliaLang#47245
vtjnash pushed a commit that referenced this issue Nov 8, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245
KristofferC pushed a commit that referenced this issue Nov 8, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245

(cherry picked from commit bc39fd1)
DilumAluthge pushed a commit that referenced this issue Nov 15, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245

(cherry picked from commit bc39fd1)
KristofferC pushed a commit that referenced this issue Dec 21, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245

(cherry picked from commit bc39fd1)
KristofferC pushed a commit that referenced this issue Dec 21, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245

(cherry picked from commit bc39fd1)
KristofferC pushed a commit that referenced this issue Dec 21, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245

(cherry picked from commit bc39fd1)
staticfloat pushed a commit that referenced this issue Dec 23, 2022
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245

(cherry picked from commit bc39fd1)
KristofferC pushed a commit that referenced this issue Oct 10, 2023
LLVM adds the nonnull attribute on its own, which makes
the verifier fail.

Fixes #47245

(cherry picked from commit bc39fd1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants