Repository navigation
fix(test): make tst-support_descriptors pass when /dev/null and /dev are on different filesystems (uos-debrebuild build failure) - #53
Conversation
…are on different filesystems The uos-debrebuild pipeline failed to rebuild glibc 2.38-6deepin31 at the check stage with a single failing test: FAIL: support/tst-support_descriptors error: tst-support_descriptors.c:141: not true: strstr (proc.out.buffer, expected) != NULL (summary: 5168 PASS, 1 FAIL -> make check Error -> dpkg-buildpackage exit 2) Root cause: that chroot (sbuild --chroot-mode=unshare) bind-mounts /dev/null from a different filesystem than /dev (st_dev 0:6 vs 0:34). In subprocess_changed_descriptor the test changes fd 3 from /dev/null to /dev, and support_descriptors_check then prints an extra error: descriptor 3 changed device from 0:6 to 0:34 line between the "changed from" and "changed ino" lines. The test matches both expected lines with one glued strstr, which no longer matches. On ordinary build systems /dev/null and /dev share st_dev, so the extra line never appears there. Fix (debian/patches/any/local-tst-support-descriptors-cross-device.diff): split the glued expectation into two independent substring checks. The diagnostics printed by support_descriptors_check are unchanged; only the test's matching of its own expected output becomes tolerant of the optional device line. Verified against a full glibc 2.38 source build: - unpatched test: exit 0 normally; exit 1 (same error signature as the pipeline) inside a mount namespace with /dev/null bind-mounted from a different filesystem - patched test: exit 0 in both environments, with the "changed device" diagnostic still being printed and checked Log: fix the only failing self-test so glibc rebuilds complete in unshare-based chroots Influence: 1. glibc 2.38-6deepin32 completes make check in the uos-debrebuild (unshare) environment; no behavior change elsewhere 2. The support_descriptors_check diagnostics are unchanged, only the test's own expectation matching is split 3. Ordinary build systems (/dev/null and /dev on the same filesystem) behave exactly as before fix(test): 使 tst-support_descriptors 在 /dev/null 与 /dev 位于不同文件系统时也能通过 uos-debrebuild 流水线重建 glibc 2.38-6deepin31 在 check 阶段失败,仅一个 测试不通过: FAIL: support/tst-support_descriptors error: tst-support_descriptors.c:141: not true: strstr (...) != NULL (汇总:5168 PASS,1 FAIL → make check Error → dpkg-buildpackage 退出 2) 根因:该 chroot(sbuild --chroot-mode=unshare)的 /dev/null 是从与 /dev 不同的文件系统 bind-mount 而来(st_dev 0:6 vs 0:34)。测试在 subprocess_changed_descriptor 中把 fd 3 从 /dev/null 换成 /dev, support_descriptors_check 会在 "changed from" 与 "changed ino" 两行之间 多打印一行: error: descriptor 3 changed device from 0:6 to 0:34 而测试用一条拼接的 strstr 同时匹配两行,遂失配。普通构建系统的 /dev/null 与 /dev 同设备,不会出现该行。 修复(debian/patches/any/local-tst-support-descriptors-cross-device.diff): 把拼接期望拆成两个独立的子串匹配。support_descriptors_check 的诊断输出 不变,仅测试对自身预期输出的匹配可容忍可选的 device 行。 基于完整的 glibc 2.38 源码构建验证: - 未打补丁:常规环境 exit 0;在挂载命名空间内将 /dev/null 跨文件系统 bind-mount 后 exit 1(错误签名与流水线完全一致) - 打补丁后:两种环境均 exit 0,"changed device" 诊断仍照常打印并校验 Log: 修复唯一失败的自检测试,使 glibc 在 unshare 类 chroot 中能完成重建 Influence: 1. glibc 2.38-6deepin32 在 uos-debrebuild(unshare)环境可完整通过 make check,其他环境无行为变化 2. support_descriptors_check 诊断输出不变,仅拆分测试自身的期望匹配 3. 普通构建系统(/dev/null 与 /dev 同文件系统)行为与之前完全一致 repo: glibc #master
|
/integrate |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
TAG Bot TAG: 2.38-6deepin32 |
|
AutoIntegrationPr Bot |
… with proper blank-context lines dpkg-source applies patches with patch -t -F 0 (no fuzz allowed); the previous version of the patch needed fuzz 1 for hunk 2 and had empty lines instead of single-space blank context lines, which made dpkg-source abort with 'Hunk #2 FAILED' / 'unexpected end of diff'. Regenerate the body mechanically from the verified build tree so it is byte-identical to GNU diff output: single hunk, exact line counts (-128,20 +128,28), proper blank context markers. Verified: patch -t -F 0 dry-run clean; full dpkg-source --before-build applies the whole series including this patch with exit 0 and no warnings; the applied file is byte-identical to the one used in the end-to-end test verification (cross-device /dev/null: unpatched exit 1, patched exit 0).
|
已修复 patch 无法应用的问题(commit 失败原因有两点:
修复方式:从实际验证过的构建树机械重新生成 diff 体(单 hunk,精确计数 验证:
|
|
本地完整打包构建验证(cfe1acf6 之后) 在 uos:2501 容器内用
结论:在流水线等价环境(无 gdb)下,该补丁可使 glibc 构建全绿。 |
|
/integrate |
fix(test): tst-support_descriptors 在 /dev/null 与 /dev 异设备时失败(2.38-6deepin32)
失败现象
uos-debrebuild 重建
2.38-6deepin31在 check 阶段失败(非编译错误),全部测试中仅一个不通过:根因
该流水线使用
sbuild --chroot-mode=unshare,chroot 内/dev/null是从另一个文件系统 bind-mount 的(st_dev0:6),而/dev目录在 rootfs 上(st_dev0:34)。测试的
subprocess_changed_descriptor把 fd 3 从/dev/null换成/dev,support_descriptors_check在两行预期诊断之间多打印了一行:测试用一条拼接的 strstr 同时匹配 "changed from … changed ino …",插入行导致失配。普通构建系统
/dev/null与/dev同设备,不出现该行,因此 OBS/常规 CI 不受影响。上游 master 至今未改这两个文件(无现成上游修复)。修复
debian/patches/any/local-tst-support-descriptors-cross-device.diff:把拼接期望拆成两个独立子串匹配。诊断输出本身不变,仅测试对自身预期输出的匹配可容忍可选的 device 行。验证(完整 glibc 2.38 源码构建 + 真实复现)
changed device from 259:4 to 0:5+:141 not true)changed device诊断照常打印并被校验)复现方法:宿主
sudo unshare -m sh -c 'mount --bind /tmp/f /dev/null; …'后直接以构建出的 ld.so 运行测试二进制。影响面