# \#stackoverflow

**URL:** https://discourse.julialang.org/tag/stackoverflow/463.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [StackOverflowError after only 14 calls to the same function?](https://discourse.julialang.org/t/stackoverflowerror-after-only-14-calls-to-the-same-function/133693)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 4\
**Last updated:** [November 18, 2025, 8:29pm UTC](https://discourse.julialang.org/t/stackoverflowerror-after-only-14-calls-to-the-same-function/133693 "2025-11-18T20:29:35Z")

</div>

How many times does a function have to be called before a StackOverflowError is triggered? When I try with a simple recursive function call, it seems to be about 80,000. However, in my program, I have a function that is …

---

## [Stackoverflow when loading PythonPlot](https://discourse.julialang.org/t/stackoverflow-when-loading-pythonplot/133928)

<div class="topic-metadata">

**Author:** [@maltee1](https://discourse.julialang.org/u/maltee1)\
**Replies:** 3\
**Last updated:** [November 17, 2025, 5:02pm UTC](https://discourse.julialang.org/t/stackoverflow-when-loading-pythonplot/133928 "2025-11-17T17:02:53Z")

</div>

This seems to be a python problem, but I’ve often had problems with python that could be solved simply be deleting and re-installing the corresponding packages. So I’m thinking this might be related to how Julia uses pyt…

---

## [Stack overflow when calling dynamic library requiring executable tack in the REPL](https://discourse.julialang.org/t/stack-overflow-when-calling-dynamic-library-requiring-executable-tack-in-the-repl/132027)

<div class="topic-metadata">

**Author:** [@HugoMVale](https://discourse.julialang.org/u/HugoMVale)\
**Replies:** 0\
**Last updated:** [September 1, 2025, 6:04pm UTC](https://discourse.julialang.org/t/stack-overflow-when-calling-dynamic-library-requiring-executable-tack-in-the-repl/132027 "2025-09-01T18:04:42Z")

</div>

I am writing bindings to a Fortran library. The bindings work perfectly when launched as “run file in new process”. Conversely, when launched directly from the REPL, a stack overflow error is raised, without further info…

---

## [How to increase the stack size of Julia threads?](https://discourse.julialang.org/t/how-to-increase-the-stack-size-of-julia-threads/70359)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 2\
**Last updated:** [September 15, 2024, 12:15pm UTC](https://discourse.julialang.org/t/how-to-increase-the-stack-size-of-julia-threads/70359 "2024-09-15T12:15:28Z")

</div>

I’m doing multiple recursive computations (Welzl’s algorithm) in parallel using Threads.@threads, producing a stack overflow. This is on latest Linux and Julia 1.7.0-rc2. How do increase the size of a thread’s stack? (…

---

## [Crash: illegal instruction 4, StackOverflowError, or freeze](https://discourse.julialang.org/t/crash-illegal-instruction-4-stackoverflowerror-or-freeze/116754)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 5\
**Last updated:** [July 9, 2024, 4:39am UTC](https://discourse.julialang.org/t/crash-illegal-instruction-4-stackoverflowerror-or-freeze/116754 "2024-07-09T04:39:37Z")

</div>

\[Edit 2: I’ve just posted a small program that reproduces this error in a separate message below.\] Can someone give me advice as to how to proceed when Julia crashes? At first, I got the following error \[8865\] signal…

---

## [Getting Stack Overflow error when running Derivative(x)^n](https://discourse.julialang.org/t/getting-stack-overflow-error-when-running-derivative-x-n/115300)

<div class="topic-metadata">

**Author:** [@vikram\_backup](https://discourse.julialang.org/u/vikram_backup)\
**Replies:** 5\
**Last updated:** [June 8, 2024, 11:11am UTC](https://discourse.julialang.org/t/getting-stack-overflow-error-when-running-derivative-x-n/115300 "2024-06-08T11:11:58Z")

</div>

I have published my code in the following link. I am pasting my code here as well ## using Symbolics using Plots using Statistics ## a = 0.529\*10^-10 # Radius of hydrogen atom in meters function Legrande(l::Int, cosθ:…

---

## [Multiplication of matrix expression and variables leads to stack overflow and matmul error](https://discourse.julialang.org/t/multiplication-of-matrix-expression-and-variables-leads-to-stack-overflow-and-matmul-error/111760)

<div class="topic-metadata">

**Author:** [@Rahul\_Narwar](https://discourse.julialang.org/u/Rahul_Narwar)\
**Replies:** 2\
**Last updated:** [March 18, 2024, 12:00pm UTC](https://discourse.julialang.org/t/multiplication-of-matrix-expression-and-variables-leads-to-stack-overflow-and-matmul-error/111760 "2024-03-18T12:00:10Z")

</div>

I have an optimal orbital transfer problem: h = 2 n = 6 m = 3 model = Model(NLopt.Optimizer) set\_optimizer\_attribute(model, "algorithm", :AUGLAG) local\_optimizer = NLopt.Opt(:LD\_LBFGS, n\*(h+1) + m\*h) local\_optimizer.xt…

---

## [Stackoverflow error with no stacktrace](https://discourse.julialang.org/t/stackoverflow-error-with-no-stacktrace/105690)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 3\
**Last updated:** [November 2, 2023, 1:21pm UTC](https://discourse.julialang.org/t/stackoverflow-error-with-no-stacktrace/105690 "2023-11-02T13:21:00Z")

</div>

I’m experienceing a strange bug which results in a stack overflow error with no stacktrace at all. I’m not sure how or why this happens, and I have found it impossible to diagnose. I haven’t been able to reprodruce the b…

---

## [StackOverflowError when training a neural network](https://discourse.julialang.org/t/stackoverflowerror-when-training-a-neural-network/84224)

<div class="topic-metadata">

**Author:** [@jpt](https://discourse.julialang.org/u/jpt)\
**Replies:** 5\
**Last updated:** [July 16, 2022, 7:10am UTC](https://discourse.julialang.org/t/stackoverflowerror-when-training-a-neural-network/84224 "2022-07-16T07:10:24Z")

</div>

I am training a Neural network using the Flux library. The definition of the neural network is as follows: NN = Flux.Chain( Flux.Dense(13, 32, sigmoid), Flux.Dense(32, 32, sigmoid), Flux.Dense(32…

---

## [Stack overflow in type inference... julia 1.9.0-DEV](https://discourse.julialang.org/t/stack-overflow-in-type-inference-julia-1-9-0-dev/80694)

<div class="topic-metadata">

**Author:** [@jjiw](https://discourse.julialang.org/u/jjiw)\
**Replies:** 7\
**Last updated:** [May 14, 2022, 2:00am UTC](https://discourse.julialang.org/t/stack-overflow-in-type-inference-julia-1-9-0-dev/80694 "2022-05-14T02:00:31Z")

</div>

In following I show some code for the problem program, but don’t have a small demo for the problem, and at this point don’t have permission to post the whole 800-line program. I hope that someone can say what causes th…

---

## [How to increase stack size for Julia in Windows?](https://discourse.julialang.org/t/how-to-increase-stack-size-for-julia-in-windows/79932)

<div class="topic-metadata">

**Author:** [@Yrogirg](https://discourse.julialang.org/u/Yrogirg)\
**Replies:** 3\
**Last updated:** [April 24, 2022, 10:03am UTC](https://discourse.julialang.org/t/how-to-increase-stack-size-for-julia-in-windows/79932 "2022-04-24T10:03:22Z")

</div>

I mirror here my question at StackOverflow: How to increase stack size for Julia in Windows? - Stack Overflow I wrote a recursive function (basically a flood fill), it works fine on smaller datasets, but for slightly la…

---

## [Inconsistent StackOverflowError with recursive parametric dynamic types](https://discourse.julialang.org/t/inconsistent-stackoverflowerror-with-recursive-parametric-dynamic-types/77210)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 7\
**Last updated:** [March 1, 2022, 5:30pm UTC](https://discourse.julialang.org/t/inconsistent-stackoverflowerror-with-recursive-parametric-dynamic-types/77210 "2022-03-01T17:30:33Z")

</div>

I think I stumbled upon a bug in the Julia, but I am not sure what kind of issue is this. The code is the following: using Graphs abstract type MyAbstract end struct Composite{T \<: MyAbstract,R \<: MyAbstract} \<: MyAb…

---

## [Inverting Large Matrices (Overflow error)](https://discourse.julialang.org/t/inverting-large-matrices-overflow-error/73353)

<div class="topic-metadata">

**Author:** [@RandarserousRex](https://discourse.julialang.org/u/RandarserousRex)\
**Replies:** 4\
**Last updated:** [December 20, 2021, 4:29pm UTC](https://discourse.julialang.org/t/inverting-large-matrices-overflow-error/73353 "2021-12-20T16:29:56Z")

</div>

Hi all, I’m trying to invert a large matrix (1001 by 1001) to perform Ridge Regression in Julia. I’m running into this “Stack overflow Error:”, I’ve recreated the problem with simpler code (not my Ridge Regression code,…

---

## [Jupyter lab StackOverflowError when computing inverse matrix](https://discourse.julialang.org/t/jupyter-lab-stackoverflowerror-when-computing-inverse-matrix/72691)

<div class="topic-metadata">

**Author:** [@mrazomej](https://discourse.julialang.org/u/mrazomej)\
**Replies:** 3\
**Last updated:** [December 7, 2021, 5:00am UTC](https://discourse.julialang.org/t/jupyter-lab-stackoverflowerror-when-computing-inverse-matrix/72691 "2021-12-07T05:00:02Z")

</div>

I recently updated Julia to version 1.7. When trying to do a straightforward computation in the Jupyterlab environment such as: using Random Random.seed!(42) A = rand(1000, 1000) inv(A) I get the following error (li…

---

## [StackOverFlow Error in SIR model using ModelingTookit](https://discourse.julialang.org/t/stackoverflow-error-in-sir-model-using-modelingtookit/64604)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 28\
**Last updated:** [August 8, 2021, 10:29pm UTC](https://discourse.julialang.org/t/stackoverflow-error-in-sir-model-using-modelingtookit/64604 "2021-08-08T22:29:00Z")

</div>

I am brand new to ModelingTookit, and as a first exercise I have defined a simple SIR model and tried to solve it and plot the solution. Unfortunately I’m getting a StackOverFlow Error that I can’t figure out. Here’s my …

---

## [PSA: Formatting REPL snippets on Stack Overflow](https://discourse.julialang.org/t/psa-formatting-repl-snippets-on-stack-overflow/48181)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 0\
**Last updated:** [October 11, 2020, 8:39pm UTC](https://discourse.julialang.org/t/psa-formatting-repl-snippets-on-stack-overflow/48181 "2020-10-11T20:39:47Z")

</div>

Stack Overflow recently changed their syntax highlighter from Google Prettify to highlight.js: I’ve noticed that now snippets of code from the Julia REPL often get highlighted funny, like this: Here you can see th…

---

## [Help needed fixing stack overflow](https://discourse.julialang.org/t/help-needed-fixing-stack-overflow/45134)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 14\
**Last updated:** [August 20, 2020, 12:21pm UTC](https://discourse.julialang.org/t/help-needed-fixing-stack-overflow/45134 "2020-08-20T12:21:17Z")

</div>

I have a composite type that I use to simplify xy and xyz vector operations. I use it instead of an array or a static array because it doesn’t rely on external packages and is fairly quick and allows me to easily overlo…
