As discussed in PR testsuite/125584, the gfortran.dg/coarray tests with
-lcaf_shmem require excessive amounts of backing store for their shared
memory images: for 64-bit tests, each test uses 4 GB images.

On Solaris, the mapped files reside in /tmp/.LIBRT/SHM, which is tmpfs.
During parallel testing, several such tests can run in parallel, leading
to excessive VM use, in particular on targets like Solaris that don't
use lazy allocation.  This is unacceptable since the testsuite defaults
need to be safe for all targets.

The tests PASS just fine when limiting GFORTRAN_SHARED_MEMORY_SIZE to 2M
instead.  To allow for testing with either the default or a different
size, setting GCC_TEST_RUN_EXPENSIVE to a non-empty string allows to
override this.

Tested on amd64-pc-solaris2.11 and x86_64-pc-linux-gnu.

Ok for trunk?

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2026-06-13  Rainer Orth  <[email protected]>

        gcc/testsuite:
        PR testsuite/125584
        * gfortran.dg/coarray/caf.exp: Default GFORTRAN_SHARED_MEMORY_SIZE
        to 2 MB unless running expensive tests.

# HG changeset patch
# Parent  63024c92cb804e7e2596abd3bee2b7539093a3c4
testsuite: Limit shared memory use of coarray tests [PR125584]

diff --git a/gcc/testsuite/gfortran.dg/coarray/caf.exp b/gcc/testsuite/gfortran.dg/coarray/caf.exp
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp
+++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp
@@ -82,6 +82,11 @@ if { [getenv GFORTRAN_NUM_IMAGES] == "" 
   setenv GFORTRAN_NUM_IMAGES 8
 }
 
+if { [getenv GCC_TEST_RUN_EXPENSIVE] == "" } {
+  # Lower caf_shmem shared memory block size to avoid excessive VM consumption.
+  setenv GFORTRAN_SHARED_MEMORY_SIZE 2M
+}
+
 # Main loop.
 foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] {
     # If we're only testing specific files and this isn't one of them, skip it.

Reply via email to