Skip to content

[C++][CI] MinGW GCC 16.1 regression - shared_ptr corruption in multi-threaded tests #49958

Description

@tadeja

Describe the bug, including details regarding any error messages, version, and platform.

Status: Resolved (May 16). Root cause was GCC bug 125312 15.2->16.1 regression in MinGW's libstdc++.dll (non-inline __exchange_and_add used by atomic shared_ptr ref-counting). Not an Arrow bug.
Fix shipped via MSYS2 rebuild msys2/MINGW-packages#29502 with release 4 mingw-w64-x86_64-gcc-libs-16.1.0-4.

Arrow CI - pin workaround from #49931 reverted with #49945 (merged May 16) and MinGW job passing on then-current MSYS2: https://github.com/apache/arrow/actions/runs/25937291262/job/76296127141#step:5:109
Parent/umbrella: #49948 (closed). Initial diagnosis details in #49961.

On AMD64 Windows MinGW MINGW64 C++ with MSYS2 gcc 15.2 -> 16.1 update (post 2026 April 30: mingw-w64-x86_64-gcc-16.1.0-3 and mingw-w64-x86_64-gcc-libs) two tests started failing every run with std::bad_weak_ptr: arrow-dataset-dataset-writer-test and arrow-dataset-file-test. Also affected, with no dataset code involved: arrow-async-utility-test (heap corruption in PushGenerator.Stress), arrow-threading-utility-test (Timeout), ...
CLANG64 C++ (libc++) and gcc 15.2 are unaffected!

Example CI log

[ RUN ] TestFileSystemDataset.MultiThreadedWritePersistsOrder
terminate called after throwing an instance of 'std::bad_weak_ptr'
what(): bad_weak_ptr
...
[ RUN ] DatasetWriterTestFixture.BatchWriteConcurrent
terminate called after throwing an instance of 'std::bad_weak_ptr'
what(): bad_weak_ptr

Component(s)

C++, Continuous Integration

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions