anchao commented on pull request #4953:
URL: https://github.com/apache/incubator-nuttx/pull/4953#issuecomment-992188093


   @masayuki2009 san,
   
   I reproduced this issue with new ostest update:
   
   
https://github.com/anchao/incubator-nuttx-apps/commit/46593311374518aac737f36d8d799d9ad09c4d4f
   
   during the ostest processing, we need uart interrupts to help us increase 
the system loading:
   ```
   
   ap> ostest &
   ...
   thread_waiter: Taking mutex
   thread_waiter: Starting 5 second wait for condition
   ap> ps
     PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK   
USED  FILLED    CPU COMMAND
   ...
     113   113 100 FIFO     Task    --- Waiting  Signal    00000000 002032 
000752  37.0%    0.0% ostest
     114   114 100 FIFO     Task    --- Waiting  Semaphore 00000000 008136 
000760   9.3%    0.0% ostest Arg1 Arg2Arg3 Arg4
   ...
     119   114 100 FIFO     pthread --- Ready              00000000 002048 
000468  22.8%    0.0% pt-0x2c4154fd 0
     120   114  99 FIFO     pthread --- Ready              00000000 002048 
000760  37.1%    1.2% pt-0x2c41540d 0
   ```
   
   
   ------------      ..... keep typing ps .... 
----------------------------------
   
   
   ```
   ap> ps
   ...
   ap> ps
   ...
   ap> ps
   ...
   ap> ps
     PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK   
USED  FILLED    CPU COMMAND
   ...
     113   113 100 FIFO     Task    --- Waiting  Signal    00000000 002032 
000752  37.0%    0.0% ostest
     114   114 100 FIFO     Task    --- Waiting  Semaphore 00000000 008136 
000760   9.3%    0.0% ostest Arg1 Arg2 Arg3 Arg4
   ...
     119   114 100 FIFO     pthread --- Ready              00000000 002048 
000468  22.8%    0.0% pt-0x2c4154fd 0
     120   114  99 FIFO     pthread --- Waiting  Semaphore 00000000 002048 
000760  37.1%    1.4% pt-0x2c41540d 0
   
   ap> ps
     PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK   
USED  FILLED    CPU COMMAND
   ...
     113   113 100 FIFO     Task    --- Waiting  Signal    00000000 002032 
000752  37.0%    0.0% ostest
     114   114 100 FIFO     Task    --- Waiting  Semaphore 00000000 008136 
000760   9.3%    0.0% ostest Arg1 Arg2 Arg3 Arg4
   ...
     120   114  99 FIFO     pthread --- Waiting  Semaphore 00000000 002048 
000760  37.1%    0.7% pt-0x2c41540d 0
   ```
   the waiting time has already exceeded 5s, check the callstack:
   thread 119 is thread_busy, timeout and exit,
   thread 120 is thread_waiter, deadlock:
   
   ```
   ap> dumpstack 113
   [  128.702121] [121] [ EMERG] [ap] backtrace:
   [  128.702566] [121] [ EMERG] [ap] [113] [<0x2c3d74d2>] 
arm_switchcontext+0xe/0x18
   [  128.703782] [121] [ EMERG] [ap] [113] [<0x2c3b5ddf>] 
nxsig_timedwait+0xdf/0x18c
   [  128.704982] [121] [ EMERG] [ap] [113] [<0x2c3b4878>] 
nx_waitpid+0x158/0x238
   [  128.706282] [121] [ EMERG] [ap] [113] [<0x2c3b495c>] waitpid+0x4/0x20
   [  128.707378] [121] [ EMERG] [ap] [113] [<0x2c4157c8>] 
ostest_main+0x134/0x258
   [  128.708588] [121] [ EMERG] [ap] [113] [<0x2c3c9b80>] 
nxtask_startup+0x40/0x68
   [  128.709788] [121] [ EMERG] [ap] [113] [<0x2c3b6ed6>] 
nxtask_start+0x46/0x60
   ap> dumpstack 114
   [  130.567113] [122] [ EMERG] [ap] backtrace:
   [  130.567528] [122] [ EMERG] [ap] [114] [<0x2c3d74d2>] 
arm_switchcontext+0xe/0x18
   [  130.568786] [122] [ EMERG] [ap] [114] [<0x2c3b5169>] 
nxsem_wait_uninterruptible+0x69/0xac
   [  130.570114] [122] [ EMERG] [ap] [114] [<0x2c3b3c2e>] 
pthread_sem_take+0x1a/0x2c
   [  130.571317] [122] [ EMERG] [ap] [114] [<0x2c3b363a>] 
pthread_join+0x9e/0xdc
   [  130.572479] [122] [ EMERG] [ap] [114] [<0x2c4155da>] 
timedwait_test+0x9a/0x148
   [  130.573713] [122] [ EMERG] [ap] [114] [<0x2c41568c>] user_main+0x4/0xc
   [  130.574855] [122] [ EMERG] [ap] [114] [<0x2c3c9b80>] 
nxtask_startup+0x40/0x68
   [  130.576044] [122] [ EMERG] [ap] [114] [<0x2c3b6ed6>] 
nxtask_start+0x46/0x60
   ap> dumpstack 119
   ap> dumpstack 120
   [  135.550877] [124] [ EMERG] [ap] backtrace:
   [  135.551292] [124] [ EMERG] [ap] [120] [<0x2c3d74d2>] 
arm_switchcontext+0xe/0x18
   [  135.552538] [124] [ EMERG] [ap] [120] [<0x2c3b50cf>] nxsem_wait+0x57/0x88
   [  135.553681] [124] [ EMERG] [ap] [120] [<0x2c3b3ae6>] 
pthread_cond_clockwait+0xca/0x110
   [  135.554969] [124] [ EMERG] [ap] [120] [<0x2c415462>] 
thread_waiter+0x56/0xf0
   [  135.556177] [124] [ EMERG] [ap] [120] [<0x2c3c984a>] 
pthread_startup+0xa/0x1c
   [  135.557427] [124] [ EMERG] [ap] [120] [<0x2c3b3262>] 
pthread_start+0x56/0x90
   ap> 
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to