KeDeng has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23038 )

Change subject: [Rocky] Avoid hooking dl_iterate_phdr on Rocky to prevent ASan 
crashes
......................................................................


Patch Set 2:

(3 comments)

Thanks for your reviews.

http://gerrit.cloudera.org:8080/#/c/23038/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/23038/2//COMMIT_MSG@9
PS2, Line 9: In ASan builds on Rocky Linux, overriding dl_iterate_phdr can lead 
to
           : segmentation faults during early runtime initialization due to 
conflicts
           : with the sanitizer's internal usage of this symbol.
> I would be nice to provide an example stack trace for that in the descripti
Done


http://gerrit.cloudera.org:8080/#/c/23038/2//COMMIT_MSG@13
PS2, Line 13: This patch introduces a new compile-time macro, __rocky__, to 
disable
            : the dl_iterate_phdr hook specifically for Rocky Linux 
environments.
> I'd think that it's attributed to particular toolchain version and the flag
Previously, when fixing the cbtree unit test, I followed your suggestion to use 
GCC for compilation. When compiling in ASAN mode, I encountered the following 
error.
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/aarch64-redhat-linux/12/ld.gold: 
error: cannot find -lasan
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil.dir/strings/strcat.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil.dir/strings/stringpiece.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil.dir/strings/strip.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil.dir/strings/substitute.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/strings/strip.cc.o
[  3%] Building CXX object src/kudu/gutil/CMakeFiles/gutil.dir/strings/util.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/strtoint.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/strings/util.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/strings/substitute.cc.o
[  3%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/sysinfo.cc.o
[  4%] Building CXX object src/kudu/gutil/CMakeFiles/gutil.dir/strtoint.cc.o
[  4%] Building CXX object src/kudu/gutil/CMakeFiles/gutil.dir/sysinfo.cc.o
[  5%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/threading/thread_collision_warner.cc.o
[  5%] Building C object src/kudu/gutil/CMakeFiles/gutil.dir/utf/rune.c.o
[  5%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil.dir/threading/thread_collision_warner.cc.o
[  5%] Building C object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/utf/rune.c.o
[  5%] Building CXX object src/kudu/gutil/CMakeFiles/gutil.dir/walltime.cc.o
[  5%] Building CXX object 
src/kudu/gutil/CMakeFiles/gutil_exported.dir/walltime.cc.o
[  5%] Linking CXX shared library ../../../lib/libgutil.so
[  5%] Linking CXX static library ../../../lib/libgutil_exported.a
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/aarch64-redhat-linux/12/ld.gold: 
error: cannot find -lasan
[  5%] Built target gutil_exported
collect2: error: ld returned 1 exit status
make[2]: *** [src/kudu/gutil/CMakeFiles/gutil.dir/build.make:614: 
lib/libgutil.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:7981: 
src/kudu/gutil/CMakeFiles/gutil.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make[2]: *** [src/kudu/hms/CMakeFiles/hms_thrift.dir/build.make:181: 
lib/libhms_thrift.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:8179: 
src/kudu/hms/CMakeFiles/hms_thrift.dir/all] Error 2

To resolve this, I manually installed the gcc-toolset-12-libasan-devel.aarch64 
package on the system to continue the compilation. Fortunately, after 
installation, the ASAN mode compilation completed successfully. However, 
regrettably, when running the kudu-tool-test, it immediately reported a 
segmentation fault with the following stack trace.
Program received signal SIGSEGV, Segmentation fault.
0x0000ffff741d7f0c in dl_iterate_phdr (
callback=0xffff7fe95e20 <__asan::FindFirstDSOCallback(dl_phdr_info*, unsigned 
long, void*)>,
data=0xffffe16df040
) at /data/code/comm/kudu/src/kudu/util/debug/unwind_safeness.cc:157

The error disappeared after bypassing the internal dl_iterate_phdr function.


http://gerrit.cloudera.org:8080/#/c/23038/2//COMMIT_MSG@22
PS2, Line 22: https://github.com/google/sanitizers/issues/915
> How is this generic item relevant to the issue you describe?  It would be g
Done



--
To view, visit http://gerrit.cloudera.org:8080/23038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5043e587c85dc18a37259f49b9c2f2008b3295ee
Gerrit-Change-Number: 23038
Gerrit-PatchSet: 2
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: KeDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 18 Jun 2025 03:21:04 +0000
Gerrit-HasComments: Yes

Reply via email to