Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On non-x86 architectures, test_cpuinfo fails #323

Open
musicinmybrain opened this issue Dec 20, 2024 · 2 comments
Open

On non-x86 architectures, test_cpuinfo fails #323

musicinmybrain opened this issue Dec 20, 2024 · 2 comments

Comments

@musicinmybrain
Copy link

Working on a public cloud VM:

$ uname -srvmo
Linux 6.8.0-1018-oracle #19~22.04.1-Ubuntu SMP Mon Dec  9 23:49:53 UTC 2024 aarch64 GNU/Linux
$ git clone https://github.com/eminence/procfs.git
$ cd procfs
$ git checkout v0.17.0
$ RUST_BACKTRACE=1 cargo test
[…]
failures:

---- tests::test_cpuinfo stdout ----
None
thread 'tests::test_cpuinfo' panicked at procfs/src/lib.rs:683:34:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/panicking.rs:127:5
   3: core::option::Option<T>::unwrap
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/option.rs:931:21
   4: procfs::tests::test_cpuinfo
             at ./src/lib.rs:683:13
   5: procfs::tests::test_cpuinfo::{{closure}}
             at ./src/lib.rs:679:22
   6: core::ops::function::FnOnce::call_once
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- process::task::tests::test_task_runsinglethread stdout ----
thread 'process::task::tests::test_task_runsinglethread' panicked at procfs/src/process/task.rs:202:17:
utime(37) too small
stack backtrace:
   0: rust_begin_unwind
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/panicking.rs:72:14
   2: procfs::process::task::tests::test_task_runsinglethread
             at ./src/process/task.rs:202:17
   3: procfs::process::task::tests::test_task_runsinglethread::{{closure}}
             at ./src/process/task.rs:125:35
   4: core::ops::function::FnOnce::call_once
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/ops/function.rs:250:5
   5: core::ops::function::FnOnce::call_once
             at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    process::task::tests::test_task_runsinglethread
    tests::test_cpuinfo

test result: FAILED. 96 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.09s

I originally saw this while working on an update for the rust-procfs package in Fedora. While the above reproduces it on aarch64, I saw the same test failure on ppc64le and s390x. The test_task_runsinglethread failure is reported separately in #322.

@eminence
Copy link
Owner

The singlethreaded test failure is probably covered by #322

For the test_cpuinfo failure, can you share your /proc/cpuinfo file?

@musicinmybrain
Copy link
Author

The singlethreaded test failure is probably covered by #322

I agree.

For the test_cpuinfo failure, can you share your /proc/cpuinfo file?

Here are typical non-x86 /proc/cpuinfo contents on real hardware in Fedora infrastructure. I confirmed that test_cpuinfo actually failed on each of these.

aarch64

processor	: 0
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 1
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 2
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 3
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 4
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 5
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 6
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 7
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 8
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 9
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 10
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1
processor	: 11
BogoMIPS	: 50.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x3
CPU part	: 0xd0c
CPU revision	: 1

ppc64le

processor	: 0
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
processor	: 1
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
processor	: 2
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
processor	: 3
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
processor	: 4
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
processor	: 5
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
processor	: 6
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
processor	: 7
cpu		: POWER9 (architected), altivec supported
clock		: 2250.000000MHz
revision	: 2.2 (pvr 004e 1202)
timebase	: 512000000
platform	: pSeries
model		: IBM pSeries (emulated by qemu)
machine		: CHRP IBM pSeries (emulated by qemu)
MMU		: Radix

Regarding the presence of the string “emulated by qemu,” I know that Fedora uses real PowerPC hardware, so I don’t know why qemu seems to be involved. I could probably find out.

s390x

vendor_id       : IBM/S390
# processors    : 2
bogomips per cpu: 3331.00
max thread id   : 0
features	: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt vxp2 nnpa sie 
facilities      : 0 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 47 48 49 50 51 52 53 54 57 58 59 60 61 64 65 69 71 72 73 74 75 76 77 78 80 81 82 129 130 131 133 134 135 138 139 140 146 147 148 150 151 152 155 156 165 192 193 194 196 197
cache0          : level=1 type=Data scope=Private size=128K line_size=256 associativity=8
cache1          : level=1 type=Instruction scope=Private size=128K line_size=256 associativity=8
cache2          : level=2 type=Unified scope=Private size=32768K line_size=256 associativity=16
cache3          : level=3 type=Unified scope=Shared size=262144K line_size=256 associativity=128
processor 0: version = FF,  identification = 525FA8,  machine = 3931
processor 1: version = FF,  identification = 525FA8,  machine = 3931
cpu number      : 0
physical id     : 0
core id         : 0
book id         : 0
drawer id       : 0
dedicated       : 0
address         : 0
siblings        : 1
cpu cores       : 1
version         : FF
identification  : 525FA8
machine         : 3931
cpu MHz dynamic : 5200
cpu MHz static  : 5200
cpu number      : 1
physical id     : 1
core id         : 1
book id         : 0
drawer id       : 0
dedicated       : 0
address         : 1
siblings        : 1
cpu cores       : 1
version         : FF
identification  : 525FA8
machine         : 3931
cpu MHz dynamic : 5200
cpu MHz static  : 5200

The test passes on both x86_64 and i686.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants