Skip to content

GH-49767: [CI][C++] Disable mold on Ubuntu 24.04 to work around mold#1247#50033

Open
tadeja wants to merge 4 commits into
apache:mainfrom
tadeja:49767-mold-workaround
Open

GH-49767: [CI][C++] Disable mold on Ubuntu 24.04 to work around mold#1247#50033
tadeja wants to merge 4 commits into
apache:mainfrom
tadeja:49767-mold-workaround

Conversation

@tadeja
Copy link
Copy Markdown
Contributor

@tadeja tadeja commented May 25, 2026

Rationale for this change

Fixes #49767 - intermittent SIGSEGV in the ODBC Linux CI job, the crash occurs during _dl_relocate_object before main() : #49767 (comment)

apt ships mold 2.30.0 on Ubuntu 24.04 'Noble Numbat'.
mold 2.30.0 has a non-determinism bug in section placement that causes this crash (rui314/mold#1247). Fixed upstream in mold 2.31.0.

What changes are included in this PR?

Disable mold on Ubuntu 24.04 in ubuntu-24.04-cpp.dockerfile by setting ARROW_USE_MOLD=OFF.
Re-enable if apt mold reaches 2.31+ - note that Ubuntu 24.04 'Noble Numbat' might never update to 2.31+ https://launchpad.net/ubuntu/noble/+source/mold - its mold release is over 2 years old.

A follow-up issue tracking apt mold updates and other CI jobs using mold (more added with #49898/#49899) will be opened separately.

Are these changes tested?

Yes, ODBC Linux job runs complete successfully on fork: 1st, 2nd , 3rd , 4th

Are there any user-facing changes?

No.

@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #49767 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions Bot added the awaiting review Awaiting review label May 25, 2026
@tadeja tadeja changed the title GH-49767: [CI][C++] Install upstream mold 2.31.0 in ODBC Linux job (fix for rui314/mold#1247) GH-49767: [CI][C++] Install mold 2.37.1 in ODBC Linux job (fix for rui314/mold#1247) May 25, 2026
@rok rok added the CI: Extra: C++ Run extra C++ CI label May 25, 2026
@tadeja tadeja marked this pull request as ready for review May 25, 2026 19:34
@kou kou requested a review from Copilot May 25, 2026 20:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the C++ ODBC Linux CI container command to install a newer mold linker version to avoid an intermittent pre-main() segfault in the ODBC job attributed to a known bug in Ubuntu 24.04’s packaged mold.

Changes:

  • Add MOLD_URL to the ubuntu-cpp-odbc service environment for a pinned mold .deb download.
  • Download/install the pinned mold package at container runtime before running the existing C++ build + ODBC registration + test steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compose.yaml
Comment on lines 525 to 532
/bin/bash -c "
curl -fsSL $$MOLD_URL -o /tmp/mold.deb &&
sudo apt-get update &&
sudo apt-get install -y /tmp/mold.deb &&
ld.mold --version &&
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
sudo /arrow/cpp/src/arrow/flight/sql/odbc/install/unix/install_odbc.sh /usr/local/lib/libarrow_flight_sql_odbc.so &&
/arrow/ci/scripts/cpp_test.sh /arrow /build"
Comment thread compose.yaml Outdated
Comment on lines +526 to +528
curl -fsSL $$MOLD_URL -o /tmp/mold.deb &&
sudo apt-get update &&
sudo apt-get install -y /tmp/mold.deb &&
@kou
Copy link
Copy Markdown
Member

kou commented May 25, 2026

Wow! Good catch!

How about just disabling mold on Ubuntu 24.04?

diff --git a/ci/docker/ubuntu-24.04-cpp.dockerfile b/ci/docker/ubuntu-24.04-cpp.dockerfile
index 074301b472..2cfc8be6ff 100644
--- a/ci/docker/ubuntu-24.04-cpp.dockerfile
+++ b/ci/docker/ubuntu-24.04-cpp.dockerfile
@@ -176,6 +176,11 @@ RUN /arrow/ci/scripts/install_sccache.sh unknown-linux-musl /usr/local/bin
 # provided by the distribution:
 # - Abseil is old and we require a version that has CRC32C
 # - opentelemetry-cpp-dev is not packaged
+#
+# Don't use mold 2.30.0 on Ubuntu 24.04. It has a bug in section placement:
+# - https://github.com/rui314/mold/issues/1247
+# - https://github.com/apache/arrow/issues/49767
+# - https://github.com/apache/arrow/pull/50033
 ENV absl_SOURCE=BUNDLED \
     ARROW_ACERO=ON \
     ARROW_AZURE=ON \
@@ -197,7 +202,7 @@ ENV absl_SOURCE=BUNDLED \
     ARROW_SUBSTRAIT=ON \
     ARROW_USE_ASAN=OFF \
     ARROW_USE_CCACHE=ON \
-    ARROW_USE_MOLD=ON \
+    ARROW_USE_MOLD=OFF \
     ARROW_USE_UBSAN=OFF \
     ARROW_WITH_BROTLI=ON \
     ARROW_WITH_BZ2=ON \

(We may want to measure build times with/without mold. If mold reduces much build time, we may want to install recent mold manually.)

@tadeja tadeja changed the title GH-49767: [CI][C++] Install mold 2.37.1 in ODBC Linux job (fix for rui314/mold#1247) GH-49767: [CI][C++] Disable mold on Ubuntu 24.04 to work around mold#1247 May 26, 2026
@tadeja
Copy link
Copy Markdown
Contributor Author

tadeja commented May 26, 2026

Approach changed to ARROW_USE_MOLD=OFF in ubuntu-24.04-cpp.dockerfile per great suggestion from @kou 👍

My earlier approach on fork using ARROW_USE_MOLD: "OFF" in compose.yaml section of ubuntu-cpp-odbc resulted in fast re-runs : here 1st, 2nd and 3rd attempt in less than 5min 'Execute Docker Build' but probably due to successful ccache hits.

Currently Github Actions are down, hence all the new CI failures - https://www.githubstatus.com/incidents/gnftqj9htp0g

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

Labels

awaiting review Awaiting review CI: Extra: C++ Run extra C++ CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] Linux Flight/FlightSQL test randomly segfaults after gRPC version bump

4 participants