Skip to content

build: link wrapper strips the exec bit from test executables on every relink, causing os error 13 with no diagnostic #4205

Closed

Description

@zackees

Symptom

bash test --cpp fails with all tests unable to start:

[1/383] ✗ cled_controller FAILED
  [MESON] Test execution error: failed to spawn process: Permission denied (os error 13)
...
[MESON] ❌ Some tests failed (0/383 unit)

Sometimes it presents instead as a bare, reasonless failure:

ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment.
[MESON] ⚠️  Test failed but could not extract detailed error information
[MESON] ❌ Tests failed with return code 13
Ok:  0    Fail:  0

This is the recurring symptom behind #4168. It is not stale state left by any particular merge — it reproduces on demand.

Cause

Freshly linked plain executables come out without the exec bit. Shared objects are unaffected. Local umask is a normal 0022.

After one build:

-rw-r--r--  1 niteris users    53920 tests/runner                      <- no +x
-rwxr-xr-x  1 niteris users    95320 tests/cycle_type.so               <- fine
-rw-r--r--  1 niteris users     6384 tests/color_profile_tiny_layout   <- no +x

tests/runner is the process the driver spawns, so when it loses the bit every single test fails to start. color_profile_tiny_layout is regenerated on every build, so it re-breaks continuously.

Why it is hard to diagnose

Two things hide it:

  1. ci/meson/test_execution.py streams the child's output but only echoes lines containing FAILED or ERROR, so the underlying traceback never reaches the user. You get Ok: 0 Fail: 0 and "could not extract detailed error information". I had to bypass the wrapper to see the real error:
    PermissionError: [Errno 13] Permission denied:
      '.build/meson-quick/tests/color_profile_tiny_runtime'
    
  2. chmod +x then re-running does not reliably help, because the build step inside bash test regenerates the affected file and strips the bit again before tests run. It only sticks if the build happens to be fully up to date.

The failure also triggers the "RE-RUN FAILED TESTS IN DEBUG MODE" banner, which is misleading here — sanitizers cannot instrument a process that will not spawn.

Suggested fixes

  • Have the link/deploy step (ZCCACHE_LINK_DEPLOY_CMD / clang-tool-chain-libdeploy) preserve the mode of what it emits, or chmod +x its output. That is the actual bug.
  • Independently, make the test wrapper surface the child's stderr on a non-zero exit rather than filtering to FAILED/ERROR. The filtering is what turned a one-line PermissionError into an unexplained Ok: 0 Fail: 0.
  • Consider suppressing the debug-mode banner when failures are spawn errors rather than test failures.

Environment

NixOS, umask 0022, nofile 524288. Reproduced repeatedly across sessions today; each full relink reintroduces it.

Activity

  1. zackees commented on Sep 8, 2026

    @zackees
    MemberAuthor

    Root cause found, and it is the same defect as #4212 with a different attribute.

    When I filed this I had only the observation that color_profile_tiny_runtime was an ELF file without +x. It has now bitten a real build, and the mechanism is clear.

    Symptom as the user sees it

    Running all tests...
    ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment.
    [MESON] ⚠️  Test failed but could not extract detailed error information
    [MESON] ❌ Tests failed with return code 13
    

    Nothing else. The top-level handler swallows the traceback, so the message names neither the file nor the errno. Forcing a backtrace gives the real exception:

    PermissionError: [Errno 13] Permission denied:
      /home/niteris/dev/fastled2/.build/meson-quick/tests/color_profile_tiny_runtime
    

    The "13" in return code 13 is the errno, which reads like a build-system exit code.

    Cause

    zccache serves a cached link by writing the bytes back out, and the restored file loses filesystem attributes that the linker would have set. Two are affected:

    This is systematic, not a one-off. A survey of the build directory found 4 ELF executables, 4 of them without +x, none with it:

    tests/color_profile_tiny_layout
    tests/color_profile_tiny_runtime
    tests/runner
    examples/example_runner
    

    Note tests/runner is in that list. Earlier in the session I checked that one file, found it executable, and cleared this hypothesis on that basis — it had simply been freshly linked at the time rather than served from cache. Checking a single artifact is not enough to rule this out; it depends on which targets happened to be cache hits.

    Fix

    #4213 restores +x in the existing post-build fixup pass, which already walks link outputs for the mtime repair. Gated on ELF/Mach-O magic so data files in those directories keep their mode, and idempotent.

    Also worth doing separately: surface the underlying exception instead of Unhandled python OSError. The current message actively misdirects — it says "an issue with your build environment", which is technically true and completely unactionable.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01KkufoNxfnNRU9psT3R9F51

  2. moved this from Triage to Done in FastLED Trackeron Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions