Running test-calloc-gnu and test-malloc-gnu on Solaris 10
(the cfarm210.cfarm.net machine) in 64-bit mode, I observe that
  - test-calloc-gnu prevents all other processes from progressing,
    and prevent ssh logins, for at least several minutes.
  - test-malloc-gnu likewise, for 43 seconds.

To fix this, one could move the expensive part to an "expensive" test.
Or just skip it:


2026-05-10  Bruno Haible  <[email protected]>

        calloc-gnu tests: Skip expensive part on Solaris.
        * tests/test-calloc-gnu.c (main): Don't attempt to allocate a huge block
        of memory on Solaris.
        * tests/test-malloc-gnu.c (main): Add a comment.

diff --git a/tests/test-calloc-gnu.c b/tests/test-calloc-gnu.c
index b7eb2ac56d..b8fb00c86f 100644
--- a/tests/test-calloc-gnu.c
+++ b/tests/test-calloc-gnu.c
@@ -42,6 +42,10 @@ main ()
 
   /* Check that calloc fails when requested to allocate a block of memory
      larger than PTRDIFF_MAX or SIZE_MAX bytes.  */
+  /* Running this test on a Solaris 10 machine (cfarm210.cfarm.net) makes
+     the machine unresponsive for at least several minutes, possibly
+     indefinitely.  */
+#if !defined __sun
   {
     for (size_t n = 2; n != 0; n <<= 1)
       {
@@ -54,6 +58,7 @@ main ()
         ASSERT (errno == ENOMEM);
       }
   }
+#endif
 
   return test_exit_status;
 }
diff --git a/tests/test-malloc-gnu.c b/tests/test-malloc-gnu.c
index 7b243ac462..38fe387cc4 100644
--- a/tests/test-malloc-gnu.c
+++ b/tests/test-malloc-gnu.c
@@ -39,6 +39,8 @@ main (int argc, _GL_UNUSED char **argv)
   free (p);
 
   /* Check that malloc (n) fails when n exceeds PTRDIFF_MAX.  */
+  /* Note: Running this test on a Solaris 10 machine (cfarm210.cfarm.net) makes
+     the machine unresponsive for 43 seconds.  */
   if (PTRDIFF_MAX < SIZE_MAX)
     {
       size_t one = argc != 12345;




Reply via email to