Skip to content

fix: LD_ASSUME_KERNEL for Docker 18.09 compatibility (Issue #508)#517

Open
claw-mini-zz wants to merge 2 commits intoalibaba:mainfrom
claw-mini-zz:fix/508-v2
Open

fix: LD_ASSUME_KERNEL for Docker 18.09 compatibility (Issue #508)#517
claw-mini-zz wants to merge 2 commits intoalibaba:mainfrom
claw-mini-zz:fix/508-v2

Conversation

@claw-mini-zz
Copy link
Contributor

Summary

Fix for Issue #508: Docker 18.09 兼容性问题

Problem

Docker 18.09 runs on Linux kernel 4.x which doesn't support clone3(). glibc 2.34+ defaults to clone3, causing RuntimeError: can't start new thread when creating threads in Python.

Solution

Set LD_ASSUME_KERNEL=2.33.0 environment variable to force glibc to use the legacy clone() system call instead of clone3().

Changes

  1. server/src/services/docker.py: Add LD_ASSUME_KERNEL=2.33.0 as default environment variable in _build_labels_and_env method
  2. components/execd/bootstrap.sh: Add export LD_ASSUME_KERNEL=2.33.0 for execd daemon

Testing

This fix should allow OpenSandbox to work on:

  • Docker 18.09
  • Linux kernels < 5.9
  • Systems with glibc < 2.34

Fixes #508

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2164dd99a6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

export EXECD_ENVS

# Fix for Docker 18.09 / old glibc compatibility (Issue #508)
export LD_ASSUME_KERNEL=2.33.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve caller-provided LD_ASSUME_KERNEL

This change unconditionally sets LD_ASSUME_KERNEL=2.33.0, which overwrites any value a caller passes in CreateSandboxRequest.env; sandbox containers always execute this script because Docker provisioning uses entrypoint=[BOOTSTRAP_PATH] in server/src/services/docker.py. In workloads that intentionally set a different LD_ASSUME_KERNEL (or need to disable it), the requested environment is ignored, which can cause runtime incompatibilities for those images. Treat this as a default-only value (set it only when unset) so explicit user configuration remains authoritative.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker是18.09版本 RuntimeError: can't start new thread

2 participants