Skip to content

[Bug] GCC 13.3 ARM64 Release build fails with maybe-uninitialized errors #537

Open

Description

@lucasfang

Search before asking

Paimon-cpp version

main at df6f7c0777c7283052eac2671e1c8e6a96b3fac8.

Reproduced on macOS ARM64 using GCC 13.3.0, C++17, Release (-O3 -DNDEBUG) and the default -Wall -Werror. GCC was paired with a compatible macOS SDK. The original report refers to GCC 13.3 ARM64; a Linux ARM64 reproduction has not been run locally.

Minimal reproduce step

With GCC 13.3 selected and the platform toolchain configured:

CC=gcc-13 CXX=g++-13 cmake -S . -B build -G Ninja \
  -DCMAKE_BUILD_TYPE=Release -DPAIMON_BUILD_TESTS=ON
cmake --build build --target paimon-core-test -j 3

The unmodified src/paimon/core/realtime/arrow_realtime_store_test.cpp fails at the ASSERT_OK_AND_ASSIGN declarations of empty_segment and segment (lines 138 and 184 at the revision above). The diagnostic concerns the shared-pointer payload of std::optional:

error: ... _M_pi ... may be used uninitialized [-Werror=maybe-uninitialized]
cc1plus: all warnings being treated as errors

An isolated compilation of this translation unit with the same Release optimization and warning flags reproduces the failure. Splitting each optional's default construction from the macro assignment compiles successfully without disabling -Werror.

What doesn't meet your expectations?

The Release tests should compile with GCC 13.3 ARM64. This is a build blocker; the compiler diagnostic alone does not establish runtime undefined behavior.

Broader macOS regression also exposes similar optional-related diagnostics in deletion-vector/file-index code, fixed-width integer and temporary-path assumptions in tests, early-year date conversion differences, and a REST mock server that hangs during shutdown because macOS does not wake its blocking accept().

Enabling optional modules additionally exposes Darwin-specific dependency compiler/linker, CMake 4 compatibility, and Jindo runtime-library installation issues.

Anything else?

The proposed fix preserves strict project warnings, corrects the portability problems above, and incorporates the macOS ARM64 Release CI coverage from #536 (related issue #535).

Local validation of the fixes on macOS ARM64:

  • GCC 13.3 Release baseline CTest: 31/31 targets passed.
  • GCC 13.3 Release full-feature CTest: 39/39 targets passed; 8,651 GoogleTest cases passed and 35 skipped.
  • Optional modules enabled: Avro, ORC, Mosaic, Lance, Vortex, Jindo, OSS, S3, Lucene, full-text and REST.
  • Lumina remains disabled on macOS; the pinned release includes both Linux x86_64 and Linux AArch64 artifacts. External network tests remain disabled.
  • Apple-specific native dependencies use Apple's compiler where required; Paimon's C++ compilation uses GCC 13.3.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Generated-by: OpenAI Codex (GPT-6)

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions