zclllyybb commented on issue #64212:
URL: https://github.com/apache/doris/issues/64212#issuecomment-4646554243
Breakwater-GitHub-Analysis-Slot: slot_c94cf9544c21
Thanks for the detailed report. I checked the current upstream
`origin/master` code path, and the reported root cause is consistent with the
test implementation.
Assessment:
- This looks like a BE unit-test fixture path bug, not a `safe_glob()`
implementation bug.
- `LocalFileSystemTest.TestGlob` creates and deletes its fixture under the
hardcoded path `./be/ut_build_ASAN/test/file_path/...`.
- `run-be-ut.sh` derives the active build directory as
`${DORIS_HOME}/be/ut_build_${CMAKE_BUILD_TYPE}` from `BUILD_TYPE_UT`, then
exports `DORIS_HOME="${CMAKE_BUILD_DIR}/test/"` before running `doris_be_test`.
- `LocalFileSystem::safe_glob()` expands the requested pattern as
`config::user_files_secure_path + "/" + path`, and `user_files_secure_path`
defaults to `${DORIS_HOME}`. Therefore `safe_glob("./file_path/1/*.txt")` looks
under the active test binary directory, for example
`be/ut_build_LSAN/test/file_path`, while this test always created the files
under `be/ut_build_ASAN/test/file_path`.
- That explains why the test can pass in the default ASAN build and fail in
LSAN/TSAN/UBSAN builds with `GLOB_NOMATCH`.
Recommended fix direction:
- Make `TestGlob` create and clean up the fixture under the same root used
by `safe_glob`, preferably by deriving the base from
`config::user_files_secure_path` or an equivalent BE UT test helper, instead of
hardcoding `ut_build_ASAN`.
- Keep the `safe_glob("./file_path/...")` assertions as relative patterns so
the test still verifies the safe-path anchoring behavior and the rejection of
unsafe patterns such as `..`.
- Use the same computed base for cleanup to avoid leaving stale fixture
directories in either ASAN or non-ASAN build trees.
Missing information / validation:
- No product logs or runtime profiles are needed for this root cause; the
issue is bounded to the unit-test fixture setup.
- The PR should validate at least:
- `BUILD_TYPE_UT=ASAN ./run-be-ut.sh --run
--filter=LocalFileSystemTest.TestGlob`
- `BUILD_TYPE_UT=LSAN ./run-be-ut.sh --run
--filter=LocalFileSystemTest.TestGlob`
- If the CI matrix supports them, TSAN and UBSAN runs would be useful as
follow-up validation because they exercise the same build-directory naming
issue.
I did not find an obvious open PR matching the exact hardcoded
`./be/ut_build_ASAN/test/file_path` fixture path at the time of this check.
--
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]