I encountered this bug while looking for a MRE for jump-dev/JuMP.jl#3912...
Something in primal_feasibility_report triggers a stack overflow error when using certain nonlinear operators with non-32, non-64 precision (e.g. BigFloat) arithmetic.
I opened a separate issue because I believe the root cause is different.
MRE:
using JuMP
model = JuMP.GenericModel{BigFloat}()
@variable(model, x)
@constraint(model, cos(x) == one(BigFloat))
JuMP.primal_feasibility_report(model, Dict(x => zero(BigFloat)))
triggers the following overflow:
ERROR: StackOverflowError:
Stacktrace:
[1] cos(x::BigFloat) (repeats 79984 times)
@ NaNMath ~/.julia/packages/NaNMath/nN4v2/src/NaNMath.jl:11
The stacktrace points to this line in NaNMath. At that point, it is clear to me that we have entered an infinite loop, but I have no idea what triggered it 🤔