oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
338 stars 119 forks source link

`normal_form` throws UndefRefError: access to undefined reference #3522

Closed martinkjlarsson closed 5 months ago

martinkjlarsson commented 5 months ago

Describe the bug normal_form sometimes throws this error

ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getproperty
   @ ./Base.jl:37 [inlined]
 [2] _normal_form_f4(A::Vector{FqMPolyRingElem}, J::MPolyIdeal{FqMPolyRingElem})
   @ Oscar ~/.julia/packages/Oscar/fx6DP/src/Rings/groebner.jl:1045
 [3] normal_form(A::Vector{FqMPolyRingElem}, J::MPolyIdeal{FqMPolyRingElem}; ordering::MonomialOrdering{FqMPolyRing})
   @ Oscar ~/.julia/packages/Oscar/fx6DP/src/Rings/groebner.jl:995
 [4] normal_form
   @ ~/.julia/packages/Oscar/fx6DP/src/Rings/groebner.jl:992 [inlined]
 [5] normal_form(f::FqMPolyRingElem, J::MPolyIdeal{FqMPolyRingElem}; ordering::MonomialOrdering{FqMPolyRing})
   @ Oscar ~/.julia/packages/Oscar/fx6DP/src/Rings/groebner.jl:987
 [6] normal_form(f::FqMPolyRingElem, J::MPolyIdeal{FqMPolyRingElem})
   @ Oscar ~/.julia/packages/Oscar/fx6DP/src/Rings/groebner.jl:986
 [7] top-level scope
   @ Untitled-2:10

It only seems to happen when groebner_basis has been called explicitly before, but it doesn't happen for the example in the documentation. This seems to be related to #1481.

To Reproduce

using Oscar

K = GF(30097)
R, (x, y) = polynomial_ring(K, ["x", "y"])

F = [x^2 + y^2 - 7, x^3 - 5 * x + 1 - y]
J = ideal(R, F)
G = groebner_basis(J) # Comment out to avoid error.

normal_form(y^4, J)

Expected behavior To not throw and return x*y + 30096*x + 9*y^2 + 30083.

System: I tested also on 1.1.0-DEV with the same behavior.

julia> Oscar.versioninfo(full=true)
OSCAR version 1.0.0
  combining:
    AbstractAlgebra.jl   v0.40.2
    GAP.jl               v0.10.3
    Hecke.jl             v0.30.2
    Nemo.jl              v0.43.1
    Polymake.jl          v0.11.15
    Singular.jl          v0.22.4
  building on:
    Antic_jll               v0.201.500+0
    Arb_jll                 v200.2300.0+0
    Calcium_jll             v0.401.100+0
    FLINT_jll               v200.900.9+0
    GAP_jll                 v400.1200.200+9
    Singular_jll            v403.214.1400+0
    libpolymake_julia_jll   v0.11.4+0
    libsingular_julia_jll   v0.43.0+0
    polymake_jll            v400.1100.1+0
See `]st -m` for a full list of dependencies.

Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 5825U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 
Official https://julialang.org/ release
ederc commented 5 months ago

Should be fixed via #3523.