hartmannathan commented on PR #6318:
URL: https://github.com/apache/incubator-nuttx/pull/6318#issuecomment-1256553354

   Hmm... `ostest` is still crashing when priority inheritance is enabled. See 
below...
   
   Now, it is possible that the crash is not caused by priority inheritance, 
but by something else that is triggered under the conditions produced by 
`ostest`.
   
   I am not sure, because:
   
   When priority inheritance is disabled, this part of `ostest` does not run at 
all.
   
   I was not able to pinpoint the cause of the hard faults in the debugger.
   
   What I do know is:
   
   A project I was working on recently would hard-fault at seemingly random 
times. Since I turned off priority inheritance, I haven't seen any more 
hard-faults there.
   
   As I wrote here: 
https://lists.apache.org/thread/qsyc453vc8stwd54rjxfdqjw1y5zq2fb it seems like 
the hard faults I was seeing were related to an unexpected ISR. I tried to 
identify which ISR that was, but I couldn't quite pinpoint it.
   
   This is the output from my `ostest` run just now, with this PR applied:
   
   ```
   user_main: priority inheritance test
   priority_inheritance: Started
   priority_inheritance: Starting lowpri_thread-1 (of 3) at 1
   priority_inheritance: Set lowpri_thread-1 priority to 1
   priority_inheritance: Starting lowpri_thread-2 (of 3) at 1
   lowpri_thread-1: Started
   priority_inheritance: Set lowpri_thread-2 priority to 1
   lowpri_thread-1: initial priority: 1
   priority_inheritance: Starting lowpri_thread-3 (of 3) at 1
   lowpri_thread-2: Started
   priority_inheritance: Set lowpri_thread-3 priority to 1
   lowpri_thread-1: Waiting for the midle pri task to run
   priority_inheritance: Waiting...
   lowpri_thread-2: initial priority: 1
   lowpri_thread-3: Started
       g_middlestate:  0
   lowpri_thread-2: Waiting for the midle pri task to run
   lowpri_thread-3: initial priority: 1
       g_highstate[0]: 0
       g_middlestate:  0
   lowpri_thread-3: Waiting for the midle pri task to run
       I still have a count on the semaphore
       g_highstate[0]: 0
       g_middlestate:  0
       I still have a count on the semaphore
       g_highstate[0]: 0
       I still have a count on the semaphore
   lowpri_thread-1: Waiting for the midle pri task to run
       g_middlestate:  0
       g_highstate[0]: 0
       I still have a count on the semaphore
   lowpri_thread-2: Waiting for the midle pri task to run
       g_middlestate:  0
       g_highstate[0]: 0
       I still have a count on the semaphore
   lowpri_thread-3: Waiting for the midle pri task to run
       g_middlestate:  0
       g_highstate[0]: 0
       I still have a count on the semaphore
   priority_inheritance: Starting medpri_thread at 99
   priority_inheritance: Set medpri_thread priority to 99
   priority_inheritance: Waiting...
   medpri_thread: Started ... I won't let go of the CPU!
   priority_inheritance: Starting highpri_thread-1 (of 1) at 255
   priority_inheritance: Set highpri_thread-1 priority to 255
   highpri_thread-1: Started
   priority_inheritance: Waiting for highpri_thread-1 to complete
   highpri_thread-1: Calling sem_wait()
   lowpri_thread-3: Sem count: -1, No. highpri thread: 1
   highpri_thread-1: SUCCESS midpri_thread is still running!
   highpri_thread-1: Okay... I'm done!
   priority_inheritance: Waiting for medpri_thread to complete
   medpri_thread: Okay... I'm done!
   priority_inheritance: Waiting for lowpri_thread-1 to complete
   lowpri_thread-2: Sem count: 1, No. highpri thread: 0
   lowpri_thread-2: SUCCESS the middle priority task has already exitted!
                  g_middlestate:  3 sem count=1
                  g_highstate[0]: 3
   lowpri_thread-1: Sem count: 1, No. highpri thread: 0
   lowpri_thread-3: SUCCESS priority before sem_post: 255
   lowpri_thread-2: SUCCESS priority before sem_post: 1
   lowpri_thread-1: SUCCESS the middle priority task has already exitted!
   lowpri_thread-3: SUCCESS final priority: 1
   lowpri_thread-2: SUCCESS final priority: 1
                  g_middlestate:  3 sem count=1
   lowpri_thread-3: Okay... I'm done!
   lowpri_thread-2: Okay... I'm done!
                  g_highstate[0]: 3
   lowpri_thread-1: SUCCESS priority before sem_post: 1
   lowpri_thread-1: SUCCESS final priority: 1
   lowpri_thread-1: Okay... I'm done!
   priority_inheritance: Waiting for lowpri_thread-2 to complete
   priority_inheritance: Waiting for lowpri_thread-3 to complete
   priority_inheritancpriority_inheritance: Waiting for Task-0 to complete
   priority_inheritance: FF�]�� Started, waiting 0 uS to take count
   priority_inheritance:  Started, waiting 20000 uS to take count
   priority_inheritance: Task0 priority was:200 is:220
   priority_inheritance: (null) Posted
   priority_inheritance: Task0 priority was:220 is:200
   priority_inheritance: Waiting for Task-1 to complete
   up_assert: Assertion failed at file:armv7-m/arm_hardfault.c line: 173 task: 
Tas2
   arm_registerdump: R0: 000000e2 R1: 0800310d R2: 00000072  R3: 14110800
   arm_registerdump: R4: 00000000 R5: 00000000 R6: 00000000  FP: 00000000
   arm_registerdump: R8: 00000000 SB: 00000000 SL: 00000000 R11: 00000000
   arm_registerdump: IP: 00008000 SP: 20008cc8 LR: 08010d77  PC: 080117e0
   arm_registerdump: xPSR: 21000000 BASEPRI: 000000f0 CONTROL: 00000000
   arm_registerdump: EXC_RETURN: ffffffe9
   arm_dump_stack: User Stack:
   arm_dump_stack: sp:     20008a88
   arm_dump_stack:   base: 200089d0
   arm_dump_stack:   size: 000003c0
   arm_stackdump: 20008a80: 00000001 20008a90 20008a88 20008610 00000000 
0800a1bd c
   arm_stackdump: 20008aa0: 000000ad 08023db8 20008610 08007341 000000ad 
08023db8 3
   arm_stackdump: 20008ac0: 40004808 00000000 20008bf4 00000003 20008704 
00008200 1
   arm_stackdump: 20008ae0: 000000f0 40000000 080030a1 08002d1f 20008bf4 
00000003 3
   arm_stackdump: 20008b00: 00000000 08001875 00000080 08001849 00000000 
00000003 b
   arm_stackdump: 20008b20: 00000000 00000000 009a1d1f ffffffe9 00000000 
00000000 0
   arm_stackdump: 20008b40: 00000000 00000000 00000000 00000000 00000000 
00000000 0
   arm_stackdump: 20008b60: 00000000 00000000 00000000 00000000 00000002 
20008688 8
   arm_stackdump: 20008b80: 00008000 0800a28f 0800a1f4 01000000 00000000 
00000000 0
   arm_stackdump: 20008ba0: 00000000 00000000 00000000 00000000 00000000 
00000000 0
   arm_stackdump: 20008bc0: 00000000 00000000 20008610 20008704 00000000 
20000acc 4
   arm_stackdump: 20008be0: 20008688 20008808 20000a7c 20001c70 20008804 
20008cc8 0
   arm_stackdump: 20008c00: 00000000 00000000 00000000 00000000 00000000 
00000000 9
   arm_stackdump: 20008c20: 00000000 00000000 00000000 00000000 00000000 
00000000 0
   arm_stackdump: 20008c40: 00000000 00000000 00000000 00000000 00000000 
00000000 0
   arm_stackdump: 20008c60: 000000e2 0800310d 00000072 14110800 00008000 
08010d77 0
   arm_stackdump: 20008c80: 00000000 00000000 00000000 00000000 00000000 
00000000 0
   arm_stackdump: 20008ca0: 00000000 00000000 00000000 00000000 00000000 
00000000 0
   arm_stackdump: 20008cc0: 00000000 200086d8 f002bb08 000000e2 14110800 
00000000 7
   arm_stackdump: 20008ce0: f002bb08 20008704 00000007 00000000 f0008f35 
0800466b 0
   arm_stackdump: 20008d00: 200086c0 080046cb 00000000 20008610 00000000 
200086c0 5
   arm_stackdump: 20008d20: 000000dc 0001ecf7 00000000 20008610 000000dc 
0801557d 0
   arm_stackdump: 20008d40: 200089a8 20008610 00000000 08008c69 00004e20 
00000000 1
   arm_stackdump: 20008d60: 00000000 200089a8 00000004 0801ed21 00000000 
08003db7 0
   arm_showtasks:    PID    PRI     STACK   COMMAND
   arm_dump_task:      0      0      1000   Idle Task
   arm_dump_task:      1    224      1992   hpwork 0x20000094
   arm_dump_task:      2    100      1992   lpwork 0x200000a8
   arm_dump_task:      3    100      2000   nsh_main
   arm_dump_task:      4    100      2008   ostest
   arm_dump_task:      5    100      8112   ostest Arg1 Arg2 Arg3 Arg4
   arm_dump_task:     89    210       960   Task1   
   arm_dump_task:     90    220       960   Task2   � � �  hD`������hD
   ```
   


-- 
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-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to