# Shared library code crashing, but only from REPL

**URL:** <https://discourse.julialang.org/t/shared-library-code-crashing-but-only-from-repl/81314>\
**Category:** General Usage\
**Tags:** question, fortran, repl\
**Created:** [May 19, 2022, 4:03pm UTC](https://discourse.julialang.org/t/shared-library-code-crashing-but-only-from-repl/81314 "2022-05-19T16:03:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew\_s](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@andrew\_s](https://discourse.julialang.org/u/andrew_s)\
**Post date:** [May 19, 2022, 4:03pm UTC](https://discourse.julialang.org/t/shared-library-code-crashing-but-only-from-repl/81314/1 "2022-05-19T16:03:19Z")

</div>

I am calling a Fortran shared library in my program.

If I _run_ my Julia program (which calls the Fortran library) everything runs as expected.

However, if I run exactly the same code in the Julia REPL (connected to Visual Studio Code on Linux) then it fails and reports “ERROR: StackOverflowError:”. This error is being reported from Julia, and not from the Fortran library. I get exactly the same error when I build the Fortran library with both `ifort` and `gfortran`.

I don’t really have a good idea how to try and debug this REPL-only crash. Is there a reason why the code is behaving differently when called from the REPL?
