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

musl build tests failing #913

Closed
hholst80 opened this issue Jul 6, 2023 · 11 comments
Closed

musl build tests failing #913

hholst80 opened this issue Jul 6, 2023 · 11 comments

Comments

@hholst80
Copy link
Sponsor

hholst80 commented Jul 6, 2023

I tried to package Vifm 0.13 for Void Linux but got a build error on the musl x86_64 platform.

It seems one of the tests crashed without any good feedback:

https://github.com/void-linux/void-packages/actions/runs/5475460923/jobs/9975694493?pr=44870

Can anyone help me try running the tests on a musl 64-bit platform?

EDIT: There was a patch for 0.12 regarding the tests, I have not spoken to the previous packager why these patches existed to begin with. I was hoping it was something transient, something not required for 0.13, but maybe it still is required for the musl libc platform?

https://github.com/void-linux/void-packages/pull/44870/files#diff-bb99e12ed397c231f929eb74749a60b62857847bff471de7d2ad8b2cffe2dfca

@xaizek
Copy link
Member

xaizek commented Jul 7, 2023

The patch simply disables a bunch of tests and this issue wasn't brought up before, so nothing was updated for musl (if anything needs to be updated).

Building for musl is done by using musl-gcc instead of gcc (CC=musl-gcc LD=musl-gcc during ./configure), but it might also require adding CFLAGS and/or LDFLAGS. Then make check runs the tests (or can just run make inside tests/ directory).

Edit: I might provide a shorter patch, I found the line which causes the crash to occur.

@xaizek
Copy link
Member

xaizek commented Jul 8, 2023

