JuliaAlgebra / DynamicPolynomials.jl

Multivariate polynomials implementation of commutative and non-commutative variables
Other
59 stars 21 forks source link

Nightly crashes with IllegalInstruction(4) #38

Closed saschatimme closed 5 years ago

saschatimme commented 5 years ago

I noticed that thing do no more run under Julia nightly with a somewhat scary error:

https://travis-ci.org/JuliaAlgebra/DynamicPolynomials.jl/jobs/419636957

Do we do something dangerous or is this a bug on Julia master?

chriscoey commented 5 years ago

I also came here to report this error

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0-DEV.841 (2018-12-08)
 _/ |\__'_|_|_|\__'_|  |  Commit f0b9499f5f (0 days old master)
|__/                   |

julia> using MultivariatePolynomials

julia> using DynamicPolynomials

julia> @polyvar x
(x,)

julia> @polyvar y[1:2]
Unreachable reached at 0x7f40c418b06a

signal (4): Illegal instruction
in expression starting at no file:0
setindex! at ./array.jl:764
collect_to_with_first! at ./array.jl:626
collect at ./array.jl:608
map at ./abstractarray.jl:2044 [inlined]
polyarrayvar at /home/coey/.julia/packages/DynamicPolynomials/3rBvr/src/var.jl:6
unknown function (ip: 0x7f40c418b01d)
jl_fptr_trampoline at /home/coey/julia/src/gf.c:1854
jl_apply_generic at /home/coey/julia/src/gf.c:2209
do_call at /home/coey/julia/src/interpreter.c:323
eval_value at /home/coey/julia/src/interpreter.c:411
eval_stmt_value at /home/coey/julia/src/interpreter.c:362 [inlined]
eval_body at /home/coey/julia/src/interpreter.c:759
jl_interpret_toplevel_thunk_callback at /home/coey/julia/src/interpreter.c:885
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f40cce23bbf)
unknown function (ip: 0x1)
jl_interpret_toplevel_thunk at /home/coey/julia/src/interpreter.c:894
jl_toplevel_eval_flex at /home/coey/julia/src/toplevel.c:764
jl_toplevel_eval_in at /home/coey/julia/src/toplevel.c:793
eval at ./boot.jl:328
jl_apply_generic at /home/coey/julia/src/gf.c:2209
eval_user_input at /home/coey/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /home/coey/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_apply_generic at /home/coey/julia/src/gf.c:2209
jl_apply at /home/coey/julia/src/julia.h:1571 [inlined]
start_task at /home/coey/julia/src/task.c:572
unknown function (ip: 0xffffffffffffffff)
Allocations: 13078569 (Pool: 13075549; Big: 3020); GC: 28
Illegal instruction (core dumped)
saschatimme commented 5 years ago

@chriscoey are you able to get an MWE? (not involving DynamicPolynomials)

chriscoey commented 5 years ago

about as minimal as you can get:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0-DEV.841 (2018-12-08)
 _/ |\__'_|_|_|\__'_|  |  Commit f0b9499f5f (1 day old master)
|__/                   |

julia> using MultivariatePolynomials

julia> using DynamicPolynomials

julia> @polyvar x[1:2]
Unreachable reached at 0x7f92e991c28a

signal (4): Illegal instruction
in expression starting at no file:0
setindex! at ./array.jl:764
collect_to_with_first! at ./array.jl:626
collect at ./array.jl:608
map at ./abstractarray.jl:2044 [inlined]
polyarrayvar at /home/coey/.julia/packages/DynamicPolynomials/3rBvr/src/var.jl:6
unknown function (ip: 0x7f92e991c23d)
jl_fptr_trampoline at /home/coey/julia/src/gf.c:1854
jl_apply_generic at /home/coey/julia/src/gf.c:2209
do_call at /home/coey/julia/src/interpreter.c:323
eval_value at /home/coey/julia/src/interpreter.c:411
eval_stmt_value at /home/coey/julia/src/interpreter.c:362 [inlined]
eval_body at /home/coey/julia/src/interpreter.c:759
jl_interpret_toplevel_thunk_callback at /home/coey/julia/src/interpreter.c:885
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f92f0a1c23f)
unknown function (ip: 0x1)
jl_interpret_toplevel_thunk at /home/coey/julia/src/interpreter.c:894
jl_toplevel_eval_flex at /home/coey/julia/src/toplevel.c:764
jl_toplevel_eval_in at /home/coey/julia/src/toplevel.c:793
eval at ./boot.jl:328
jl_apply_generic at /home/coey/julia/src/gf.c:2209
eval_user_input at /home/coey/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /home/coey/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_apply_generic at /home/coey/julia/src/gf.c:2209
jl_apply at /home/coey/julia/src/julia.h:1571 [inlined]
start_task at /home/coey/julia/src/task.c:572
unknown function (ip: 0xffffffffffffffff)
Allocations: 11714515 (Pool: 11711684; Big: 2831); GC: 25
Illegal instruction (core dumped)
chriscoey commented 5 years ago

oh just saw that you said "without DynamicPolynomials". in that case, no

saschatimme commented 5 years ago

I opened an issue https://github.com/JuliaLang/julia/issues/30346

blegat commented 5 years ago

Can't we create an example without using the macro ? Also, as this only uses like 1% of MP and DP, is it still present if we remove 99% of the code from both packages ? In that case, we can take these 1% out of the packages and we have a MWE.

saschatimme commented 5 years ago

If I only copy the relevant definitions of DynamicaPolynomialys and define AbstractVariable by hand this still works. If you are able to get something self contained this would be great @blegat

blegat commented 5 years ago

It seems to have been resolved

julia> using DynamicPolynomials

julia> @polyvar x[1:2]
(PolyVar{true}[x₁, x₂],)

julia> versioninfo()
Julia Version 1.1.0-DEV.854
Commit 0d620001c2 (2018-12-11 07:28 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
blegat commented 5 years ago

Looks like it was fixed in Julia master, @chriscoey @saschatimme can we close ?