It was discovered that setting LD_HWCAP_MASK to a large numeric value results in significant memory allocation in the dynamic linker and sometimes results in malloc failure, causing the program to crash. A simple test like this demonstrates the problem: LD_HWCAP_MASK=0xffffffffffffffff /bin/true On a system with constrained overcommit, this should fail with the following error: /bin/true: error while loading shared libraries: cannot create capability list: Cannot allocate memory or at least take a very long time to finish.
_dl_important_hwcaps wants to create all combinations of the unmasked hwcap strings. On x86_64 there are 28 hwcaps, computing those 2^28 combinations takes its time.
HJ's patch fixed that by setting dl_hwcap to 0 since x86 uses the cpu_features struct. So this is fixed by bug #21391. *** This bug has been marked as a duplicate of bug 21391 ***