[PATCH] eal: add some debug for unit test failures

David Marchand david.marchand at redhat.com
Fri Oct 16 18:49:14 CEST 2026


Dirty patch to try to catch more info about a unit test failure seen in
ARM containers at UNH.

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 app/test/commands.c          | 4 +++-
 app/test/process.c           | 7 +++++++
 lib/eal/common/malloc_heap.c | 2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/app/test/commands.c b/app/test/commands.c
index 497d8e9952..5108295202 100644
--- a/app/test/commands.c
+++ b/app/test/commands.c
@@ -368,8 +368,10 @@ int commands_init(void)
 	}
 
 	commands = (char *)calloc(commands_len, sizeof(char));
-	if (!commands)
+	if (!commands) {
+		printf("commands_init: calloc(%d) failed %s\n", commands_len, strerror(errno));
 		return -1;
+	}
 
 	TAILQ_FOREACH(t, &commands_list, next) {
 		strlcat(commands, t->command, commands_len);
diff --git a/app/test/process.c b/app/test/process.c
index 92c8af702b..dc39d0ea7b 100644
--- a/app/test/process.c
+++ b/app/test/process.c
@@ -200,6 +200,13 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 	}
 #endif
 #endif
+	if (WIFEXITED(status))
+		printf("Child process exited with status %d\n", WEXITSTATUS(status));
+	else if (WIFSIGNALED(status))
+		printf("Child process killed by signal %d\n", WTERMSIG(status));
+	else
+		printf("Child process terminated with wait status %d\n", status);
+
 	return status;
 }
 
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index 39240c261c..6c6bcd3b29 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -657,6 +657,8 @@ malloc_heap_alloc_on_heap_id(size_t size, unsigned int heap_id, unsigned int fla
 	/* for legacy mode, try once and with all flags */
 	if (internal_conf->legacy_mem) {
 		ret = heap_alloc(heap, size, flags, align, bound, contig);
+		if (ret == NULL)
+			EAL_LOG(ERR, "Error allocating from heap in legacy mode");
 		goto alloc_unlock;
 	}
 
-- 
2.54.0



More information about the dev mailing list