From 6a3b0ede57aaa5fee879f8e3a02df93651705fa1 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 5 Aug 2026 23:43:00 +0200 Subject: [PATCH 1/3] Call xerbla on buffer overrun instead of returning a NULL handle --- driver/others/memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index a28edeaa63..70b2c9f17a 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -2765,7 +2765,7 @@ static int memory_overflowed = 0; void *blas_memory_alloc(int procpos){ int i; - + int buffer_fault = 999; int position; #if defined(WHEREAMI) && !defined(USE_OPENMP) int mypos = 0; @@ -3163,7 +3163,8 @@ void *blas_memory_alloc(int procpos){ printf("a sufficiently small number. This error typically occurs when the software that relies on\n"); printf("OpenBLAS calls BLAS functions from many threads in parallel, or when your computer has more\n"); printf("cpu cores than what OpenBLAS was configured to handle.\n"); - return NULL; + BLASFUNC(xerbla)("OpenBLAS",&buffer_fault,8); + return NULL; } void blas_memory_free(void *free_area){ From b3e01239d0b7035d0d4eca1cd8c687e6d8797b20 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 5 Aug 2026 23:50:55 +0200 Subject: [PATCH 2/3] Add special (terminating) info code 999 to the default xerbla --- driver/others/xerbla.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/driver/others/xerbla.c b/driver/others/xerbla.c index 8e2110c91d..645838b24a 100644 --- a/driver/others/xerbla.c +++ b/driver/others/xerbla.c @@ -65,7 +65,11 @@ static size_t openblas_xerbla_name_length(const char *message, static void openblas_xerbla_default(const char *message, const blasint *info, size_t length) { int precision = length > INT_MAX ? INT_MAX : (int)length; - + + if (*info == 999) { + printf(" ** OpenBLAS ran out of thread buffers - terminating\n"); + exit(1) + } printf(MSGFMT, precision, message == NULL ? "" : message, (long long)*info); } From bce0b00122c22d0896f0226f9252c91bb5f598a5 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 6 Aug 2026 08:31:46 +0200 Subject: [PATCH 3/3] typo --- driver/others/xerbla.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/others/xerbla.c b/driver/others/xerbla.c index 645838b24a..d28153338a 100644 --- a/driver/others/xerbla.c +++ b/driver/others/xerbla.c @@ -68,7 +68,7 @@ static void openblas_xerbla_default(const char *message, const blasint *info, if (*info == 999) { printf(" ** OpenBLAS ran out of thread buffers - terminating\n"); - exit(1) + exit(1); } printf(MSGFMT, precision, message == NULL ? "" : message, (long long)*info);