Skip to content

Stop linking libc++ into the Java extension on Linux - #108

Merged
SicongLiu2000 merged 3 commits into
mainfrom
dev/sicongliu/java-libcxx-runtime-dep
Aug 11, 2026
Merged

SicongLiu2000 merged 3 commits into
mainfrom
dev/sicongliu/java-libcxx-runtime-dep

Conversation

@SicongLiu2000

@SicongLiu2000 SicongLiu2000 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

libJavaExtension.so shipped with a runtime dependency on LLVM's C++ stack, which the SQL container images are not required to provide. RHEL images ship none of it, so the Java language extension never loaded on RHEL at all.

Exthost: Load extension failed libunwind.so.1: cannot open shared object file
Board Before After
RHEL 9 22 failed 0 / 6951
RHEL 10 22 failed 0 / 7068
Ubuntu 22.04 0 0 / 6965

Cause

language-extensions/java/src/CMakeLists.txt linked libc++ and libc++abi explicitly. The target is compiled with GCC, so it already links GNU libstdc++ - the result was two C++ runtimes in one .so, with libunwind arriving transitively through libc++abi:

libc++.so.1   libc++abi.so.1   libunwind.so.1   libstdc++.so.6   libc.so.6

Ubuntu passed only by accident, because its images happen to carry those three libraries. Python and R have always linked libstdc++ alone.

Change

Two lines removed, one changed, inside if (${PLATFORM} STREQUAL linux). No source files change; the Windows branch is untouched.

libJavaExtension.so now reports:

libstdc++.so.6   libgcc_s.so.1   libc.so.6
  • identical in shape to Python and R.

Failure breakdown

All 22 failures on each RHEL distro trace to this one cause:

count signature role
15 'Java' script error - InstallLanguageTests :: Setup, ThirdParty.Java.LibraryManagementFunctional :: Setup root cause
7 KeyNotFoundException - matching Cleanups cascade: Setup failed, so the DB was never created

Executed test counts rose ~600-750 per distro, because InstallLanguageTests :: Setup no longer aborts everything behind it.

Validation

Package 1.0.0-CI-java-libcxx-validate-20260811.1, drop 18.0.256-2-1780. Boards held shelveset, test filter and quality gate constant, varying only the distro image. Counts are actual Failed outcomes - totalTests - passedTests reads 76 because it also absorbs NotExecuted.

Windows was not board-validated and does not need to be: the change is confined to the linux branch of one CMakeLists and alters no source file, so there is no mechanism by which Windows compilation or behaviour changes. The Windows PR pipeline provides the compile proof.

libJavaExtension.so.1.0 shipped with these runtime dependencies:

    libc++.so.1  libc++abi.so.1  libunwind.so.1  libstdc++.so.6  libc.so.6

The target is compiled with GCC and therefore already links GNU libstdc++, so
the explicit libc++ / libc++abi linkage put two C++ runtimes in one .so and
dragged in libunwind through libc++abi. None of those three are libraries the
SQL container images are required to ship.

RHEL images carry none of them, so the Java extension never loaded there:

    Exthost: Load extension failed libunwind.so.1: cannot open shared object file

That produced 15 'Java' script errors plus 7 cascading KeyNotFoundException on
both RHEL 9 and RHEL 10 - 22 failures, identical on each. Ubuntu passed only
because its images happen to carry libc++, libc++abi and libunwind.

Python and R link libstdc++ alone; Java now matches them. Same defect class as
the dynamic Boost dependency fixed in #107: a find_library resolving something
the runtime images do not provide, invisible to a green build.

Linux-only - the change sits inside if(PLATFORM STREQUAL linux) and the Windows
branch is untouched. No source files change.
Copilot AI lite review requested due to automatic review settings August 11, 2026 10:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Linux runtime loading failures for the Java language extension by removing an unintended dependency on LLVM’s C++ runtime stack (libc++/libc++abi, and transitively libunwind) from libJavaExtension.so, aligning Java’s shipped dependencies with the existing Python and R extensions.

