https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113005
--- Comment #11 from Lipeng Zhu <lipeng.zhu at intel dot com> --- (In reply to Jakub Jelinek from comment #10) >For what I can reproduce on my box (rwlock_1.exe built in the >x86_64-pc-linux-gnu/libgomp/testsuite subdirectory using the -O0 >compilation line from libgomp*/*.sep: >$ OMP_NUM_THREADS=4096 LD_LIBRARY_PATH=../.libs/ time ./rwlock_1.exe > > Error termination. Backtrace: > At line 17 of file > /home/jakub/src/gcc/libgomp/testsuite/libgomp.fortran/rwlock_1.f90 (unit = > 1180) > Fortran runtime error: Cannot open file '***_tst.dat': Too many open files > > > With OMP_NUM_THREADS=512 it works. I can reproduce the "Too many open files" error on my local. The error is caused by the limited open files setting. $ ulimit -n In existing rwlock test case, it will maintain a fd for each thread, with OMP_NUM_THREADS growing, it reached the system limitation. >Anyway: should these test cases be limiting themselves to some lower > 'OMP_NUM_THREADS', for example via 'num_threads' clauses? This proposal could avoid this kind of issue.