Skip to content

fix(cloudxr): LD_PRELOAD bundled OpenSSL into the runtime worker#728

Open
johnnynunez wants to merge 1 commit into
NVIDIA:mainfrom
johnnynunez:fix/cloudxr-openssl-preload
Open

fix(cloudxr): LD_PRELOAD bundled OpenSSL into the runtime worker#728
johnnynunez wants to merge 1 commit into
NVIDIA:mainfrom
johnnynunez:fix/cloudxr-openssl-preload

Conversation

@johnnynunez

@johnnynunez johnnynunez commented Jul 5, 2026

Copy link
Copy Markdown

Fix ARM cloudXR

Summary by CodeRabbit

  • Bug Fixes
    • Improved launcher startup reliability by ensuring the bundled security libraries are used when available.
    • Resolved a crash scenario that could occur during runtime initialization on affected systems.

The runtime worker imports asyncio (via isaacteleop.cloudxr.runtime),
which imports Python's ssl module and loads the SYSTEM OpenSSL before
the native streaming stack dlopens its bundled libssl_nvst/libcrypto_nvst.
Two OpenSSL builds resolving symbols in one process SIGSEGV inside
DtlsTransport::initDtlsContext -> SSL_CTX_use_certificate exactly when
the client's WebRTC DTLS handshake starts - i.e. the runtime crashes the
moment a headset connects, while idle waiting works fine.

Spawn the worker with LD_PRELOAD pointing at the bundled OpenSSL
libraries (preserving any pre-existing LD_PRELOAD, and only when the
bundled files exist) so every OpenSSL symbol binds to the single build
libNvStreamServer.so was compiled against.

Signed-off-by: Johnny <johnnync13@gmail.com>
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

📝 Docs preview is not auto-deployed for fork PRs.

A maintainer with write access to NVIDIA/IsaacTeleop can deploy a preview by
commenting /preview-docs on this PR. Once deployed, the preview
will live at:

https://nvidia.github.io/IsaacTeleop/preview/pr-728/

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The CloudXRLauncher's subprocess launch logic was updated to construct a dedicated worker_env dictionary instead of directly using a copy of the OS environment. When bundled OpenSSL libraries (libcrypto_nvst.so.3, libssl_nvst.so.3) exist under the launcher's native directory, their paths are prepended to LD_PRELOAD, preserving any pre-existing value. The runtime subprocess is then started using this modified environment.

Estimated code review effort: 2 (Simple) | ~10 minutes

Security Note

Prepending to LD_PRELOAD affects dynamic library resolution for the spawned subprocess; verify that the bundled library paths are validated against tampering (e.g., not attacker-writable) before existence checks, since LD_PRELOAD injection from a writable location could allow code execution in the subprocess's context.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: preloading bundled OpenSSL for the CloudXR runtime worker.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/cloudxr/python/launcher.py`:
- Around line 166-169: LD_PRELOAD cannot safely represent bundled OpenSSL paths
that contain spaces, so the current preload assembly in launcher.py is not
enough for installations under space-containing directories. Update the logic
around the bundled_ssl/LD_PRELOAD handling to either avoid preloading when any
library path contains spaces or switch to a different loading strategy that does
not rely on LD_PRELOAD path parsing. Keep the fix localized to the worker_env
setup in the launcher flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 906bea28-761f-4f1e-a7cc-defd1e8f8874

📥 Commits

Reviewing files that changed from the base of the PR and between cb8aa84 and f70cd34.

📒 Files selected for processing (1)
  • src/core/cloudxr/python/launcher.py

Comment on lines +166 to +169
if all(os.path.isfile(lib) for lib in bundled_ssl):
preload = " ".join(bundled_ssl)
prev = worker_env.get("LD_PRELOAD")
worker_env["LD_PRELOAD"] = f"{preload} {prev}" if prev else preload

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant section of the file.
cat -n src/core/cloudxr/python/launcher.py | sed -n '145,185p'

Repository: NVIDIA/IsaacTeleop

Length of output: 2414


🌐 Web query:

glibc LD_PRELOAD spaces colons separator documentation

💡 Result:

According to the official glibc documentation (specifically the ld.so(8) manual page), the LD_PRELOAD environment variable accepts a list of ELF shared objects to be preloaded [1][2]. The items in this list can be delimited by either spaces or colons [3][2]. Crucially, there is no support for escaping either the space or colon characters [2][4]. As a result, if a file path contains a space, it cannot be correctly specified within the LD_PRELOAD list because the dynamic linker will interpret the space as a delimiter, splitting the path into multiple invalid segments [5][2]. The /etc/ld.so.preload file, which is also used for preloading, likewise expects a whitespace-separated list [6][4]. When both LD_PRELOAD and /etc/ld.so.preload are used, the libraries specified in LD_PRELOAD are loaded first [6][4].

Citations:


LD_PRELOAD can’t encode paths with spaces. Spaces and colons are both separators here, so changing the joiner won’t help for installs under space-containing directories; if those installs are supported, the bundled OpenSSL needs a space-free preload path or a different loading strategy.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/cloudxr/python/launcher.py` around lines 166 - 169, LD_PRELOAD
cannot safely represent bundled OpenSSL paths that contain spaces, so the
current preload assembly in launcher.py is not enough for installations under
space-containing directories. Update the logic around the bundled_ssl/LD_PRELOAD
handling to either avoid preloading when any library path contains spaces or
switch to a different loading strategy that does not rely on LD_PRELOAD path
parsing. Keep the fix localized to the worker_env setup in the launcher flow.

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.

1 participant