earlgrey: Update opentitan_devbundle to devbundle-2026-08-21-1 - #439
Open
anthonychen1251 wants to merge 1 commit into
Open
earlgrey: Update opentitan_devbundle to devbundle-2026-08-21-1#439anthonychen1251 wants to merge 1 commit into
anthonychen1251 wants to merge 1 commit into
Conversation
Update the `opentitan_devbundle` dependency in `MODULE.bazel` to point to the official upstream release `devbundle-2026-08-21-1` from GitHub. Additionally, set `HOME=/tmp` in the `OtpImageAssemble` action in `target/earlgrey/env/environments.bzl`. In hermetic Bazel sandbox environments where `HOME` is unset, `opentitantool` falls back to glibc's `getpwuid_r()`, which dynamically `dlopen()`s host NSS libraries and crashes (SIGSEGV) due to a glibc ABI mismatch between the static binary and the host libc. Providing `HOME` prevents the NSS lookup. Signed-off-by: Anthony Chen <antchen@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the
opentitan_devbundledependency inMODULE.bazelto the upstream releasedevbundle-2026-08-21-1from GitHub, and adds a workaround intarget/earlgrey/env/environments.bzlto avoid a segmentation fault inopentitantoolduring hermetic Bazel image assembly actions.Error Encountered
When building or running tests involving
OtpImageAssemblewithout the workaround,opentitantoolcrashes with a segmentation fault in my local env:What Happened
HOMEunset): In Bazel sandbox actions (ctx.actions.run), commands run in an isolated environment (exec env -) where$HOMEand$XDG_CONFIG_HOMEare not set.opentitantool: During CLI initialization inopentitantool,clapevaluates default arguments for--rcfileby callingdirectories::ProjectDirs::from("org", "opentitan", "opentitantool").$HOMEis missing, the underlyingdirs-syscrate falls back to glibc'sgetpwuid_r(getuid())to look up the user's home directory.opentitantoolis built as a static-pie binary linked with glibc 2.35 (Ubuntu 22.04 LTS). Under glibc,getpwuid_rdynamically callsdlopen()on the host system's Name Service Switch (NSS) shared library (e.g./lib/x86_64-linux-gnu/libnss_files.so).__libc_early_init: When running on a host with a different glibc version (e.g., Debian / gLinux running glibc 2.42), the host NSS library's glibc runtime structures conflict with the static binary's glibc 2.35 runtime during__libc_early_init/__GI___ctype_init, immediately triggering a segmentation fault.Applied Workaround
Setting
HOMEsatisfiesdirs-sysbefore it invokesgetpwuid_r(), bypassing the host NSSdlopen()call.Upstream Potential Solutions (OpenTitan)
To permanently resolve this upstream in
lowRISC/opentitan:sw/host/opentitantool/src/main.rs, avoid invokingProjectDirs::from()if neitherHOMEnorXDG_CONFIG_HOMEis set.musl(x86_64-unknown-linux-musl), which does not rely on dynamic NSS plugins.