io: dlopen libbz2 by versioned SONAME, not unversioned symlink#1297
Conversation
dlopen("libbz2.so", ...) requires the unversioned symlink, which on
Debian/Ubuntu ships only with libbz2-dev. The runtime package
(libbz2-1.0, pulled in by bzip2) provides libbz2.so.1.0 but not the
.so symlink, so the dlopen returns null and any .bz2 read fails with
"Could not open .bz2 file...". This breaks the release/26.06 container
nightly CLI test on the .lp.bz2 case while .lp.gz works, because the
zlib path already uses the versioned SONAME (libz.so.1).
Mirror the zlib pattern: try libbz2.so.1.0 (bzip2 upstream SONAME for
all 1.0.x releases), then libbz2.so.1, then libbz2.so as a last
resort. First successful dlopen wins.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR enhances the dynamic loading of libbz2 in the file decompression utility. The change replaces a single attempt to load Changesbzip2 SONAME Loading Enhancement
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
/merge |
Issue
The release/26.06 container nightly CLI test fails on the
.lp.bz2case:(e.g. https://github.com/NVIDIA/cuopt/actions/runs/26435964807/job/77827519723#step:5:1291)
Root cause
cpp/src/io/file_to_string.cppdlopens libbz2 by its unversioned name:On Debian/Ubuntu, the unversioned
libbz2.sosymlink only ships with thelibbz2-devpackage. The runtime package (libbz2-1.0, pulled in transitively bybzip2) provides onlylibbz2.so.1.0/libbz2.so.1. Sodlopenreturns null, the .bz2 read aborts with "Could not open .bz2 file...", and the CLI test grep miss surfaces as "Expected solution not found for .lp.bz2"..lp.gzworks in the same container because the zlib code path already uses the versioned SONAME:dlopen("libz.so.1", RTLD_LAZY).Fix
Mirror the zlib pattern. Try names in decreasing specificity and use the first that loads:
libbz2.so.1.0— bzip2 upstream's stable SONAME (objdump -pconfirms; unchanged across all 1.0.x releases for ~20 years)libbz2.so.1— symlink commonly shipped alongside .so.1.0libbz2.so— last resort, dev-only symlinkA future libbz2 2.x with SONAME
libbz2.so.2.0would (correctly) fail to load — it would be an ABI break anyway, same as the existing zlib behavior.🤖 Generated with Claude Code