This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new c42da565e testing/nettest: Give cmocka_net_local_dgram a 16 KiB stack.
c42da565e is described below

commit c42da565ea5d31c6e22f005164ff217ece5d76bd
Author: Marco Casaroli <[email protected]>
AuthorDate: Thu Nov 26 04:42:25 2026 +0100

    testing/nettest: Give cmocka_net_local_dgram a 16 KiB stack.
    
    In a flat build, the socket calls and the signal handlers of the test
    use the stack of the test program.  On qemu-armv8a:nsh the test uses
    8144 to 8192 bytes of stack (measured with STACK_COLORATION).  The
    default stack of the nettest programs is DEFAULT_TASK_STACKSIZE, 8192
    bytes there, so the test has no margin: a small change in the kernel
    makes it fill its stack and crash.
    
    Add TESTING_NET_LOCAL_DGRAM_STACKSIZE, default 16384, for this program
    only.  The other nettest programs keep TESTING_NET_TEST_STACKSIZE.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 testing/nettest/CMakeLists.txt | 2 +-
 testing/nettest/Kconfig        | 9 +++++++++
 testing/nettest/Makefile       | 8 +++++++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/testing/nettest/CMakeLists.txt b/testing/nettest/CMakeLists.txt
index 15be1599d..6e87e7987 100644
--- a/testing/nettest/CMakeLists.txt
+++ b/testing/nettest/CMakeLists.txt
@@ -146,7 +146,7 @@ if(CONFIG_TESTING_NET_TEST)
       PRIORITY
       ${CONFIG_TESTING_NET_TEST_PRIORITY}
       STACKSIZE
-      ${CONFIG_TESTING_NET_TEST_STACKSIZE}
+      ${CONFIG_TESTING_NET_LOCAL_DGRAM_STACKSIZE}
       MODULE
       ${CONFIG_TESTING_NET_TEST}
       DEPENDS
diff --git a/testing/nettest/Kconfig b/testing/nettest/Kconfig
index 4c19e91d9..83caa7e85 100644
--- a/testing/nettest/Kconfig
+++ b/testing/nettest/Kconfig
@@ -74,6 +74,15 @@ config TESTING_NET_LOCAL_DGRAM
                names (default P_tmpdir).  The second is a cmocka filter, to run
                some of the cases.
 
+config TESTING_NET_LOCAL_DGRAM_STACKSIZE
+       int "Stack size of the cmocka net local datagram test"
+       default 16384
+       depends on TESTING_NET_LOCAL_DGRAM
+       ---help---
+               In a flat build, the socket calls and the signal handlers of
+               cmocka_net_local_dgram use this stack.  The test uses more than
+               8 KiB on qemu-armv8a:nsh.
+
 config TESTING_NET_OTHERS
        bool "Enable cmocka net other test"
        depends on BUILD_FLAT
diff --git a/testing/nettest/Makefile b/testing/nettest/Makefile
index a35a2d473..c95dc2bdb 100644
--- a/testing/nettest/Makefile
+++ b/testing/nettest/Makefile
@@ -23,7 +23,6 @@ include $(APPDIR)/Make.defs
 NETTEST_UTILS_DIR := $(APPDIR)/testing/nettest/utils
 
 PRIORITY  = $(CONFIG_TESTING_NET_TEST_PRIORITY)
-STACKSIZE = $(CONFIG_TESTING_NET_TEST_STACKSIZE)
 MODULE    = $(CONFIG_TESTING_NET_TEST)
 
 ifeq ($(CONFIG_TESTING_NET_TEST),y)
@@ -152,5 +151,12 @@ PROGNAME += cmocka_net_tun
 CSRCS    += tun/test_tun_tcp.c
 endif
 
+# One stack size per program: cmocka_net_local_dgram has its own
+
+STACKSIZE = $(foreach p,$(PROGNAME), \
+              $(if $(filter cmocka_net_local_dgram,$(p)), \
+                $(CONFIG_TESTING_NET_LOCAL_DGRAM_STACKSIZE), \
+                $(CONFIG_TESTING_NET_TEST_STACKSIZE)))
+
 endif
 include $(APPDIR)/Application.mk

Reply via email to