maxikrie commented on issue #11463: URL: https://github.com/apache/nuttx/issues/11463#issuecomment-6429250029
@acassis I found the cause: it's a stack overflow of the task running NSH, not an H7 bug. With `CONFIG_INIT_ENTRYPOINT="nsh_main"` NSH runs as the init task, so its stack is `CONFIG_INIT_STACKSIZE` (2048), not `CONFIG_SYSTEM_NSH_STACKSIZE`. The H7 Nucleo `nsh` configs set `CONFIG_DEBUG_SYMBOLS=y`, which makes `-O0` (`DEBUG_NOOPT`) the default optimization, and at `-O0` `ps` needs more than 2048 bytes. Measured on a NUCLEO-H753ZI, master b9d1d6a834, `nucleo-h753zi:nsh` + `FS_PROCFS`, `STACK_COLORATION`, `DEBUG_ASSERTIONS`, 200 × `ps`: | build | result | NSH stack used (ps) | |---|---|---| | defconfig (-O0), INIT_STACKSIZE 2048 | first `ps` crashes: `sp_out_of_range: ERROR: Stack pointer 38000ed8 is not within the stack`, fault in `nxsig_pendingset()` | — | | -O0, INIT_STACKSIZE 4096 | 200/200 ok | 2324 bytes | | -Os (`DEBUG_FULLOPT`), INIT_STACKSIZE 2048 | 200/200 ok | 1744 bytes (87 %) | | nRF52840-DK `nrf52840-dk:nsh` (-Os), 2048 | 50/50 ok | 1440 bytes | So that's why `INIT_STACKSIZE=4096` fixed it for me (and a bigger NSH stack for tmedicci on the ESP32-S2), and why other boards (optimized builds) don't show it. Should the H7 `nsh` configs get a bigger `CONFIG_INIT_STACKSIZE` (or drop `DEBUG_SYMBOLS`)? Otherwise I'd close this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
