# Error "cannot enable executable stack" when starting Julia (solved)

**URL:** <https://discourse.julialang.org/t/error-cannot-enable-executable-stack-when-starting-julia-solved/125655>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 7, 2025, 12:27pm UTC](https://discourse.julialang.org/t/error-cannot-enable-executable-stack-when-starting-julia-solved/125655 "2025-02-07T12:27:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)\
**Post date:** [February 7, 2025, 12:27pm UTC](https://discourse.julialang.org/t/error-cannot-enable-executable-stack-when-starting-julia-solved/125655/1 "2025-02-07T12:27:26Z")

</div>

Recently, I encountered an unexpected issue when trying to run Julia on my Arch Linux. Everything had been working fine until suddenly Julia started failing with the following error:

```bash
ERROR: Unable to load dependent library /home/marllos/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/bin/../lib/julia/libopenlibm.so
Message:/home/marllos/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/bin/../lib/julia/libopenlibm.so: cannot enable executable stack as shared object requires: Invalid argument

```

I tried reinstalling Julia and Juliaup, but the error persisted. I also attempted to remove the installed version using `juliaup remove release`, but it indicated that the version was still active. Even after updating (`juliaup update release`), the problem remained.

I turned to ChatGPT to better understand what was happening and received an interesting explanation. The error indicated that the `libopenlibm.so` library was configured to require an **executable stack** , which could be a security issue. However, it seemed that this requirement was not actually necessary, just an incorrectly set flag during compilation.

The solution was to install the `execstack` tool (available on Arch via AUR) and run the following command:

```bash
execstack -c ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/lib/julia/libopenlibm.so

```

After that, Julia started working again.

### **What happened?**

- The `execstack -c` command removed the flag requiring an executable stack, without compromising the functionality of the library.
- Since Julia ran normally after the fix, this suggests that the executable stack requirement was mistakenly enabled during the compilation of `libopenlibm.so`.
- If other Julia libraries have the same issue, you can check with:

```bash
execstack -q ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/lib/julia/*.so

```

If any of them show an `X`, it means they also require an executable stack.

### **Conclusion**

Here is the report of the issue and the solution that worked for me. It might be worth investigating whether this flag was mistakenly set in Julia’s compilation or its dependencies. If anyone has more information about why this happened, I’d be happy to know!

Has anyone else experienced this? Was the error resolved correctly and safely?

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [February 7, 2025, 12:32pm UTC](https://discourse.julialang.org/t/error-cannot-enable-executable-stack-when-starting-julia-solved/125655/2 "2025-02-07T12:32:17Z")

</div>

It has been reported and a fix is on the way:

> <https://github.com/JuliaLang/julia/issues/57250>
>
> With glibc-2.41,
> 
> \`\`\`
> ldd --version …         
> ldd (GNU libc) 2.41
> Copyright (C) 2024 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> Written by Roland McGrath and Ulrich Drepper.
> \`\`\`
> 
> I get the following error trying to run Julia 1.9.4, 1.10.8, and 1.11.3.
> \`\`\`
> ERROR: Unable to load dependent library /home/kevin/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/bin/../lib/julia/libopenlibm.so
> Message:/home/kevin/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/bin/../lib/julia/libopenlibm.so: cannot enable executable stack as shared object requires: Invalid argument
> \`\`\`
> 
> Nightly (1.12.0-DEV.1971) starts without an error.
> 
> Downgrading to glibc-2.40 and lib32-glibc-2.40 fixes the error on all versions. 
> 
> \`\`\`
> ldd --version
> ldd (GNU libc) 2.40
> Copyright (C) 2024 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> Written by Roland McGrath and Ulrich Drepper.
> \`\`\`
> 
> I assume it's the same issue as https://github.com/ValveSoftware/portal2/issues/451 which as the author points out, likely results from this change in glibc-2.41:
> 
> https://lists.gnu.org/archive/html/info-gnu/2025-01/msg00014.html
> 
> \* dlopen and dlmopen no longer make the stack executable if a shared
> library requires it, either implicitly because of a missing GNU\_STACK
> ELF header (and default ABI permission having the executable bit set)
> or explicitly because of the executable bit in GNU\_STACK, and the
> stack is not already executable. Instead, loading such objects will
> fail.
