Repository navigation
Wapi simplify - #1
Merged
Merged
Conversation
Change-Id: I32caadfb658cf1920b5f2725b025bb383aee0752 Signed-off-by: chao.an <[email protected]>
Change-Id: Id34deab85a39c4a6afe3cec19be729ad44c7e77f Signed-off-by: chao.an <[email protected]>
yamt
added a commit
to yamt/incubator-nuttx-apps
that referenced
this pull request
May 7, 2021
For EINVAL, it doesn't make sense to keep parsing.
(For E2BIG, it might make some sense.)
Found by LLVM ASan.
```
=================================================================
==81622==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000f2 at pc 0x00010d2746ca bp 0x7ffee29a9980 sp 0x7ffee29a9978
READ of size 1 at 0x6020000000f2 thread T0
#0 0x10d2746c9 in netlib_parseurl netlib_parseurl.c:121
apache#1 0x10d26b293 in parseurl webclient.c:479
apache#2 0x10d265e48 in webclient_perform webclient.c:690
apache#3 0x10d277c5b in main main.c:210
apache#4 0x7fff7a06f3d4 in start+0x0 (libdyld.dylib:x86_64+0x163d4)
0x6020000000f2 is located 0 bytes to the right of 2-byte region [0x6020000000f0,0x6020000000f2)
allocated by thread T0 here:
#0 0x10d3996d3 in wrap_strdup+0x203 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x3e6d3)
apache#1 0x10d276abe in main main.c:147
apache#2 0x7fff7a06f3d4 in start+0x0 (libdyld.dylib:x86_64+0x163d4)
SUMMARY: AddressSanitizer: heap-buffer-overflow netlib_parseurl.c:121 in netlib_parseurl
Shadow bytes around the buggy address:
0x1c03ffffffc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c03ffffffd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c03ffffffe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c03fffffff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c0400000000: fa fa fd fd fa fa fd fd fa fa 00 00 fa fa 00 00
=>0x1c0400000010: fa fa 00 fa fa fa 00 00 fa fa 00 06 fa fa[02]fa
0x1c0400000020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==81622==ABORTING
```
xiaoxiang781216
pushed a commit
that referenced
this pull request
May 8, 2021
For EINVAL, it doesn't make sense to keep parsing.
(For E2BIG, it might make some sense.)
Found by LLVM ASan.
```
=================================================================
==81622==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000f2 at pc 0x00010d2746ca bp 0x7ffee29a9980 sp 0x7ffee29a9978
READ of size 1 at 0x6020000000f2 thread T0
#0 0x10d2746c9 in netlib_parseurl netlib_parseurl.c:121
#1 0x10d26b293 in parseurl webclient.c:479
#2 0x10d265e48 in webclient_perform webclient.c:690
#3 0x10d277c5b in main main.c:210
#4 0x7fff7a06f3d4 in start+0x0 (libdyld.dylib:x86_64+0x163d4)
0x6020000000f2 is located 0 bytes to the right of 2-byte region [0x6020000000f0,0x6020000000f2)
allocated by thread T0 here:
#0 0x10d3996d3 in wrap_strdup+0x203 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x3e6d3)
#1 0x10d276abe in main main.c:147
#2 0x7fff7a06f3d4 in start+0x0 (libdyld.dylib:x86_64+0x163d4)
SUMMARY: AddressSanitizer: heap-buffer-overflow netlib_parseurl.c:121 in netlib_parseurl
Shadow bytes around the buggy address:
0x1c03ffffffc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c03ffffffd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c03ffffffe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c03fffffff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1c0400000000: fa fa fd fd fa fa fd fd fa fa 00 00 fa fa 00 00
=>0x1c0400000010: fa fa 00 fa fa fa 00 00 fa fa 00 06 fa fa[02]fa
0x1c0400000020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x1c0400000060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==81622==ABORTING
```
Shunichi-K
referenced
this pull request
in SPRESENSE/nuttx-apps
Nov 7, 2022
Merge release-v2.0.0 into new-master for v2.0.0 release
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Sep 14, 2024
sed: -e expression apache#1, char 0: no previous regular expression Signed-off-by: wangjianyu3 <[email protected]>
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Sep 17, 2024
sed: -e expression apache#1, char 0: no previous regular expression Signed-off-by: wangjianyu3 <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Sep 18, 2024
sed: -e expression #1, char 0: no previous regular expression Signed-off-by: wangjianyu3 <[email protected]>
zyfeier
pushed a commit
to zyfeier/incubator-nuttx-apps
that referenced
this pull request
Sep 30, 2024
wdog.c:190:3: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long int'
#0 0x40e35d3a in wdog_test_run /home/cuiziwei/ska/vela/vela-dev2/apps/testing/ostest/wdog.c:190
apache#1 0x40e35e75 in wdog_test_thread /home/cuiziwei/ska/vela/vela-dev2/apps/testing/ostest/wdog.c:207
apache#2 0x40773ffa in pthread_startup pthread/pthread_create.c:59
apache#3 0x4495e037 in pthread_start pthread/pthread_create.c:139
apache#4 0x40301864 in pre_start sim/sim_initialstate.c:52
Signed-off-by: cuiziwei <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Oct 1, 2024
wdog.c:190:3: runtime error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long int'
#0 0x40e35d3a in wdog_test_run /home/cuiziwei/ska/vela/vela-dev2/apps/testing/ostest/wdog.c:190
#1 0x40e35e75 in wdog_test_thread /home/cuiziwei/ska/vela/vela-dev2/apps/testing/ostest/wdog.c:207
#2 0x40773ffa in pthread_startup pthread/pthread_create.c:59
#3 0x4495e037 in pthread_start pthread/pthread_create.c:139
#4 0x40301864 in pre_start sim/sim_initialstate.c:52
Signed-off-by: cuiziwei <[email protected]>
anchao
added a commit
to anchao/nuttx-apps
that referenced
this pull request
Nov 28, 2024
Applying patch to flatbuffers patching file '<' Hunk apache#1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 39. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 495. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 23. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patch: **** Can't reopen file '<' : No such file or directory -- Configuring done (12.8s) -- Generating done (0.3s) Signed-off-by: chao an <[email protected]>
anchao
added a commit
to anchao/nuttx-apps
that referenced
this pull request
Nov 28, 2024
Applying patch to flatbuffers patching file '<' Hunk apache#1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 39. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 495. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 23. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patch: **** Can't reopen file '<' : No such file or directory -- Configuring done (12.8s) -- Generating done (0.3s) Signed-off-by: chao an <[email protected]>
anchao
added a commit
to anchao/nuttx-apps
that referenced
this pull request
Nov 29, 2024
Applying patch to flatbuffers patching file '<' Hunk apache#1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 39. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 495. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 23. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patch: **** Can't reopen file '<' : No such file or directory -- Configuring done (12.8s) -- Generating done (0.3s) Signed-off-by: chao an <[email protected]>
anchao
added a commit
to anchao/nuttx-apps
that referenced
this pull request
Nov 30, 2024
Applying patch to flatbuffers patching file '<' Hunk apache#1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 39. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 495. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk apache#1 FAILED at 23. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patch: **** Can't reopen file '<' : No such file or directory -- Configuring done (12.8s) -- Generating done (0.3s) Signed-off-by: chao an <[email protected]>
anchao
added a commit
that referenced
this pull request
Dec 1, 2024
Applying patch to flatbuffers patching file '<' Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk #1 FAILED at 39. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk #1 FAILED at 495. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk #1 FAILED at 23. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patch: **** Can't reopen file '<' : No such file or directory -- Configuring done (12.8s) -- Generating done (0.3s) Signed-off-by: chao an <[email protected]>
Zhangshoukui
added a commit
to Zhangshoukui/nuttx-apps
that referenced
this pull request
Dec 17, 2024
…ter was read
#0 0x43c7443a in strnlen nuttx/libs/libc/string/lib_strnlen.c:42
apache#1 0x43c698aa in vsprintf_internal nuttx/libs/libc/stdio/lib_libvsprintf.c:933
apache#2 0x43c6ca80 in lib_vsprintf nuttx/libs/libc/stdio/lib_libvsprintf.c:1383
apache#3 0x4409c0bd in vsnprintf nuttx/libs/libc/stdio/lib_vsnprintf.c:72
apache#4 0x47137cd0 in vcmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2097
apache#5 0x47139573 in cmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2422
apache#6 0x471376ff in string_equal_display_error apps/testing/cmocka/cmocka/src/cmocka.c:1410
apache#7 0x471379a0 in _assert_string_equal apps/testing/cmocka/cmocka/src/cmocka.c:1952
apache#8 0x4433d972 in read_default apps/testing/drivertest/drivertest_uart.c:242
apache#9 0x4713c6cd in cmocka_run_one_test_or_fixture apps/testing/cmocka/cmocka/src/cmocka.c:3029
apache#10 0x4713d487 in cmocka_run_one_tests apps/testing/cmocka/cmocka/src/cmocka.c:3143
apache#11 0x4713f2ca in _cmocka_run_group_tests apps/testing/cmocka/cmocka/src/cmocka.c:3294
apache#12 0x443444c6 in cmocka_driver_uart_main apps/testing/drivertest/drivertest_uart.c:358
apache#13 0x4409a472 in nxtask_startup nuttx/libs/libc/sched/task_startup.c:72
apache#14 0x43dc92e7 in nxtask_start nuttx/sched/task/task_start.c:116
apache#15 0x43e31f00 in pre_start nuttx/arch/sim/src/sim/sim_initialstate.c:52
Signed-off-by: zhangshoukui <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Dec 17, 2024
…ter was read
#0 0x43c7443a in strnlen nuttx/libs/libc/string/lib_strnlen.c:42
#1 0x43c698aa in vsprintf_internal nuttx/libs/libc/stdio/lib_libvsprintf.c:933
#2 0x43c6ca80 in lib_vsprintf nuttx/libs/libc/stdio/lib_libvsprintf.c:1383
#3 0x4409c0bd in vsnprintf nuttx/libs/libc/stdio/lib_vsnprintf.c:72
#4 0x47137cd0 in vcmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2097
#5 0x47139573 in cmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2422
#6 0x471376ff in string_equal_display_error apps/testing/cmocka/cmocka/src/cmocka.c:1410
#7 0x471379a0 in _assert_string_equal apps/testing/cmocka/cmocka/src/cmocka.c:1952
#8 0x4433d972 in read_default apps/testing/drivertest/drivertest_uart.c:242
#9 0x4713c6cd in cmocka_run_one_test_or_fixture apps/testing/cmocka/cmocka/src/cmocka.c:3029
#10 0x4713d487 in cmocka_run_one_tests apps/testing/cmocka/cmocka/src/cmocka.c:3143
#11 0x4713f2ca in _cmocka_run_group_tests apps/testing/cmocka/cmocka/src/cmocka.c:3294
#12 0x443444c6 in cmocka_driver_uart_main apps/testing/drivertest/drivertest_uart.c:358
#13 0x4409a472 in nxtask_startup nuttx/libs/libc/sched/task_startup.c:72
#14 0x43dc92e7 in nxtask_start nuttx/sched/task/task_start.c:116
#15 0x43e31f00 in pre_start nuttx/arch/sim/src/sim/sim_initialstate.c:52
Signed-off-by: zhangshoukui <[email protected]>
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Dec 18, 2024
Coverity Log CID 1612743: (apache#1 of 1): Resource leak (RESOURCE_LEAK) 12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle. Signed-off-by: wangjianyu3 <[email protected]>
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Dec 18, 2024
Coverity Log CID 1612757: (apache#1 of 1): UNUSED_VALUE assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used. Signed-off-by: wangjianyu3 <[email protected]>
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Dec 18, 2024
Coverity Log CID 1612743: (apache#1 of 1): Resource leak (RESOURCE_LEAK) 12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle. Signed-off-by: wangjianyu3 <[email protected]>
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Dec 18, 2024
Coverity Log CID 1612757: (apache#1 of 1): UNUSED_VALUE assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used. Signed-off-by: wangjianyu3 <[email protected]>
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Dec 19, 2024
Coverity Log CID 1612743: (apache#1 of 1): Resource leak (RESOURCE_LEAK) 12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle. Signed-off-by: wangjianyu3 <[email protected]>
JianyuWang0623
added a commit
to JianyuWang0623/nuttx-apps
that referenced
this pull request
Dec 19, 2024
Coverity Log CID 1612757: (apache#1 of 1): UNUSED_VALUE assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used. Signed-off-by: wangjianyu3 <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Dec 19, 2024
Coverity Log CID 1612743: (#1 of 1): Resource leak (RESOURCE_LEAK) 12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle. Signed-off-by: wangjianyu3 <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Dec 19, 2024
Coverity Log CID 1612757: (#1 of 1): UNUSED_VALUE assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used. Signed-off-by: wangjianyu3 <[email protected]>
Zhangshoukui
added a commit
to Zhangshoukui/nuttx-apps
that referenced
this pull request
Jan 15, 2025
…int to a stack space
==1805058==ERROR: AddressSanitizer: heap-use-after-free on address 0xe18126a0 at pc 0x52b06320 bp 0xd7b13ee8 sp 0xd7b13ed8
READ of size 1 at 0xe18126a0 thread T0
#0 0x52b0631f in tre_parse regex/regcomp.c:1356
apache#1 0x52b2b1d0 in regcomp regex/regcomp.c:3710
apache#2 0x48f55435 in c_regexmatch cmocka/src/cmocka.c:494
apache#3 0x48f65bcf in _cmocka_run_group_tests cmocka/src/cmocka.c:3252
apache#4 0x48f67e2d in cmocka_fs_test_main apps/testing/testsuites/kernel/fs/cmocka_fs_test.c:201
apache#5 0x46210b2a in nxtask_startup sched/task_startup.c:72
apache#6 0x45ff40fb in nxtask_start task/task_start.c:116
apache#7 0x462695bb in pre_start sim/sim_initialstate.c:52
Signed-off-by: zhangshoukui <[email protected]>
Zhangshoukui
added a commit
to Zhangshoukui/nuttx-apps
that referenced
this pull request
Jan 15, 2025
…int to a stack space
==1805058==ERROR: AddressSanitizer: heap-use-after-free on address 0xe18126a0 at pc 0x52b06320 bp 0xd7b13ee8 sp 0xd7b13ed8
READ of size 1 at 0xe18126a0 thread T0
#0 0x52b0631f in tre_parse regex/regcomp.c:1356
apache#1 0x52b2b1d0 in regcomp regex/regcomp.c:3710
apache#2 0x48f55435 in c_regexmatch cmocka/src/cmocka.c:494
apache#3 0x48f65bcf in _cmocka_run_group_tests cmocka/src/cmocka.c:3252
apache#4 0x48f67e2d in cmocka_fs_test_main apps/testing/testsuites/kernel/fs/cmocka_fs_test.c:201
apache#5 0x46210b2a in nxtask_startup sched/task_startup.c:72
apache#6 0x45ff40fb in nxtask_start task/task_start.c:116
apache#7 0x462695bb in pre_start sim/sim_initialstate.c:52
Signed-off-by: zhangshoukui <[email protected]>
Zhangshoukui
added a commit
to Zhangshoukui/nuttx-apps
that referenced
this pull request
Jan 16, 2025
…int to a stack space
==1805058==ERROR: AddressSanitizer: heap-use-after-free on address 0xe18126a0 at pc 0x52b06320 bp 0xd7b13ee8 sp 0xd7b13ed8
READ of size 1 at 0xe18126a0 thread T0
#0 0x52b0631f in tre_parse regex/regcomp.c:1356
apache#1 0x52b2b1d0 in regcomp regex/regcomp.c:3710
apache#2 0x48f55435 in c_regexmatch cmocka/src/cmocka.c:494
apache#3 0x48f65bcf in _cmocka_run_group_tests cmocka/src/cmocka.c:3252
apache#4 0x48f67e2d in cmocka_fs_test_main apps/testing/testsuites/kernel/fs/cmocka_fs_test.c:201
apache#5 0x46210b2a in nxtask_startup sched/task_startup.c:72
apache#6 0x45ff40fb in nxtask_start task/task_start.c:116
apache#7 0x462695bb in pre_start sim/sim_initialstate.c:52
Signed-off-by: zhangshoukui <[email protected]>
xiaoxiang781216
pushed a commit
that referenced
this pull request
Jan 16, 2025
…int to a stack space
==1805058==ERROR: AddressSanitizer: heap-use-after-free on address 0xe18126a0 at pc 0x52b06320 bp 0xd7b13ee8 sp 0xd7b13ed8
READ of size 1 at 0xe18126a0 thread T0
#0 0x52b0631f in tre_parse regex/regcomp.c:1356
#1 0x52b2b1d0 in regcomp regex/regcomp.c:3710
#2 0x48f55435 in c_regexmatch cmocka/src/cmocka.c:494
#3 0x48f65bcf in _cmocka_run_group_tests cmocka/src/cmocka.c:3252
#4 0x48f67e2d in cmocka_fs_test_main apps/testing/testsuites/kernel/fs/cmocka_fs_test.c:201
#5 0x46210b2a in nxtask_startup sched/task_startup.c:72
#6 0x45ff40fb in nxtask_start task/task_start.c:116
#7 0x462695bb in pre_start sim/sim_initialstate.c:52
Signed-off-by: zhangshoukui <[email protected]>
1 task done
1 task done
huanwei
added a commit
to huanwei/nuttx-apps
that referenced
this pull request
Oct 4, 2026
修 §三·补二十一 的第 3 条限制:"重载无事务性 —— 先 kill 再 start,
中间存在一个该容器不在运行的窗口"。那段时间该 CG **无人服务**,
容器越多、启动越慢,窗口越长。
新的顺序(replace_cg()):
1. 用新规格起一个新实例,**旧的继续服务**
2. 等它跑完启动窗口
3. 期间它若死掉 → **回滚**,旧的照常跑,本次变更不采纳
4. 撑过窗口 → 撤下旧的(优雅停止),采纳新规格
"证明活着"复用既有的启动窗口,因为它是**监督者单方面可判定**的,
不需要容器上报 ready —— 与文件头那条设计一致(不信任失效组件)。
★ 写的时候差点交了半个回滚:失败分支原本只写了个 `continue`,
但下面那句 `memcpy(g_cgs, scratch, ...)` 是**按位置整体覆盖**的,
scratch[k] 里装的还是新规格 —— 于是"回滚"照样会把变更应用下去。
必须把 live 的原样显式写回 scratch[k]。
(回滚路径最容易只写一半,因为正常路径测不到它。)
★ 存活性探测用 kill(pid, 0) 而不是排空事件队列:
后者会把**其它 CG** 的事件也吞掉,破坏主循环"逐条独立、按序消费"
的前提。kill(pid,0) 无副作用(nxsched_get_tcb != NULL)。
实测(qemu-armv7a:knsh,运行中改 safety_cg 的 max_restarts):
[ortsup] 配置变更: safety_cg 的声明变了(pid=6)
[ortsup] BOOT: 启动 safety_cg (domain 2, pid=7, 关键, maxRestarts=1)
[ortsup] 新实例 pid=7 已起,旧实例 pid=6 继续服务,等启动窗口 1500 ms
[ortsup] 容器(domain 2): 正常工作中,8 秒后注入故障 ← 旧实例还在数它的 8 秒
[ortsup] 容器(domain 1): 越界写 0xdeadbe00 ← 窗口期内别的 CG 照常被处理
[ortsup] ← 故障事件 apache#1 victim=5 faults=1
[ortsup] ✓ 新实例 pid=7 已过启动窗口(1500 ms) → 撤下旧实例 pid=6
[ortsup] 容器(domain 2): 故障注入前收到停止请求,干净退出
★ 必须记下的副作用(MPU 平台):重叠期内新旧两个实例**绑在同一个域**上。
ORT-A 上域只是标签,无所谓;**ORT-M 上域就是内存块**,
两个实例会共享同一块内存。单实例更新下这通常可接受(同一份程序、
同一套数据结构),但一旦容器有写状态,就必须给新实例分配影子域
(真正的 blue/green)—— 那是设计变更,不是这一行能补的。
⚠️ 回滚分支**已实现但未端到端验证**:需要在启动窗口内死掉的新实例,
而原型里容器的故障注入延时(3s/8s)比窗口(1.5s)长。
要让新实例死在窗口内,得先重载一次把 startup_timeout_ms 调大 ——
两步测试在原型里做得出来,但本轮上下文不够了,如实记为未验证。
Co-Authored-By: Claude Opus 4.8 <[email protected]>
huanwei
added a commit
to huanwei/nuttx-apps
that referenced
this pull request
Oct 4, 2026
§三·补二十四 末尾记的第 1 条限制("声明可信度无法验证")落地。 两条判据,都是**监督者从外部可观测**的,不需要相信容器: ① 撤下它时是否走了 SIGKILL 兜底 → 证伪「SIGTERM 有界退出」 ② 健康运行超过启动窗口、该域**从来没发布过** → 证伪「周期性发布」 任一为真 → 锁存为"声明不可信" → 后续替换降级为冷替换,并明示。 ★ 踩到并修掉的三个坑(都在"看起来正常"那一族): 1. **假阳性**:判据②第一版用"当前槽是空的",于是容器一故障 (内核作废槽)而监督者还没消费到事件时,就误判成"没实现发布"。 改用**累计**发布次数后,"从来没发布过"不受作废影响。 (内核侧的配套改动见 nuttx f7d7816。) 2. **没测试装置就走不到那条路**:原型里所有容器都是 ortsup 自己, 而 ortsup 真实现了 protocol v1 —— 证伪路径永远走不到, 而没被走到的那条路看起来和走对了没有区别。 加了两个**只给测试用**的段名前缀(raw_ / stuck_), 让容器故意不发布 / 忽略 SIGTERM。正式实现不需要它们: manifest 会指定镜像,第三方镜像天然就是那个来源。 3. **承诺了却没做**:`replace_cg` 里读的是新规格的 protocol_falsified, 而解析器刚 memset 出来的是 0 —— 于是"后果"那行打印了降级, 实际又走了热替换。另外 replace_cg 自己产生的结论(stop_cg 里的 SIGKILL 兜底)会被最后那句 memcpy 盖掉。 修法:换之前搬一次,memcpy 之前再**锁存**兜一次。 实证:stuck_cg 在变更 apache#1 被证伪,变更 apache#2 当场改走冷替换。 验证(两个 SKU 各两轮): · 符合协议的容器 **0 次误报**,标准场景结果不变 · raw_cg 判据②、stuck_cg 判据① 各自独立触发 · 降级真的发生(第二次变更走冷替换),且跨 reload 锁存
huanwei
added a commit
to huanwei/nuttx-apps
that referenced
this pull request
Oct 5, 2026
- 容器侧:`exit0_` 前缀 → 准入之后、故障注入之前主动 _exit(0) (位置在准入之后很要紧:未绑域的组不该上报 —— 内核钩子会正确跳过) - 监督者侧:drain 按 kind 分型 —— EXIT 与 FAULT 同走 seq 连续性审计, 但不进故障路径(不触发重启计数、不改 CG 状态) - 实测(qemu-armv7a):退出事件 apache#1 victim=9 code=0 到达; 标准场景 SUPERVISOR RESULT 与基线逐字相同(故障容器 EXIT 抑制生效)
bryfur
added a commit
to bryfur/nuttx-apps
that referenced
this pull request
Oct 17, 2026
…ds, sbfx, (float)(int)f in the FPU - A float constant (loaded from memory at each use) or an integer one that is not an immediate of its instruction gets a register before the innermost loop using it (up to 6); addresses of globals also move out of loops with loops in them (2 at most). - t = x << / >> n; d = y OP t -> OP d, y, x, lsl / lsr / asr #n (add, sub, and, orr, eor); -(x & 1) -> sbfx #0, apache#1; (float)(int)f -> two vcvt through s15 (no core register). - tests/opt.c: t_shift. bench in qemu: k_float 2.70 -> 1.30 M instructions (gcc -O2 1.30), k_crc 1.47 -> 0.95 M (0.76). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WMPiLBrtojyC9zqf7r52XZ
bryfur
added a commit
to bryfur/nuttx-apps
that referenced
this pull request
Oct 17, 2026
An address stepped by -255..255 right before a load or store of it is the access pre-indexed (ldrb r, [p, apache#1]!), the step not emitted. CoreMark in qemu: 7.13 M -> 7.04 M instructions (the state machine's next character). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WMPiLBrtojyC9zqf7r52XZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.