Description
OpenBLAS hanged when testing multithreaded affinity.
Enviroment: ARMV8 CentOS 7.6, OpenBLAS-0.3.7
Compile cmd: make TARGET=ARMV8 CC=gcc FC=gfortran DEBUG=1 NO_AFFINITY=0 -j96
Execute cmd: export OMP_NUM_THREADS=32 && ./dgemm.goto 6000 6000
The problem can be reproduced by simulating an abnormal situation. During the region of code manually stopping the process, OpenBLAS-0.3.7/driver/others/init.c
First exit abnormally before blas_unlock(&common -> lock) , the value of common->lock is 1. This shared memory already exist,common->lock=1 and common->magic=SH_MAGIC,function blas_lock entering infinite loop in next time, the programme will be hanged.
If the problem happened, it makes openblas unavailable.
I provide a patch file, checking the value of common->lock first.
0001-hang-multithread-affinity.patch.txt