You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: cp Not working as expected "as it was replaced while being copied" #27
xinmu-server-3c6000 ~# latx-x86_64 /usr/x86_64-pc-linux-gnu/usr/bin/cp a.c c.c
Lat can't find ldinfo.cp: skipping file 'a.c', as it was replaced while being copiedxinmu-server-3c6000 ~ # LATX_KZT=0 latx-x86_64 /usr/x86_64-pc-linux-gnu/usr/bin/cp a.c c.ccp: skipping file 'a.c', as it was replaced while being copied
xinmu-server-3c6000 ~# latx-x86_64 /usr/x86_64-pc-linux-gnu/usr/bin/cp a.c c.c
Lat can't find ldinfo.cp: skipping file 'a.c', as it was replaced while being copiedxinmu-server-3c6000 ~ # /media/ssd/lat-build/lat/build64/latx-x86_64 /usr/x86_64-pc-linux-gnu/usr/bin/cp a.c c.ccp: skipping file 'a.c', as it was replaced while being copied
Activity
luzeng87 commentedon Apr 2, 2025
Try
export LATX_KZT=0to see if it works.LaurenIsACoder commentedon Apr 2, 2025
请使用 PR #29 测试看问题是否解决
Xinmudotmoe commentedon Apr 2, 2025
有差别,但没有解决
同上
同时,我测试了busybox的cp实现,在latx和qemu下 busybox的cp都是正常的
Xinmudotmoe commentedon Apr 2, 2025
Test Cases
fstat与stat的结果出现了st_dev不一致的情况
以系统环境为预期信息,qemu-x86_64与系统一致,latx-x86_64不一致
LaurenIsACoder commentedon Apr 5, 2025
我在 loongnix20.6 系统上无法复现该问题,不知道该问题依赖的是 OS 还是内核版本?
有没有小伙伴可以帮着测试一下其它 OS 上的现象?
Xinmudotmoe commentedon Apr 5, 2025
我认为是旧内核下比bug较难复现的问题。
在高版本内核中,st_dev的长度默认会超过2byte( 0x10304 4byte) 并且可能发生了截断问题(只保留了0x0304)
但4.19内核返回的范围仅1byte(0x2f)
Xinmudotmoe commentedon Apr 10, 2025
https://github.com/lat-opensource/lat/blame/fe0d49ff6277201dd549a236b67beed9f6831dd6/linux-user/syscall.c#L13577-L13578
🤔
LaurenIsACoder commentedon Apr 10, 2025
是的,确实有可能是之前修复wine的时候引入问题。不过这个 bug 的复现除了对内核版本有要求,还对机器硬件配置有要求,因为 st_dev 的值的高位取决于设备的 major 号,实验发现 nvme 的盘 major 会比较大,我得协调个符合条件的机器复现了再改。
LaurenIsACoder commentedon Apr 15, 2025
请使用 PR #48 测试看问题是否解决
Xinmudotmoe commentedon Apr 15, 2025
PASS