Lesstep
GitHub Actions · Ubuntu 26.04 · Checked November 4, 2026

"cannot enable executable stack as shared object requires" on Ubuntu 26.04

ubuntu-latest is moving from Ubuntu 24.04 to 26.04 between October 19 and November 19, 2026 (what else changes). Ubuntu 26.04 has glibc 2.43 (libc6 2.43-2ubuntu2.4 on November 4), where 24.04 has 2.39. Since glibc 2.41, dlopen no longer makes the stack executable when a shared library asks for it; loading the library fails instead (glibc NEWS, version 2.41). On 24.04, the same library loaded.

What it looks like

ERROR: Unable to load dependent library .../lib/julia/libopenlibm.so
Message:.../lib/julia/libopenlibm.so: cannot enable executable stack as shared object requires: Invalid argument

ImportError: libtensorflow_cc.so.2: cannot enable executable stack as shared object requires: Invalid argument

MATLAB:mex:ErrInvalidMEXFile ... blosc_mex.mexa64: cannot enable executable stack as shared object requires: Invalid argument

The first is setup-julia checking julia --version, the second a Python test that imports TensorFlow, the third a MATLAB MEX file. The library named in the message is the one to fix.

Where the reports came from

Most of these libraries never run code on the stack. The flag usually comes from one assembly file or binary input without a .note.GNU-stack section, and the linker warns about it at build time: missing .note.GNU-stack section implies executable stack.

Find the flag

readelf -lW libopenlibm.so | grep GNU_STACK
  GNU_STACK      0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10

RWE is the problem; RW is fine. patchelf --print-execstack answers the same question.

Fix 1: use a release without the flag

For Julia, raise the lowest version to 1.10.9 (or 1.11.4) in the matrix and in [compat]. For a Python package, a newer wheel may already be built without it. This is the fix that lasts.

Fix 2: clear the flag with patchelf

- run: |
    sudo apt-get update && sudo apt-get install -y patchelf
    patchelf --clear-execstack "$(dirname "$(which julia)")/../lib/julia/libopenlibm.so"

Put the step after the one that installs the library (here, after setup-julia). patchelf in Ubuntu 26.04's apt is 0.18.0, which has --clear-execstack. This is safe when the library does not really execute code on its stack, which is the usual case. If it does, for example through GCC's nested functions, it crashes later with a segmentation fault, so run the tests after clearing it.

Fix 3: rebuild your own library without it

Link with -Wl,-z,noexecstack, or give each assembly file the section the linker is looking for:

.section .note.GNU-stack,"",@progbits

For a MEX file, add -Wl,-z,noexecstack to the MEX LDFLAGS, as blosc-matlab did. Then check the result with readelf -lW.

Fix 4: let glibc allow it, for now

env:
  GLIBC_TUNABLES: glibc.rtld.execstack=2

glibc's manual documents the value 2 for this case: the stack is made executable when the process starts, so a later dlopen of such a library works. It makes the whole process's stack executable, so treat it as a stopgap for a test job. Or keep that job on ubuntu-24.04 until GitHub retires the image.

Telling it apart

Other 26.04 failures

See failed jobs from IntelliJ IDEA

Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the runs of all your repositories in an IDE tool window, with their jobs and steps, and your current branch's runs are in the status bar. Reading is free; re-running failed jobs, cancelling, running workflows and reviewing deployments are Pro (US$1.50 a month, with a 30-day trial).

Get it on JetBrains Marketplace

GitHub and GitHub Actions are trademarks of GitHub, Inc.; Ubuntu is a trademark of Canonical Ltd.; MATLAB is a trademark of The MathWorks, Inc.; TensorFlow is a trademark of Google LLC; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with, sponsored or endorsed by GitHub, Inc., Canonical, The MathWorks, Google or JetBrains.

More: "The ubuntu-latest label will migrate to Ubuntu 26" · "cannot open shared object file" on Ubuntu 26.04 · GitHub Actions plugins for IntelliJ IDEA compared · 日本語