Hi Niels,
I ran into this bug when I deployed the library on ARM environment, have you got the chance to debug the issue? I also wonder if my design proposal fixes it properly.
best regards, Mamone
On Mon, Oct 5, 2026, 1:39 PM Niels Möller nisse@lysator.liu.se wrote:
Maamoun TK maamoun.tk@googlemail.com writes:
the variables were never initialized to zero.
Current code:
fat-arm64.c:
--> unsigned long hwcap = 0;
#if USE_GETAUXVAL hwcap = getauxval(AT_HWCAP); #elif defined(HAVE_ELF_AUX_INFO) elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)); #endif
fat-ppc.c:
--> unsigned long hwcap = 0; --> unsigned long hwcap2 = 0; # if USE_GETAUXVAL hwcap = getauxval(AT_HWCAP); hwcap2 = getauxval(AT_HWCAP2); # elif defined(HAVE_ELF_AUX_INFO) elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)); elf_aux_info(AT_HWCAP2, &hwcap2, sizeof(hwcap2)); # elif defined(__FreeBSD__) size_t len; len = sizeof(hwcap); sysctlbyname("hw.cpu_features", &hwcap, &len, NULL, 0); len = sizeof(hwcap2); sysctlbyname("hw.cpu_features2", &hwcap2, &len, NULL, 0);
So I think this should work, under the assumption that elf_aux_info and sysctlbyname don't clobber their output buffers on error. Am I missing something?
Regards, /Niels
-- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance.