hubgeter opened a new pull request, #67848:
URL: https://github.com/apache/doris/pull/67848
### What problem does this PR solve?
Issue Number: N/A
Related PR: #67752
Problem Summary:
BE unit tests can crash at address zero while Arrow Flight initializes
Abseil random seeds on CentOS 7 (glibc 2.17). ASAN's weak `getentropy`
interceptor satisfies the reference before the linker scans
`libglibc-compatibility.a`, so Doris' compatibility implementation is not
extracted. Since glibc 2.17 has no `getentropy`, the interceptor calls a null
`real_getentropy` pointer. Restoring the CentOS 7 CI image exposed this
existing gap.
Link the existing `musl/getentropy.c` through
`glibc-compatibility-explicit`, just like `getrandom`. Preserve the existing
`HAVE_SYS_RANDOM_H` guard, ARM ASAN `memcpy` exclusion, and this source file's
Clang conversion-warning policy. The C implementation and Flight cancellation
logic are unchanged.
### Release note
None
### Check List (For Author)
- Test
- [ ] Regression test
- [ ] Unit Test
- [x] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
Manual validation with Clang 20.1.8, Abseil, and the actual compatibility
CMake targets:
- Built a minimal executable that calls `ReadSeedMaterialFromOSEntropy`
1,000 times and checks `getentropy` lengths 0, 1, 256, and the 257-byte
`-1/EIO` case.
- On CentOS 7 / glibc 2.17, the unpatched ASAN executable reproduces the
zero-address crash; patched `ASAN_UT`, `ASAN` (with UBSAN), and non-ASAN
`Debug` executables pass.
- The same unpatched ASAN executable passes on AlmaLinux 8 / glibc 2.28.
Non-ASAN executables pass before and after the patch on both distributions.
- `nm` confirms that the patched executable selects the strong compatibility
definition of `getentropy`. The minimal executables have no GLIBC
symbol-version requirement above 2.17.
- Checked the ARM ASAN/Debug and missing-`sys/random.h` CMake branches by
configuration; no ARM runtime test was performed.
- `git diff --check` passes.
The original test was also attempted with `BUILD_TYPE_UT=ASAN bash
run-be-ut.sh --run --filter='RemoteDorisV2ReaderTest.*' -j 4`. Configure
succeeded, but the local build stopped because
`thirdparty/installed/lib64/libarrow_compute.a` is missing. Full BE UT has not
been validated locally.
- Behavior changed:
- [ ] No.
- [x] Yes. Select the existing compatibility implementation explicitly
when `sys/random.h` is available, preventing the ASAN crash on older glibc.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]