You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/16 14:06:00 UTC

[GitHub] [nuttx] GUIDINGLI opened a new pull request, #8151: sched: fix task_delete crash in SMP case

GUIDINGLI opened a new pull request, #8151:
URL: https://github.com/apache/nuttx/pull/8151

   ## Summary
   
   sched: fix task_delete crash in SMP case
   
   A testcase as following:
   
   child_task()
   {
     sleep(3);
   }
   
   main_task()
   {
     while (1)
       {
         ret = task_create("child_task", child_task, );
         sleep(1);
   
         task_delete(ret);
       }
   }
   
   Root casuse:
   task_delete hasn's cover the condition that the deleted-task is justing running on the other CPU.
   
   Fix:
   Let the nxsched_remove_readytorun() do the real work
   
   Signed-off-by: ligd <li...@xiaomi.com>
   
   ## Impact
   
   task delete
   
   ## Testing
   
   VELA


-- 
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


[GitHub] [nuttx] acassis commented on pull request #8151: sched: fix task_delete crash in SMP case

Posted by GitBox <gi...@apache.org>.
acassis commented on PR #8151:
URL: https://github.com/apache/nuttx/pull/8151#issuecomment-1384608738

   Please rebase, it will fix the CI error msg!


-- 
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


[GitHub] [nuttx] masayuki2009 commented on pull request #8151: sched: fix task_delete crash in SMP case

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #8151:
URL: https://github.com/apache/nuttx/pull/8151#issuecomment-1384929758

   >Hmm, I noticed that ostest with sabre-6quad:smp on QEMU-7.1 failed.
   
   sim:smp also fails.
   
   ```
   NuttShell (NSH) NuttX-12.0.0
   nsh> uname -a
   NuttX 12.0.0 47e446261b-dirty Jan 17 2023 15:27:20 sim sim
   nsh> ps
     PID GROUP CPU PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK   USED  FILLED COMMAND
       0     0   0   0 FIFO     Kthread N-- Running            00000000 066512 004760   7.1%  CPU0 IDLE
       1     1   1   0 FIFO     Kthread N-- Assigned           00000000 066512 007080  10.6%  CPU1 IDLE
       2     2   2   0 FIFO     Kthread N-- Running            00000000 066512 004688   7.0%  CPU2 IDLE
       3     3   3   0 FIFO     Kthread N-- Running            00000000 066512 004688   7.0%  CPU3 IDLE
       4     4 --- 255 FIFO     Kthread --- Waiting  Signal    00000000 067504 001016   1.5%  loop_task
       5     5   1 100 FIFO     Task    --- Running            00000000 067504 003048   4.5%  nsh_main
   nsh> ostest
   stdio_test: write fd=1
   ...
   user_main: cancel test
   cancel_test: Test 1a: Normal Cancellation
   cancel_test: Starting thread
   start_thread: Initializing mutex
   start_thread: Initializing cond
   start_thread: Starting thread
   start_thread: Yielding
   sem_waiter: Taking mutex
   sem_waiter: Starting wait for condition
   cancel_test: Canceling thread
   cancel_test: Joining
   cancel_test: waiter exited with result=0xffffffffffffffff
   cancel_test: PASS thread terminated with PTHREAD_CANCELED
   cancel_test: Test 2: Asynchronous Cancellation
   ... Skipped
   cancel_test: Test 3: Ca[CPU1] _assert: Assertion failed CPU1 at file: cancel.c:397 task: ostest 0x55757e805b04
   ncellation of detached thread
   cancel_test: Re-starting thread
   restart_thread: Destroying cond
   restart_thread: ERROR pthread_cond_destroy failed, status=16
   ostest_main: Exiting with status 256
   stdio_test: Standard I/O Check: fprintf to stderr
   ```


-- 
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


[GitHub] [nuttx] masayuki2009 commented on pull request #8151: sched: fix task_delete crash in SMP case

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #8151:
URL: https://github.com/apache/nuttx/pull/8151#issuecomment-1384880256

   @GUIDINGLI 
   
   Hmm, I noticed that ostest with sabre-6quad:smp on QEMU-7.1 failed.
   
   ```
   user_main: cancel test
   cancel_test: Test 1a: Normal Cancellation
   cancel_test: Starting thread
   start_thread: Initializing mutex
   start_thread: Initializing cond
   start_thread: Starting thread
   start_thread: Yielding
   sem_waiter: Taking mutex
   sem_waiter: Starting wait for condition
   cancel_test: Canceling thread
   cancel_test: Joining
   cancel_test: waiter exited with result=0xffffffff
   cancel_test: PASS thread terminated with PTHREAD_CANCELED
   cancel_test: Test 2: Asynchronous Cancellation
   ... Skipped
   cancel_test: Test 3: Cancellation of detached thread
   cancel_test: Re-starting thread
   restart_thread: Destroying cond
   restart_thread: ERROR pthread_cond_destroy failed, status=16
   ostest_main: Exiting with status 256
   nsh>
   ```


-- 
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


[GitHub] [nuttx] masayuki2009 merged pull request #8151: sched: fix task_delete crash in SMP case

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged PR #8151:
URL: https://github.com/apache/nuttx/pull/8151


-- 
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


[GitHub] [nuttx] masayuki2009 commented on pull request #8151: sched: fix task_delete crash in SMP case

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #8151:
URL: https://github.com/apache/nuttx/pull/8151#issuecomment-1386499109

   >I have got the reason and updated.
   
   @GUIDINGLI 
   I confirmed that the latest commit fixes the issues.
   


-- 
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


[GitHub] [nuttx] GUIDINGLI commented on pull request #8151: sched: fix task_delete crash in SMP case

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on PR #8151:
URL: https://github.com/apache/nuttx/pull/8151#issuecomment-1385262909

   @masayuki2009 
   Many thanks.
   I have got the reason and updated.


-- 
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