No, it's not shorter, but at least it doesn't disable any tests: vifm-v0.13-musl-tests.patch.txt (ridiculously, GitHub doesn't recognize .patch or .diff extensions... damn M$).

tests/fileops/chown.c changse might need to be taken from the old patch, it's probably not related to musl.

@hholst80
Copy link
Sponsor Author

hholst80 commented Jul 9, 2023

@xaizek it looks like, after testing on alpine in a docker container, that these two asserts fails on x86_64 musl:

image

@hholst80
Copy link
Sponsor Author

hholst80 commented Jul 9, 2023

I ran vifm 0.12 in Alpine 3.16.2 and the directory rename / move seems to be just fine. /tmp is overlayfs on top of xfs.

image

@xaizek
Copy link
Member

xaizek commented Jul 9, 2023

I don't know if something like noatime would affect these tests, but sometimes they can fail due to the kernel (see https://bugzilla.redhat.com/show_bug.cgi?id=244697). If latter is the case, the failure won't happen every time. It can also depend on the state of 'syscalls' option, the test runs with both values. I can try in Apline, but I don't remember changes related to cloning time stamps in v0.13.

I ran vifm 0.12 in Alpine 3.16.2

Did the tests pass? This test is not a new one.

@hholst80
Copy link
Sponsor Author

No, there are two failing asserts on musl in merge_directories_creating_intermediate_parent_dirs_copy

runtests.log:	merge_directories_creating_intermediate_parent_dirs_copy:
runtests.log:	   (-) FAILED
runtests.log:	       fileops/generic.c:263: error: check failed
runtests.log:	       in perform_merge
runtests.log:	       Should have been success (zero)
runtests.log:	   (-) FAILED
runtests.log:	       fileops/generic.c:266: error: check failed
runtests.log:	       in perform_merge
runtests.log:	       Should have been success (zero)
runtests.log:	
runtests.log:	                     4 tests run  2 checks failed

I am trying to understand what the tests does. I am not comfortable disabling the tests because the same tests pass with another libc on the same kernel (on my laptop). I added a stat on the source and on the output:

runtests.log:	======================== stic v0.6 :: escape =========================
runtests.log:	
runtests.log:	                           ALL TESTS PASSED
runtests.log:	                           ----------------
runtests.log:	        227 checks :: 51 run tests :: 0 skipped tests :: 3 ms
runtests.log:	
runtests.log:	======================================================================
runtests.log:	  File: first/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 141092875   Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:14.842302000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.842300000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.840948318 +0000
runtests.log:	atim: difftime: 0
runtests.log:	mtim: difftime: 0
runtests.log:	  File: second/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 239417251   Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:14.842302000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.842300000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.860948317 +0000
runtests.log:	  File: first/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 77205288    Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:14.865433000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.865431000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.863948317 +0000
runtests.log:	atim: difftime: 0
runtests.log:	mtim: difftime: 0
runtests.log:	  File: second/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 173395677   Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:14.865433000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.865431000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.865948317 +0000
runtests.log:	  File: first/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 11811983    Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:14.868979000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.868977000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.867948317 +0000
runtests.log:	atim: difftime: 2.86898
runtests.log:	------------------------- fileops/generic.c --------------------------
runtests.log:	mtim: difftime: 0.868977
runtests.log:	  File: second/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 111668721   Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:12.000000000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.000000000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.869948317 +0000
runtests.log:	  File: first/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 209269162   Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:14.872923000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.872921000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.871948317 +0000
runtests.log:	atim: difftime: 0
runtests.log:	mtim: difftime: 0
runtests.log:	  File: second/nested1
runtests.log:	  Size: 21        	Blocks: 0          IO Block: 4096   directory
runtests.log:	Device: 49h/73d	Inode: 39736257    Links: 3
runtests.log:	Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
runtests.log:	Access: 2023-07-10 09:30:14.872923000 +0000
runtests.log:	Modify: 2023-07-10 09:30:12.872921000 +0000
runtests.log:	Change: 2023-07-10 09:30:11.872948317 +0000
runtests.log:	
runtests.log:	merge_directories_creating_intermediate_parent_dirs_copy:
runtests.log:	   (-) FAILED
runtests.log:	       fileops/generic.c:265: error: check failed
runtests.log:	       in perform_merge
runtests.log:	       Should have been success (zero)
runtests.log:	   (-) FAILED
runtests.log:	       fileops/generic.c:271: error: check failed
runtests.log:	       in perform_merge
runtests.log:	       Should have been success (zero)
runtests.log:	
runtests.log:	                     4 tests run  2 checks failed
runtests.log:	
runtests.log:	
runtests.log:	======================== stic v0.6 :: fileops ========================
runtests.log:	
runtests.log:	                      2 CHECKS IN 1 TEST FAILED
runtests.log:	                      -------------------------
runtests.log:	      1860 checks :: 120 run tests :: 4 skipped tests :: 477 ms
runtests.log:	
runtests.log:	======================================================================

What I actually measured:

image

@xaizek
Copy link
Member

xaizek commented Jul 10, 2023

The test verifies that on copying first/nested1/nested2/file directory second/nested1/nested2 and file second/nested1/nested2/file are created and timestamps of both files match.

What version of musl (mine is 1.2.4) is that and does Alpine use coreutils? Surprisingly, it seems like the failure occurs on copy with cfg.use_system_calls == 0 in which case cp command is used. If that's busybox instead of GNU coreutils, that might be the reason.

@xaizek
Copy link
Member

xaizek commented Jul 10, 2023

Tried it in alpine:3.16.2: doing apk add coreutils fixes this test, so it's an issue with busybox. This leaves only versort failures, which are gone in alpine:latest that has the latest musl (1.2.4).

hholst80 added a commit to hholst80/void-packages that referenced this issue Jul 13, 2023
@hholst80
Copy link
Sponsor Author

TIL: an excellent way to share a .patch file on the GitHub platform - simply link the commit with a .patch suffix!

https://github.com/vifm/vifm/commit/c97f144231afbeb4215659d5c685fdf1e3fe5612.patch

@xaizek
Copy link
Member

xaizek commented Jul 24, 2023

Nice, but not applicable in this case because that commit doesn't apply without conflicts to v0.13 release.

@xaizek
Copy link
Member

xaizek commented Jul 27, 2023

I guess this issue can be closed as changes were committed. Thanks for the effort, too bad Void maintainers are like that...

@xaizek xaizek closed this as completed Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants