Skip to content

chroot mode: binary execution intercepted by bash causing Java, Rust, and Bun failures #518

@Mossaka

Description

@Mossaka

Summary

When running workflows with --enable-chroot mode, binary execution is being intercepted in a way that causes failures for Rust, Java, and Bun runtimes. The symptoms vary but appear to share a common root cause.

Symptoms

Rust

  • cargo test fails with linker error:
    lld-wrapper: executable has unexpected name: Some("bash")
    collect2: error: ld returned 1 exit status
    
  • cargo build succeeds, but test compilation fails

Java

  • All Java/Maven commands return bash help instead of executing:
    BUILD_ENV_FAILURE: Java and Maven commands are intercepted by bash and return bash help instead of executing
    
  • java -version, mvn compile, etc. all output bash version info

Bun

  • bun install fails with:
    error: An internal error occurred (NotDir)
    

Working Runtimes

The following runtimes work correctly in chroot mode:

  • Node.js - All tests pass
  • Go - All tests pass
  • C++ - All builds pass
  • Deno - All tests pass

Root Cause Analysis

The common pattern in all failing cases is that something in the chroot environment is intercepting binary execution and involving "bash" in unexpected ways:

  • Rust sees the linker wrapper expecting a specific executable but finding "bash"
  • Java commands return bash help/version output
  • Bun has internal errors related to file system operations

Reproduction

  1. Run the "Build Test Rust", "Build Test Java", or "Build Test Bun" workflows on any PR
  2. Check the agent logs for the errors described above

Relevant Files

  • containers/agent/entrypoint.sh - Sets up the chroot environment
  • containers/agent/setup-iptables.sh - Configures iptables NAT rules
  • src/docker-manager.ts - Generates the docker-compose configuration

Related PRs

🤖 Created with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions