Lack of check for AVX2 support => core dump in containers
Hi,
At compile-time, everything is done to handle varied levels of vector-instruction support (SSE,AVX,...), which is good.
But once a binary is produced and frozen into a Docker image, like docker.io/oaisoftwarealliance/oai-gnb
, the target machine has better support the proper instruction set, otherwise that's an Illegal Instruction, meaning (at best) a core dump or (at worst) no further explanation.
So, it would be great to add a run-time check with a clear error message when the binary is run on the wrong CPU, as may happen in containerized scenarios.
Below is a typical example, with instruction 'vpxor' (from AVX2), unsupported on my CPU:
oai-du | Illegal instruction (core dumped)
Dump of assembler code for function _GLOBAL__sub_I_gtp_itf.cpp(void):
Address range 0x55998d01bb40 to 0x55998d01bc18:
0x000055998d01bb40 <+0>: endbr64
0x000055998d01bb44 <+4>: push %r12
=> 0x000055998d01bb46 <+6>: vpxor %xmm0,%xmm0,%xmm0
0x000055998d01bb4a <+10>: mov $0x4,%esi
0x000055998d01bb4f <+15>: push %rbp