Hello, Recently we saw the following commit get merged:
commit 758e88672b703bcb0d1251ae9731b2ec295e81c0 Author: Gregory Nutt <gn...@nuttx.org> Date: Fri Mar 31 16:25:45 2023 -0600 Assert if a thread attempts to post a semaphore incorrectly. Assert in nxsem_post if: - Priority inheritance is enabled on a semaphore - A thread that does not hold the semaphore attempts to post it This will detect an error condition described in https://cwiki.apache.org/confluence/display/NUTTX/Signaling+Semaphores+and+Priority+Inheritance None. The debug instrumentation is only enabled if CONFIG_DEBUG_ASSERTIONS is enabled. Use sim:ostest. Verify that no assertions occur. This makes os_test fail quickly. In fact, almost all of our internal tests fail. I understand that the commit is NOT the root cause, rather it indicates an existing issue. That's why I am posting here. Here is the error output (running on sim): [04/04/23 17:41:59] [ 7] [ EMERG] kasan_report: kasan detected a read access error, address at 0x7fea58e44ea8, size is 8 [04/04/23 17:41:59] [ 7] [ EMERG] _assert: Current Version: NuttX 10.4.0 758e88672b Apr 4 2023 20:41:42 sim [04/04/23 17:41:59] [ 7] [ EMERG] _assert: Assertion failed panic: at file: kasan/kasan.c:114 task: ostest 0x4674fd I am also attaching the full output. I guess my defconfig uses options that are not enabled in CI tests? I am attaching my defconfig too. It's impossible for me to track this down today. Maybe I will spend some time on Friday. But I think it indicates a critical problem, in case anyone has the time to check on this.
stdio_test: write fd=1 stdio_test: Standard I/O Check: printf stdio_test: write fd=2 stdio_test: Standard I/O Check: fprintf to stderr ostest_main: putenv(Variable1=BadValue3) ostest_main: setenv(Variable1, GoodValue1, TRUE) ostest_main: setenv(Variable2, BadValue1, FALSE) ostest_main: setenv(Variable2, GoodValue2, TRUE) ostest_main: setenv(Variable3, GoodValue3, FALSE) ostest_main: setenv(Variable3, BadValue2, FALSE) show_variable: Variable=Variable1 has value=GoodValue1 show_variable: Variable=Variable2 has value=GoodValue2 show_variable: Variable=Variable3 has value=GoodValue3 ostest_main: Started user_main at PID=7 user_main: Begin argument test user_main: Started with argc=5 user_main: argv[0]="ostest" user_main: argv[1]="Arg1" user_main: argv[2]="Arg2" user_main: argv[3]="Arg3" user_main: argv[4]="Arg4" End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 3effd50 3effd50 ordblks 2 2 mxordblk 3e62640 3e62640 uordblks 8cfe0 8cfe0 fordblks 3e72d70 3e72d70 user_main: getopt() test getopt(): Simple test getopt(): Invalid argument getopt(): Missing optional argument getopt_long(): Simple test getopt_long(): No short options getopt_long(): Argument for --option=argument getopt_long(): Invalid long option getopt_long(): Mixed long and short options getopt_long(): Invalid short option getopt_long(): Missing optional arguments getopt_long_only(): Mixed long and short options getopt_long_only(): Single hyphen long options End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 3effd50 3effd50 ordblks 2 2 mxordblk 3e62640 3e62640 uordblks 8cfe0 8cfe0 fordblks 3e72d70 3e72d70 show_variable: Variable=Variable1 has value=GoodValue1 show_variable: Variable=Variable2 has value=GoodValue2 show_variable: Variable=Variable3 has value=GoodValue3 show_variable: Variable=Variable1 has no value show_variable: Variable=Variable2 has value=GoodValue2 show_variable: Variable=Variable3 has value=GoodValue3 End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 3effd50 3effd50 ordblks 2 3 mxordblk 3e62640 3e62640 uordblks 8cfe0 8cfc0 fordblks 3e72d70 3e72d90 show_variable: Variable=Variable1 has no value show_variable: Variable=Variable2 has no value show_variable: Variable=Variable3 has no value End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 3effd50 3effd50 ordblks 3 3 mxordblk 3e62640 3e62640 uordblks 8cfc0 8cf30 fordblks 3e72d90 3e72e20 tls: Successfully set 0 tls: Successfully set ffffffff tls: Successfully set 55555555 tls: Successfully set aaaaaaaa End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 3effd50 3effd50 ordblks 3 3 mxordblk 3e62640 3e62640 uordblks 8cf30 8cf30 fordblks 3e72e20 3e72e20 user_main: /dev/null test dev_null: Read 0 bytes from /dev/null dev_null: Wrote 1024 bytes to /dev/null End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 3effd50 3effd50 ordblks 3 3 mxordblk 3e62640 3e62640 uordblks 8cf30 8cf30 fordblks 3e72e20 3e72e20 user_main: task_restart test Test task_restart() restart_main: setenv(VarName, VarValue, TRUE) restart_main: Started restart_main at PID=13 restart_main: Started with argc=4 restart_main: argv[0]="ostest" restart_main: argv[1]="This is argument 1" restart_main: argv[2]="Argument 2 here" restart_main: argv[3]="Lastly, the 3rd argument" restart_main: Variable=VarName has value=VarValue restart_main: I am still here restart_main: I am still here restart_main: Started restart_main at PID=13 restart_main: Started with argc=4 restart_main: argv[0]="ostest" restart_main: argv[1]="This is argument 1" restart_main: argv[2]="Argument 2 here" restart_main: argv[3]="Lastly, the 3rd argument" restart_main: Variable=VarName has value=VarValue restart_main: Started with argc=4 restart_main: argv[0]="ostest" restart_main: argv[1]="This is argument 1" restart_main: argv[2]="Argument 2 here" restart_main: argv[3]="Lastly, the 3rd argument" restart_main: Variable=VarName has value=VarValue restart_main: Exiting End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 3effd50 3effd50 ordblks 3 3 mxordblk 3e62640 3e50630 uordblks 8cf30 9f0e0 fordblks 3e72e20 3e60c70 user_main: waitpid test Test waitpid() waitpid_start_child: Started waitpid_main at PID=21 [04/04/23 17:41:59] [ 7] [ EMERG] kasan_report: kasan detected a read access error, address at 0x7fea58e44ea8, size is 8 [04/04/23 17:41:59] [ 7] [ EMERG] _assert: Current Version: NuttX 10.4.0 758e88672b Apr 4 2023 20:41:42 sim [04/04/23 17:41:59] [ 7] [ EMERG] _assert: Assertion failed panic: at file: kasan/kasan.c:114 task: ostest 0x4674fd [04/04/23 17:41:59] [ 7] [ EMERG] dump_stack: User Stack: [04/04/23 17:41:59] [ 7] [ EMERG] dump_stack: sp: 0x7fea58e9d1f0 [04/04/23 17:41:59] [ 7] [ EMERG] dump_stack: base: 0x7fea58e8ba20 [04/04/23 17:41:59] [ 7] [ EMERG] dump_stack: size: 00073600 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d1e0: 58e9d230 00007fea 58e9d9a0 00007fea 58e9d230 00007fea 004c8a85 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d200: 00000008 00000000 58e44f10 00007fea 00647f20 00000000 58e9d1f0 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d220: 004674fd 00000000 58e44e70 00007fea 58e9d320 00007fea 004c9f06 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d240: 58e9d360 00007fea 0054ab45 00000000 00620ea9 00000072 0054aae0 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d260: 7474754e 00000058 0044bcd4 00000000 0054ab00 6f424300 584e2d78 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d280: 58e0001f 00007fea 00000010 00000030 58e9d360 2e303100 00302e34 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d2a0: 00620e67 00000000 35370000 38386538 62323736 72704120 20342020 33323032 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d2c0: 3a303220 343a3134 00000032 00000000 7ffbfeff 00000000 00000000 6d697300 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d2e0: 58e00000 00007fea 00000007 00000000 58e9d330 00007fea 00451920 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d300: 58e44f10 00007fea 00620e68 00000000 00000008 00000015 00000001 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d320: 58e9d350 00007fea 0043cb57 00000000 00008981 00000000 0054ab45 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d340: 00000001 00000072 0054aae0 00000000 58e9d390 00007fea 0045181b 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d360: 00000008 00000000 58e44ea8 00007f00 00000008 00000000 58e44ea8 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d380: 58e44ea8 00007fea 58e44ea8 00007fea 58e9d3b0 00007fea 0045259c 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d3a0: 00000008 00000000 58e44ea8 00007fea 58e9d3d0 00007fea 004526f2 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d3c0: 00000004 00000000 58e44ea8 00007fea 58e9d420 00007fea 004203ed 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d3e0: 58e9d400 00007fea 58e44f28 00000007 58e9d410 00007fea 00411d4c 00000007 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d400: 7ffbfeff 00000000 00000000 00000000 00000023 00000000 58e44f10 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d420: 58e9d450 00007fea 0040d6e9 00000000 58e00023 00007fea 58e00000 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d440: 58e9d460 00007fea 00000003 00000007 58e9d490 00007fea 0043354f 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d460: 00000004 00000000 58e00000 00007fea 00000004 00000000 00000000 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d480: 00000023 00000000 00000000 00000000 58e9d4d0 00007fea 00433bce 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d4a0: 00000004 00000000 58e00000 00007fea 58e9d4d0 00007fea 00452854 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d4c0: 00000023 00000000 58e44f10 00007fea 58e9d510 00007fea 0043d9d9 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d4e0: 58e9d530 00007fea 58e00000 00007fea 58e44e60 00007fea 58e00000 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d500: 00000008 00000001 00000023 00000000 58e9d530 00007fea 00456e37 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d520: 58e44e70 00007fea 58e00000 00007fea 58e9d5a0 00007fea 00458d49 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d540: 58e44e70 00007fea 58e00000 00007fea 00000008 00000000 58e46338 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d560: 00000010 00000013 5cd01188 00007fea 58e46338 00007fea 00000050 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d580: 58e44eb0 00007fea 58e44e60 00007fea 00000008 00000000 58e44f10 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d5a0: 58e9d5c0 00007fea 00450e89 00000000 00000001 00000000 58e44e70 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d5c0: 58e9d610 00007fea 0040f7f8 00000000 58eaf9f0 00007fea 58e45c60 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d5e0: 58e9d620 00000007 58e46300 00007fea 00000000 00000000 00000008 0000001e [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d600: 00002000 00000000 00000000 00000000 58e9d670 00007fea 0040f89e 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d620: 0046da18 00000000 00411364 00000000 00000000 00000064 58e45c60 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d640: 58e9d660 00007fea 00452768 00000000 58e9d6a0 00007fea 58e44f10 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d660: 58e9d6a0 00007fea 00002000 00000000 58e9d6a0 00007fea 004110b7 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d680: 0046da18 00000000 00411364 00000000 00000000 00000064 58e45c60 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d6a0: 58e9d700 00007fea 0040ee37 00000000 00000001 00000000 0046da18 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d6c0: 00000000 00000000 00002000 00000064 0054dc0d 00000000 58e45c60 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d6e0: 00000002 00000000 00e45ca0 00000000 00000000 00000000 0055cc2f 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d700: 58e9d770 00007fea 0040e41d 00000000 00000000 00000000 58e454a0 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d720: 00000008 00000000 0046da18 00000000 58e9d750 00002000 00000000 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d740: 00000064 00000000 0054dc0d 00000000 58e9d780 00007fea 58e45c60 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d760: 58e9d860 00007fea 00000001 00000000 58e9d7c0 00007fea 0040e60e 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d780: 00000000 00000000 58e454a0 00007fea 58e9d7a0 00007fea 00000000 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d7a0: 0046da18 00000000 00000000 00000000 00002000 00000064 0054dc0d 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d7c0: 58e9d830 00007fea 0040e6c7 00000000 00000000 00000000 00000003 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d7e0: 58e9d820 00007fea 00000000 00000000 0046da18 00000000 00000000 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d800: 00002000 00000064 0054dc0d 00000000 00000000 00000000 0055cc2f 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d820: 00000001 00000000 0055cc2f 00000000 58e9d860 00007fea 0040e818 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d840: 00000000 00000000 0046da18 00000000 00002000 00000064 0054dc0d 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d860: 58e9d890 00007fea 0046daa1 00000000 58e453d8 00007fea 00000015 00000001 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d880: 0009f0e0 03e60c70 00000005 00000000 58e9d8c0 00007fea 0046de79 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d8a0: 58e453d8 00007fea 00000060 00000019 0009f0e0 03e60c70 00000005 00000000 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d8c0: 58e9d920 00007fea 00467a8c 00000000 03effd50 00000002 00000061 03e62640 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d8e0: 0008cfe0 03e72d70 00451920 00000000 58e8b9d0 00007fea 58e44f38 00000005 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d900: deadbeef 00000013 5cd01138 00000005 58e8b9d0 00007fea 58e8b9d0 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d920: 58e9d960 00007fea 00440554 00000000 00000008 00000000 58e8b9d0 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d940: 58e9d960 00000005 004674fd 00000000 00000000 00000000 58e8b9d0 00007fea [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d960: 58e9d990 00007fea 00411bbb 00000000 58e44f10 00007fea 00000005 00000001 [04/04/23 17:41:59] [ 7] [ EMERG] stack_dump: 0x7fea58e9d980: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 waitpid_main: PID 21 Started ostest_main: Exiting with status 256