Closed mrc0mmand closed 2 years ago
I can reproduce this on F35. It's not specific to your eno1.txt, it happens just as well with e.g. devices/input/usbkbd.umockdev from upstream git:
❱❱❱ LD_LIBRARY_PATH=. ./umockdev-run -d ../devices/input/usbkbd.umockdev -- ls -l /sys/bus/pci/devices/
ls: cannot access '/sys/bus/pci/devices/0000:00:1a.0': No such file or directory
total 0
l????????? ? ? ? ? ? 0000:00:1a.0
However, this is somehow specific to ls
. libudev or even Python are happy:
❱❱❱ LD_LIBRARY_PATH=. ./umockdev-run -d ../devices/input/usbkbd.umockdev -- python3 -c 'import os; print(os.listdir("/sys/bus/pci/devices/0000:00:1a.0"))'
['driver', 'config', 'vendor', 'uframe_periodic_max', 'subsystem_vendor', 'subsystem_device', 'resource', 'pools', 'numa_node', 'msi_bus', 'modalias', 'local_cpus', 'local_cpulist', 'irq', 'dma_mask_bits', 'device', 'd3cold_allowed', 'consistent_dma_mask_bits', 'companion', 'class', 'broken_parity_status', 'uevent', 'subsystem', 'usb1']
This smells like a new glibc introducing yet another ?stat?() variant which needs to be wrapped. I'll strace it and investigate. Thanks for your report!
Here is the culprit:
23876 statx(AT_FDCWD, "/sys/bus/pci/devices/", AT_STATX_SYNC_AS_STAT, STATX_MODE, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_blksize=4096, stx_attributes=0, stx_nlink=2, stx_uid=65534, stx_gid=65534, stx_mode=S_IFDIR|0755, stx_ino=2419, stx_size=0, stx_blocks=0, stx_attributes_mask=STATX_ATTR_AUTOMOUNT|STATX_ATTR_MOUNT_ROOT|STATX_ATTR_DAX, stx_atime={tv_sec=1641722969, tv_nsec=983000028} /* 2022-01-09T11:09:29.983000028+0100 */, stx_btime={tv_sec=0, tv_nsec=0}, stx_ctime={tv_sec=1641722969, tv_nsec=888000023} /* 2022-01-09T11:09:29.888000023+0100 */, stx_mtime={tv_sec=1641722969, tv_nsec=888000023} /* 2022-01-09T11:09:29.888000023+0100 */, stx_rdev_major=0, stx_rdev_minor=0, stx_dev_major=0, stx_dev_minor=23}) = 0
I have a first fix. It still fails on Alpine with musl libc as that doesn't have a statx() (and thus I can't land it yet), but it works fine with glibc now.
Thanks a lot for the fix!
Hello!
In my recent endeavours in https://github.com/systemd/systemd/issues/21725 I've been trying to "collect" a couple of NICs to further expand on the idea, but stumbled across a weird bug(?).
I have a machine with a OneConnect 10Gb NIC:
umockdev-record
successfully creates a text dump of the topology (tested with bothumockdev-record /sys/class/net/eno1
andumockdev-record /sys/class/net/en*
), but mocking the devices back on a different machine yields weird results:However, the links are correct when looking directly in the $UMOCKDEV_DIR:
On both machines I tried the F34 umockdev version as well as the latest master (4f22f02 ATTOW), with the same results.
Used umockdev files (renamed to *.txt, to make GH happy):
Is there something I'm missing or there's an actual issue somewhere?