Changes:

  • Remove explicit linking of libc++ and libc++abi in the Linux CMake branch for JavaExtension.
  • Keep only the necessary dl linkage on Linux.
  • Add an in-file comment explaining the rationale and observed failure mode on RHEL containers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@SicongLiu2000

Copy link
Copy Markdown
Contributor Author

Update on the Ubuntu 24.04 item.

The PVS causality re-run never executed. It was queued at 06:51 and is still reported Scheduled more than five hours later, so the board has not closed:

06:51  Kicking off 2 retries for failed jobs Extensibility.ThirdParty.RExtension.InputDataQueryIsm
12:05  ...cloud test run 693a175b-f97c-a866-faef-385e11835638 is currently Scheduled

That is a CloudTest scheduler backlog, not a signal about this change. A stalled run is not a result, so I am not going to present it as one.

The classification does not depend on that verdict. Two independent lines of evidence, both already in hand:

1. The R binary is functionally unchanged by this PR. libRExtension.so.1.2 differs between the pre-fix and post-fix packages by 36 bytes across 3 ranges - a 20-byte GNU build-id and two short metadata strings - with no differences in .text. In the same pair, libPythonExtension.so is bit-identical, which confirms the build is deterministic and those 36 bytes are only the build stamp. The R machine code that failed here is the same machine code that passed elsewhere in this run.

2. Same payload, same drop, four arms:

PVS run image R suites
230645297 RHEL 9 passed
230645299 RHEL 10 passed
230645301 Ubuntu 22.04 passed
230645302 Ubuntu 24.04 1 failure

Appearing on one arm and absent on three, with identical bits, is the definition of flaky rather than caused.

The failure is HRESULT 0x800704d4 (ERROR_CONNECTION_ABORTED) - a transport abort, and a signature already tracked as flaky for R suites.

If the re-run is ever released by the scheduler I will post the verdict here. If it contradicts the binary evidence above, I would treat the attribution as suspect rather than the diagnosis - but I will report it either way.

Nothing about this changes the RHEL result: RHEL 9 and RHEL 10 both went 22 failures to 0, with Java, Python and R all passing.

@SicongLiu2000

Copy link
Copy Markdown
Contributor Author

Causality verdict, as promised. The re-run was eventually released by the scheduler and the board closed.

Job Extensibility.ThirdParty.RExtension.InputDataQueryIsm
     failed in 1/3 runs with your change and 3/3 runs without it.

Job Extensibility.Python.OutputParameterDataTypesISM
     failed in 1/3 runs with your change and 0/3 runs without it.

The R test fails 3/3 on the baseline and 1/3 with this change. It is not merely unrelated to this PR - it reproduces more reliably without it. That settles the question raised earlier, and it agrees with the binary evidence: libRExtension.so.1.2 differs between the two packages by 36 bytes (a 20-byte GNU build-id and two metadata strings) with no .text differences, and libPythonExtension.so is bit-identical across the same pair.

The second entry, Extensibility.Python.OutputParameterDataTypesISM at 1/3 with and 0/3 without, is this board's known noise floor - the same ratio an unchanged baseline arm produced on an unrelated suite during #107's validation. The Python extension binary is bit-identical between the two packages here, so there is no mechanism by which this PR could affect it.

Final position across all four Linux arms on drop 18.0.256-2-1780:

Board Before After
RHEL 9 22 failed 0 / 6951
RHEL 10 22 failed 0 / 7068
Ubuntu 22.04 0 0 / 6965
Ubuntu 24.04 0 1, flaky - fails 3/3 without this change

No test regressed. Both RHEL distros went from 22 failures to zero, with Java, Python and R all passing.

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.

Thanks for fixing so many tests!

@SicongLiu2000
SicongLiu2000 added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 9a897b7 Aug 11, 2026
5 checks passed
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.

4 participants