-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nshlib/nsh_parse: Fix variable arguments concat error of nsh_execute()
#2850
nshlib/nsh_parse: Fix variable arguments concat error of nsh_execute()
#2850
Conversation
[Experimental Bot, please feedback here] Yes, this PR appears to meet the NuttX requirements, although some sections could be more explicit. Here's a breakdown of why and some suggestions for improvement: Strengths:
Areas for Improvement:
By addressing these points, the PR will be even stronger and easier for reviewers to assess. |
Without this patch nsh> set time 5 nsh> echo $time 5 nsh> sleep $time & sh [5:100] nsh> nsh: sleep: missing required argument(s) With this patch nsh> set time 5 nsh> echo $time 5 nsh> sleep $time & sh [4:100] nsh> ps PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND 0 0 0 FIFO Kthread - Ready 0000000000000000 0069616 Idle_Task 1 0 224 FIFO Kthread - Waiting Signal 0000000000000000 0067536 loop_task 2 0 224 FIFO Kthread - Waiting Semaphore 0000000000000000 0067504 hpwork 0x501760e0 0x50176128 3 3 100 FIFO Task - Running 0000000000000000 0067536 nsh_main 4 4 100 FIFO Task - Waiting Signal 0000000000000000 0067520 sh -c sleep Signed-off-by: buxiasen <buxiasen@xiaomi.com> Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
9b09e15
to
0d27789
Compare
As @jasonbu suggested, the defconfig who`s nsh_linelen is large (e.g. greater than 256 bytes) should be careful with stacksize
Mark apache/nuttx#2845. |
The large max command line length may cause stack overflow. Test ./tools/configure.sh lm3s6965-ek:qemu-flat make -j16 qemu-system-arm -semihosting \ -M lm3s6965evb \ -device loader,file=nuttx.bin,addr=0x00000000 \ -netdev user,id=user0 \ -serial mon:stdio -nographic Link: apache/nuttx-apps#2850 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
The large max command line length may cause stack overflow. Test ./tools/configure.sh lm3s6965-ek:qemu-flat make -j16 qemu-system-arm -semihosting \ -M lm3s6965evb \ -device loader,file=nuttx.bin,addr=0x00000000 \ -netdev user,id=user0 \ -serial mon:stdio -nographic Link: apache/nuttx-apps#2850 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
The large max command line length may cause stack overflow. Test ./tools/configure.sh lm3s6965-ek:qemu-flat make -j16 qemu-system-arm -semihosting \ -M lm3s6965evb \ -device loader,file=nuttx.bin,addr=0x00000000 \ -netdev user,id=user0 \ -serial mon:stdio -nographic Link: apache/nuttx-apps#2850 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
The large max command line length may cause stack overflow. Test ./tools/configure.sh lm3s6965-ek:qemu-flat make -j16 qemu-system-arm -semihosting \ -M lm3s6965evb \ -device loader,file=nuttx.bin,addr=0x00000000 \ -netdev user,id=user0 \ -serial mon:stdio -nographic Link: apache/nuttx-apps#2850 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
The large max command line length may cause stack overflow. Test ./tools/configure.sh lm3s6965-ek:qemu-flat make -j16 qemu-system-arm -semihosting \ -M lm3s6965evb \ -device loader,file=nuttx.bin,addr=0x00000000 \ -netdev user,id=user0 \ -serial mon:stdio -nographic Link: apache/nuttx-apps#2850 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
The large max command line length may cause stack overflow. Test ./tools/configure.sh lm3s6965-ek:qemu-flat make -j16 qemu-system-arm -semihosting \ -M lm3s6965evb \ -device loader,file=nuttx.bin,addr=0x00000000 \ -netdev user,id=user0 \ -serial mon:stdio -nographic Link: apache/nuttx-apps#2850 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Summary
Fix variable arguments concat error of
nsh_execute()
Without this patch
With this patch
Reported by yangao1@xiaomi.com, owned by @jasonbu, updated by @JianyuWang0623
Impact
nshlib/nsh_parse:nsh_execute()
Testing