Building ext/intl with `--enable-address-sanitizer --enable-undefined-sanitizer` fails to link
未关闭
还没有人认领这个 Issue。
Bug
Category: Build System
Status: Verified
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.2k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
Description
The following code:
env CC=clang CXX=clang++ ./configure --disable-all --enable-intl --enable-debug --enable-zend-test --enable-address-sanitizer --enable-undefined-sanitizer
make
Resulted in this output:
/bin/bash php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=compile clang -Isapi/cgi/ -Iphp-src/sapi/cgi/ -Iphp-src/main -Iphp-src -Iphp-src/ext/date/lib -Iphp-src/ext/lexbor -Iphp-src/ext/uri/uriparser/include -Iphp-src/TSRM -Iphp-src/Zend -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -UNDEBUG -O0 -DZEND_SIGNALS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC -fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=object-size -fno-sanitize=function -fno-omit-frame-pointer -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c php-src/sapi/cgi/cgi_main.c -o sapi/cgi/cgi_main.lo -MMD -MF sapi/cgi/cgi_main.dep -MT sapi/cgi/cgi_main.lo
ext/opcache/jit/ir/minilua php-src/ext/opcache/jit/ir/dynasm/dynasm.lua -D X64=1 -o ext/opcache/jit/ir/ir_emit_x86.h php-src/ext/opcache/jit/ir/ir_x86.dasc
ext/opcache/jit/ir/gen_ir_fold_hash < php-src/ext/opcache/jit/ir/ir_fold.h > ext/opcache/jit/ir/ir_fold_hash.h
/bin/bash php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=compile clang -Iext/opcache/ -Iphp-src/ext/opcache/ -Iphp-src/main -Iphp-src -Iphp-src/ext/date/lib -Iphp-src/ext/lexbor -Iphp-src/ext/uri/uriparser/include -Iphp-src/TSRM -Iphp-src/Zend -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -UNDEBUG -O0 -DZEND_SIGNALS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC -fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=object-size -fno-sanitize=function -fno-omit-frame-pointer -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/jit/ir -DIR_TARGET_X64 -DIR_PHP -DIR_DEBUG -c php-src/ext/opcache/jit/ir/ir_emit.c -o ext/opcache/jit/ir/ir_emit.lo -MMD -MF ext/opcache/jit/ir/ir_emit.dep -MT ext/opcache/jit/ir/ir_emit.lo
/bin/bash php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=compile clang -Iext/opcache/ -Iphp-src/ext/opcache/ -Iphp-src/main -Iphp-src -Iphp-src/ext/date/lib -Iphp-src/ext/lexbor -Iphp-src/ext/uri/uriparser/include -Iphp-src/TSRM -Iphp-src/Zend -D_GNU_SOURCE -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -UNDEBUG -O0 -DZEND_SIGNALS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC -fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=object-size -fno-sanitize=function -fno-omit-frame-pointer -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/jit/ir -DIR_TARGET_X64 -DIR_PHP -DIR_DEBUG -c php-src/ext/opcache/jit/ir/ir.c -o ext/opcache/jit/ir/ir.lo -MMD -MF ext/opcache/jit/ir/ir.dep -MT ext/opcache/jit/ir/ir.lo
/bin/bash php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=link clang -export-dynamic -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -UNDEBUG -O0 -DZEND_SIGNALS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC -fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=object-size -fno-sanitize=function -fno-omit-frame-pointer -Wl,-zcommon-page-size=2097152 -Wl,-zmax-page-size=2097152 ext/date/php_date.o ext/date/lib/astro.o ext/date/lib/dow.o […] Zend/zend.o main/internal_functions_cli.o sapi/cli/php_cli.o sapi/cli/php_http_parser.o sapi/cli/php_cli_server.o sapi/cli/ps_title.o sapi/cli/php_cli_process_title.o -lstdc++ -lm -licuio -licui18n -licuuc -licudata -o sapi/cli/php
/bin/bash php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=link clang -export-dynamic -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -UNDEBUG -O0 -DZEND_SIGNALS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC -fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=object-size -fno-sanitize=function -fno-omit-frame-pointer -Wl,-zcommon-page-size=2097152 -Wl,-zmax-page-size=2097152 ext/date/php_date.o ext/date/lib/astro.o ext/date/lib/dow.o […] Zend/zend.o main/internal_functions_cli.o sapi/phpdbg/phpdbg_bp.o sapi/phpdbg/phpdbg_break.o sapi/phpdbg/phpdbg_btree.o sapi/phpdbg/phpdbg_cmd.o sapi/phpdbg/phpdbg_frame.o sapi/phpdbg/phpdbg_help.o sapi/phpdbg/phpdbg_info.o sapi/phpdbg/phpdbg_io.o sapi/phpdbg/phpdbg_lexer.o sapi/phpdbg/phpdbg_list.o sapi/phpdbg/phpdbg_out.o sapi/phpdbg/phpdbg_parser.o sapi/phpdbg/phpdbg_print.o sapi/phpdbg/phpdbg_prompt.o sapi/phpdbg/phpdbg_set.o sapi/phpdbg/phpdbg_sigsafe.o sapi/phpdbg/phpdbg_utils.o sapi/phpdbg/phpdbg_watch.o sapi/phpdbg/phpdbg.o -lstdc++ -lm -licuio -licui18n -licuuc -licudata -lpthread -o sapi/phpdbg/phpdbg
/bin/bash php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=link clang -export-dynamic -fno-common -Wstrict-prototypes -Wformat-truncation -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -UNDEBUG -O0 -DZEND_SIGNALS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC -fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=object-size -fno-sanitize=function -fno-omit-frame-pointer -Wl,-zcommon-page-size=2097152 -Wl,-zmax-page-size=2097152 ext/date/php_date.o ext/date/lib/astro.o ext/date/lib/dow.o […] Zend/zend.o main/internal_functions_cli.o main/fastcgi.o sapi/cgi/cgi_main.o -lstdc++ -lm -licuio -licui18n -licuuc -licudata -o sapi/cgi/php-cgi
/usr/bin/ld: ext/intl/intl_convertcpp.o: in function `intl_stringFromChar(icu_74::UnicodeString&, char*, unsigned long, UErrorCode*)':
php-src/ext/intl/intl_convertcpp.cpp:28:(.text+0x23f): undefined reference to `__ubsan_vptr_type_cache'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:28:(.text+0x263): undefined reference to `__ubsan_handle_dynamic_type_cache_miss_abort'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:36:(.text+0x363): undefined reference to `__ubsan_vptr_type_cache'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:36:(.text+0x384): undefined reference to `__ubsan_handle_dynamic_type_cache_miss_abort'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:39:(.text+0x4f1): undefined reference to `__ubsan_vptr_type_cache'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:39:(.text+0x50f): undefined reference to `__ubsan_handle_dynamic_type_cache_miss_abort'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:42:(.text+0x5f8): undefined reference to `__ubsan_vptr_type_cache'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:42:(.text+0x616): undefined reference to `__ubsan_handle_dynamic_type_cache_miss_abort'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:44:(.text+0x776): undefined reference to `__ubsan_vptr_type_cache'
/usr/bin/ld: php-src/ext/intl/intl_convertcpp.cpp:44:(.text+0x794): undefined reference to `__ubsan_handle_dynamic_type_cache_miss_abort'
[3000 lines and 4 MB later]
/usr/bin/ld: php-src/ext/intl/breakiterator/codepointiterator_internal.h:86:(.text._ZN3PHP22CodePointBreakIterator16getLastCodePointEv[_ZN3PHP22CodePointBreakIterator16getLastCodePointEv]+0xc4): undefined reference to `__ubsan_handle_dynamic_type_cache_miss_abort'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:260: sapi/cli/php] Error 1
make: *** Waiting for unfinished jobs....
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:277: sapi/phpdbg/phpdbg] Error 1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:303: sapi/cgi/php-cgi] Error 1
But I expected this output instead:
A successful build.
PHP Version
git master @ e9e0fe45e512415c4ac44c76cc59ed03a9a01fc6
Operating System
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用所示的 configure 命令复现该问题,并检查来自 ext/intl/intl_convertcpp.cpp 和 breakiterator/codepointiterator_internal.h 的链接失败。比较用于 C 和 C++ 对象的 sanitizer 标志以及 Makefile 中的链接目标。对于已配置的 PHP 构建,make 成功完成即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- build-system, internationalization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100