JianyuWang0623 opened a new pull request, #3849:
URL: https://github.com/apache/nuttx-apps/pull/3849
## Summary
- system/nxinit: use unsigned shifts for service flags
`SVC_REMOVE (1 << 31)` is UB. On sim with UBSan, the report's stack
trace printing crashes and nxinit boards SEGV at boot. Use `(1U << n)`
for all `SVC_*` flags.
- system/nxinit: add stdout and stderr service options
Redirect a service's stdout/stderr to a file, like nsh `cmd > file`,
behind `CONFIG_SYSTEM_NXINIT_SERVICE_REDIR` (default n). The console
option shares the same file actions and string helpers.
## Impact
No change with `SERVICE_REDIR=n` (default). Two new service options
when enabled.
## Testing
sim:nsh + `SYSTEM_NXINIT=y`, built with `SERVICE_REDIR=y` and `=n`, no
warnings. `checkpatch.sh` passes. On sim with UBSan, the boot SEGV is
gone. stdout/stderr redirection was verified with and without `console`.
--
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]