You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jerpelea (via GitHub)" <gi...@apache.org> on 2024/07/24 07:42:09 UTC
[PR] {bp-12717} arch/riscv: fix trap sp restore logic [nuttx]
jerpelea opened a new pull request, #12757:
URL: https://github.com/apache/nuttx/pull/12757
## Summary
Summary
This amends pull https://github.com/apache/nuttx/pull/12435 and attempts to fix issue https://github.com/apache/nuttx/issues/12635 of PROTECTED build vfork failure since commit https://github.com/apache/nuttx/commit/e6973c764cd5314aa4d6ccfadaebdd715f2dd709.
Investigation revealed two separate issues:
The optimized dispatch_syscall now requires TP to be prepared, which normally isn't a problem. But for the very first run of the forked child, it was zero. So we need prepare it for the forked child specially before its first run.
When returning from exception, the SP restored from stack normally works, As forked child stack is copied from parent, thus restored SP from child stack actually points to the parent stack area! So if child executes ealier that parent reaches the waitpid, parent will crash later due to corrupted stack. Unfortunately this is true with PROTECTED build now.
Impacts
riscv devices
Testing
Local checks with canmv230:pnsh for issue
https://github.com/apache/nuttx/issues/12635 verification
Local checks with following configs for regression
canmv230: nsh, nsbi
rv-virt: nsh, flats, knsh32, smp, ksmp
CI checks
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] {bp-12717} arch/riscv: fix trap sp restore logic [nuttx]
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko merged PR #12757:
URL: https://github.com/apache/nuttx/pull/12757
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org