# StackOverflowError

**URL:** <https://discourse.julialang.org/t/stackoverflowerror/7773>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [December 14, 2017, 9:08pm UTC](https://discourse.julialang.org/t/stackoverflowerror/7773 "2017-12-14T21:08:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [December 14, 2017, 9:50pm UTC](https://discourse.julialang.org/t/stackoverflowerror/7773/2 "2017-12-14T21:50:46Z")

</div>

If you’re seeing the error just calling `f` with `Dual` arguments, then it’s not an issue with function registration in JuMP, so that simplifies the problem.

How much can you simplify `f` while still seeing the stack overflow? Can you post a minimal example? Stack overflow generally happens when you have infinite recursion, something like:

```julia
julia> f(x) = f(-x)
f (generic function with 1 method)

julia> f(1)
ERROR: StackOverflowError:
Stacktrace:
 [1] f(::Int64) at ./REPL[1]:1 (repeats 80000 times)

```

or something more complicated like:

```julia
f(x) = g(x)
g(x) = h(x)
h(x) = f(x)

```

---

_[View the full topic](https://discourse.julialang.org/t/stackoverflowerror/7773)._
