casaroli opened a new pull request, #4060: URL: https://github.com/apache/nuttx-apps/pull/4060
depends-on: apache/nuttx/pull/21898 ## Summary Add `testing/sched/spawnattr`, a test of a spawn attribute that the kernel refuses after it made the new task. `posix_spawn()` with `POSIX_SPAWN_SETSCHEDPARAM` and priority 0 must return `EINVAL`. The test does it 100 times and checks that the heap of the caller stays intact: a pattern in new blocks after each error, and `mallinfo()` before and after. Then a normal `posix_spawn()` must work. The child is the test program again. A kernel build crashed in this error path of `exec_module()`; apache/nuttx#21898 fixes it. ## Impact A new test program, default n. Its Kconfig option depends on `LIBC_EXECFUNCS` and `SCHED_WAITPID`. No other app changes. ## Testing | Configuration | nuttx master | nuttx with #21898 | |---|---|---| | qemu-armv8a:knsh (kernel, QEMU with HVF), test compiled against the export | `Assertion failed : at file: mm_heap/mm_malloc_size.c:73` at the first `posix_spawn()`, then a kernel panic | 4 of 4 PASS (100 times `EINVAL`, pattern intact, `mallinfo()` the same, the good `posix_spawn()` exits with 7) | | qemu-armv8a:nsh (flat, Make build) | 3 PASS, `mallinfo` FAIL (see below) | the same: #21898 does not change the flat build | ostest exits with status 0 on qemu-armv8a:knsh and qemu-armv8a:nsh with #21898. TBD (Marco): in the flat build the heap grows by about 30 bytes for each failed `posix_spawn()` (608 bytes for 20, and 32 bytes for 20 good ones). The child status that `nxtask_setup_scheduler()` adds to the parent with `CONFIG_SCHED_CHILD_STATUS` is not removed by `nxtask_uninit()`. This is a separate bug. `tools/checkpatch.sh -c -u -m -g` of nuttx passes on the commit. -- 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]
