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

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:

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:

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:
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?

2 Likes

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

1 Like