fix(coost): disable syscall hooks in test build to fix gcov crash - #772
Conversation
coost interposes open/fcntl/close; gcov flush at exit calls these, hitting a half-destroyed co::MemBlocks allocator -> SIGSEGV in 3 test binaries, leaving corrupt .gcda that aborts lcov mid-run and drops coverage to ~39%. coost 通过符号介入拦截 open/fcntl/close 等;进程退出时 gcov 落盘调用 这些 syscall,触发已半析构的 co::MemBlocks 分配器,导致 3 个测试二进制 SIGSEGV,并留下损坏的 .gcda 使 lcov 中途中止、覆盖率跌至 ~39%。 - compat.cmake: 测试构建(DOTEST/BUILD_TESTS)前置 DISABLE_HOOK ON - hook.h: _CO_DISABLE_HOOK 分支补齐 POSIX 头文件,否则 sock.cc 编译失败 Log: 修复测试退出阶段 coost hook 导致的段错误 Influence: 修复 commonstruct/zrpc/daemon 测试二进制退出段错误;单元测试 覆盖率从 ~39% 恢复至 ~80%;仅影响测试构建,生产构建行为不变。
There was a problem hiding this comment.
Sorry @pengfeixx, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 代码已足够完善,无需修改 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
coost interposes open/fcntl/close; gcov flush at exit calls these, hitting a half-destroyed co::MemBlocks allocator -> SIGSEGV in 3 test binaries, leaving corrupt .gcda that aborts lcov mid-run and drops coverage to ~39%.
coost 通过符号介入拦截 open/fcntl/close 等;进程退出时 gcov 落盘调用
这些 syscall,触发已半析构的 co::MemBlocks 分配器,导致 3 个测试二进制
SIGSEGV,并留下损坏的 .gcda 使 lcov 中途中止、覆盖率跌至 ~39%。
Log: 修复测试退出阶段 coost hook 导致的段错误
Influence: 修复 commonstruct/zrpc/daemon 测试二进制退出段错误;单元测试 覆盖率从 ~39% 恢复至 ~80%;仅影响测试构建,生产构建行为不变。