casaroli opened a new pull request, #20528: URL: https://github.com/apache/nuttx/pull/20528
## Summary `pgalloc()` grows a process heap for `sbrk()`. It extended the address environment of the running task (`addrenv_own`). During `exec()` the caller selects the address environment of the new process and allocates the new process's stack from its heap. When that stack does not fit in the initial heap, the heap must grow, but the running task is the caller. For the kernel thread that starts init, this was an assertion (`arm64_pgalloc.c:103`); for a user task it would grow the caller's heap. `pgalloc()` now extends the selected address environment (`addrenv_curr`). For a normal `sbrk()` call it is the same as `addrenv_own`. The change is the same for arm64, RISC-V and armv7-a. ## Impact Kernel builds (`CONFIG_ARCH_ADDRENV`). No change for a normal `sbrk()`. ## Testing `qemu-armv8a:knsh` in QEMU 11 with `CONFIG_TLS_LOG2_MAXSTACK=18`, so that the stack of init does not fit in its initial heap. Before the change the boot stopped with `Assertion failed : at file: common/arm64_pgalloc.c:103 task: AppBringUp`. After it, NSH starts and ostest exits with status 0. RISC-V and armv7-a: build tests only (`rv-virt:knsh`, `qemu-armv7a:knsh`). -- 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]
