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

Codec detection doesn’t work in test_base64 on musl libc #124

Open
jirutka opened this issue Nov 19, 2023 · 2 comments
Open

Codec detection doesn’t work in test_base64 on musl libc #124

jirutka opened this issue Nov 19, 2023 · 2 comments

Comments

@jirutka
Copy link

jirutka commented Nov 19, 2023

When I build v0.5.1 using cmake on Alpine Linux x86_64 (running in a VM), the tests (not just benchmark) fail on illegal instruction. However, the base64 utility works fine, so it seems that the detection is broken only in the tests? When I disable all AVX (-DBASE64_WITH_AVX512=OFF, -DBASE64_WITH_AVX2=OFF, -DBASE64_WITH_AVX=OFF), the tests pass.

I read related issues (#77, #95), but these are just about the benchmarks, not the tests.

./build/bin/test_base64
Codec AVX2:
The process was killed by SIGILL: Illegal instruction
strace ./build/bin/test_base64
execve("./build/bin/test_base64", ["./build/bin/test_base64"], 0x7fff8f113da0 /* 19 vars */) = 0
arch_prctl(ARCH_SET_FS, 0x7f07fcfafb08) = 0
set_tid_address(0x7f07fcfaff70)         = 16075
brk(NULL)                               = 0x55e997446000
brk(0x55e997448000)                     = 0x55e997448000
mmap(0x55e997446000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x55e997446000
open("build/bin/libbase64.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFREG|0755, st_size=84016, ...}) = 0
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 960) = 960
mmap(NULL, 86016, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f07fcef9000
mmap(0x7f07fcefa000, 57344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x7f07fcefa000
mmap(0x7f07fcf08000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0xf000) = 0x7f07fcf08000
mmap(0x7f07fcf0c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12000) = 0x7f07fcf0c000
close(3)                                = 0
mprotect(0x7f07fcf0c000, 4096, PROT_READ) = 0
mprotect(0x7f07fcfac000, 4096, PROT_READ) = 0
mprotect(0x55e996638000, 4096, PROT_READ) = 0
ioctl(1, TIOCGWINSZ, {ws_row=77, ws_col=189, ws_xpixel=1701, ws_ypixel=1386}) = 0
writev(1, [{iov_base="Codec AVX2", iov_len=10}, {iov_base=":\n", iov_len=2}], 2Codec AVX2:
) = 12
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPN, si_addr=0x7f07fcf06c48} ---
+++ killed by SIGILL +++
The process was killed by SIGILL: Illegal instruction
@aklomp
Copy link
Owner

aklomp commented Nov 20, 2023

Does the VM support AVX2 instructions?

Runtime detection is done through CPU flags. Maybe the VM sets the CPU flags incorrectly for some reason?

@aklomp
Copy link
Owner

aklomp commented Nov 20, 2023

CI passes for the latest release for Alpine AMD64.

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