mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-01 19:36:36 +00:00
Add a regression test for apache/nuttx#20166 to the configdata example, which runs automatically in every sim:configdata build. After the normal configdata test loops, close the long-lived descriptor and run a full lifetime cycle on /dev/config: - mtdconfig_unregister() must succeed, - the unregistered device must no longer be openable (ENOENT), - the same MTD device must be registerable again and usable, - a final unregister must succeed, leaving the device unregistered. Before the driver fix this crashes deterministically: the old mtdconfig_unregister_by_path() freed the private device structure before closing its temporary file, so the subsequent open() faults in mm_malloc on the corrupted heap (SIGSEGV observed on sim right after unregister returns). With the fix the whole example, 934706/934706 checks included, completes cleanly. The test uses only generic configdata APIs, so it also passes unchanged under CONFIG_MTD_CONFIG_NVS, whose open/close callbacks are no-ops. Assisted-by: Claude:claude-opus Signed-off-by: Arnav Sharma <2006arnavsharma@gmail.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| configdata_main.c | ||
| Kconfig | ||
| Make.defs | ||
| Makefile | ||