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

tests fail in 2038 #160

Closed
bmwiedemann opened this issue Aug 28, 2022 · 6 comments
Closed

tests fail in 2038 #160

bmwiedemann opened this issue Aug 28, 2022 · 6 comments

Comments

@bmwiedemann
Copy link

While working on reproducible builds for openSUSE, I found that yast2-core fails to build in 2038.

# of expected passes           522
# of unexpected failures       1

To reproduce, use

osc build --vm-type=kvm --clean --noservice --build-opt=--vm-custom-opt="-rtc base=2038-01-25T00:00:00" --alternative-project home:bmwiedemann:reproducible openSUSE_Tumbleweed
@dgdavid
Copy link
Member

dgdavid commented Aug 29, 2022

Hi!

Could you add more information? I have tried to reproduce the problem without success. So far, what I did was to checked out yast2-core from openSUSE:Factory

osc -A https://api.opensuse.org checkout openSUSE:Factory/yast2-core && cd $_

and then run both, a simple osc build and also the one you proposed. It worked for me.

[  482s] Check time report (>1% & >0.1s):
[  482s]     Check                            Duration (in s)   Fraction (in %)  Checked files
[  482s]     BinariesCheck                                0.7              60.9             21
[  482s]     SpecCheck                                    0.2              14.1               
[  482s]     rpm2cpio                                     0.1               9.7               
[  482s]     TOTAL                                        1.1             100.0            227
[  482s] 
[  482s]  3 packages and 0 specfiles checked; 1 errors, 1 warnings, 9 badness; has taken 1.2 s 
[  482s] 
[  482s] 
[  482s] prototype finished "build yast2-core.spec" at Mon Aug 29 08:43:55 UTC 2022.
[  482s] 

/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/SRPMS/yast2-core-4.5.2-0.src.rpm

/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/yast2-core-4.5.2-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/yast2-core-debugsource-4.5.2-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/yast2-core-debuginfo-4.5.2-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/yast2-core-devel-4.5.2-0.x86_64.rpm

Could you please paste at least the output of the command to see if it helps with debugging. Thanks

@mvidner
Copy link
Member

mvidner commented Aug 29, 2022

I've tried to reproduce it but it seems I have an unrelated failure on Leap 15.3.

[ 14s] Bail out! ERROR:../backends/rng-random.c:48:entropy_available: assertion failed: (len != -1)
# uname -r
5.3.18-150300.59.60-default

$ rpm -q osc build
osc-0.181.0-336.1.noarch
build-20220613-393.1.noarch

$ osc build --vm-type=kvm --clean --noservice openSUSE_Tumbleweed
...
[   12s] booting kvm...
[   12s] Using virtio-serial support
[   12s] /usr/bin/qemu-kvm -nodefaults -no-reboot -nographic -vga none -cpu host -M pc,accel=kvm,usb=off,dump-guest-core=off,vmport=off -sandbox on -bios /usr/share/qemu/qboot.rom -object rng-random,filename=/dev/hwrng,id=rng0 -device virtio-rng-pci,rng=rng0 -object iothread,id=io0 -runas qemu -net none -kernel /var/tmp/build-root-openSUSE_Tumbleweed/.mount/boot/kernel -initrd /var/tmp/build-root-openSUSE_Tumbleweed/.mount/boot/initrd -append root=/dev/disk/by-id/virtio-0 rootfstype=ext4 rootflags=noatime kvmclock mitigations=off elevator=noop nmi_watchdog=0 rw rd.driver.pre=binfmt_misc oops=panic panic=1 quiet console=hvc0 init=/.build/build -m 512 -drive file=/var/tmp/build-root-openSUSE_Tumbleweed/img,format=raw,if=none,id=disk,cache=unsafe -device virtio-blk-pci,iothread=io0,drive=disk,serial=0 -drive file=/var/tmp/build-root-openSUSE_Tumbleweed/swap,format=raw,if=none,id=swap,cache=unsafe -device virtio-blk-pci,iothread=io0,drive=swap,serial=1 -device virtio-serial,max_ports=2 -device virtconsole,chardev=virtiocon0 -chardev stdio,id=virtiocon0 -chardev socket,id=monitor,server=on,wait=off,path=/var/tmp/build-root-openSUSE_Tumbleweed/img.qemu/monitor -mon chardev=monitor,mode=readline -smp 4
[   14s] **
[   14s] ERROR:../backends/rng-random.c:48:entropy_available: assertion failed: (len != -1)
[   14s] Bail out! ERROR:../backends/rng-random.c:48:entropy_available: assertion failed: (len != -1)
[   15s] /usr/lib/build/build-vm-kvm: line 292: 10697 Aborted                 (core dumped) "$@"
[   15s] No buildstatus set, either the base system is broken (kernel/initrd/udev/glibc/bash/perl)
[   15s] or the build host has a kernel or hardware problem...

@mvidner
Copy link
Member

mvidner commented Aug 29, 2022

BTW the reason for the test is https://en.wikipedia.org/wiki/Year_2038_problem

@mvidner
Copy link
Member

mvidner commented Aug 29, 2022

OK, I have reproduced it, on a different machine

@mvidner
Copy link
Member

mvidner commented Aug 29, 2022

Our test driver is a bit stupid not to display the failure outright, anyway, the failing test case is (srandom () > 1000000000)

[  116s] Running /home/abuild/rpmbuild/BUILD/yast2-core-4.5.2/libycp/testsuite/libycp.test/ycp.exp ...
[  117s] .............
[  117s] FAIL: Wrong stdout for builtin/Builtin-Misc
[  121s] ........................................................................................................................................................................................................................................................................................................................................................
[  121s]                === libycp Summary ===
[  121s] 
[  121s] # of expected passes           522
[  121s] # of unexpected failures       1
[  121s] make[4]: *** [Makefile:620: check-DEJAGNU] Error 1
[  121s] make[4]: Leaving directory '/home/abuild/rpmbuild/BUILD/yast2-core-4.5.2/libycp/testsuite'

@dgdavid
Copy link
Member

dgdavid commented Aug 29, 2022

BTW the reason for the test is https://en.wikipedia.org/wiki/Year_2038_problem

Interesting, thanks.

BTW,

Starting with Ruby version 1.9.2, the bug with year 2038 is fixed

mvidner pushed a commit that referenced this issue Aug 29, 2022
srandom does not need to be positive

tested with:
osc build --vm-type=kvm --clean --noservice --build-opt=--vm-custom-opt="-rtc base=2038-01-25T00:00:00" --alternative-project home:bmwiedemann:reproducible openSUSE_Tumbleweed
mvidner pushed a commit that referenced this issue Aug 30, 2022
The failing test checks if the YCP builtin srandom returns a positive timestamp.

This lazy fix only checks that the returned (negative) number is not nil.

Tested with:
osc build --vm-type=kvm --clean --noservice --build-opt=--vm-custom-opt="-rtc base=2038-01-25T00:00:00" --alternative-project home:bmwiedemann:reproducible openSUSE_Tumbleweed
mvidner added a commit that referenced this issue Aug 30, 2022
Fix a test that would fail in the year 2038 (#160)
@mvidner mvidner closed this as completed Sep 5, 2022
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

3 participants