Commit 2b1803a
authored
[fix](paimon-cpp) deduplicate Arrow linking to fix SIGSEGV in FilterRowGroupsByPredicate (#60883)
## Proposed changes
### Problem
When `ENABLE_PAIMON_CPP` is ON, both Doris's own `libarrow.a` and
paimon-cpp's `libarrow.a` are linked into `doris_be`, causing **3698
duplicate global symbols**. This leads to **SIGSEGV crashes** in
`paimon::parquet::ParquetFileBatchReader::FilterRowGroupsByPredicate`
when `libarrow_dataset.a` resolves arrow core calls to the wrong copy
(compiled with different feature flags).
Both are Arrow 17.0.0 but compiled with different options:
| Feature | Doris Arrow | paimon Arrow |
|---|---|---|
| COMPUTE | OFF | **ON** |
| DATASET | OFF | **ON** |
| ACERO | OFF | **ON** |
| FILESYSTEM | OFF | **ON** |
| FLIGHT | **ON** | OFF |
| FLIGHT_SQL | **ON** | OFF |
| PARQUET | ON | ON |
### Crash Stack
```
SIGSEGV invalid permissions for mapped object
→ std::string::basic_string(char const*, ...)
→ paimon::ToPaimonStatus(arrow::Status const&)
→ paimon::parquet::ParquetFileBatchReader::FilterRowGroupsByPredicate(...)
```
### Root Cause
Inside `-Wl,--start-group ... --end-group`, the linker may resolve
symbols from `libarrow_dataset.a` (paimon's) to Doris's `libarrow.a`,
which was compiled without COMPUTE/FILESYSTEM modules. The internal
object memory layout differs, causing `arrow::Status` and other objects
to trigger illegal memory access when passed across library boundaries.
### Fix
When the `paimon_deps` Arrow stack is selected (because Doris lacks
`libarrow_dataset.a` / `libarrow_acero.a`), remove Doris's `arrow` from
`COMMON_THIRDPARTY`.
paimon's `libarrow.a` is a **superset** of Doris's version (same 17.0.0,
with additional modules enabled), so it provides all symbols needed by
Doris's `libarrow_flight.a` / `libarrow_flight_sql.a`.
### Impact
- Only `be/CMakeLists.txt` changed (~10 lines).
- No C++/Java business code changes.
- No impact when `ENABLE_PAIMON_CPP=OFF`.
## Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)1 parent 6d5ebe0 commit 2b1803a
2 files changed
+11
-82
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | 626 | | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
697 | 636 | | |
698 | 637 | | |
699 | 638 | | |
| |||
720 | 659 | | |
721 | 660 | | |
722 | 661 | | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | 662 | | |
736 | 663 | | |
737 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
0 commit comments