masayuki2009 commented on pull request #5539:
URL: https://github.com/apache/incubator-nuttx/pull/5539#issuecomment-1044239920
>Could you add a assert(0) at mm_takesemaphore() to see if there is someone
who called it in IRQ context ?
@GUIDINGLI
I added the assert(0)
```
diff --git a/mm/mm_heap/mm_sem.c b/mm/mm_heap/mm_sem.c
index 0911a6d300..c3ad37ffe8 100644
--- a/mm/mm_heap/mm_sem.c
+++ b/mm/mm_heap/mm_sem.c
@@ -93,6 +93,7 @@ bool mm_takesemaphore(FAR struct mm_heap_s *heap)
#else
/* Can't take semaphore in SMP interrupt handler */
+ assert(0);
return false;
#endif
}
```
However, it stopped at another place due to memory corruption.
```
nsh> i= 0
md5 -f /mnt/nfs/audio/xxx.wav
[ 39.590000] [CPU2] up_assert: Assertion failed CPU2 at file:vfs/fs_read.c
line: 69 task: Telnet session
[ 39.590000] [CPU2] arm_registerdump: R0: 00000001 R1: 00000000 R2:
00000000 R3: 00000000
[ 39.590000] [CPU2] arm_registerdump: R4: 10864900 R5: 10853500 R6:
1086497c R7: 108652f0
[ 39.590000] [CPU2] arm_registerdump: R8: 00000000 SB: 00000001 SL:
1086564b FP: 00000000
[ 39.590000] [CPU2] arm_registerdump: IP: 00000001 SP: 108652f0 LR:
10809ac0 PC: 1080a22c
[ 39.590000] [CPU2] arm_registerdump: CPSR: 60000053
[ 39.600000] [CPU2] arm_dump_stack: IRQ Stack:
[ 39.600000] [CPU2] arm_dump_stack: sp: 108652f0
[ 39.600000] [CPU2] arm_dump_stack: base: 10854510
[ 39.600000] [CPU2] arm_dump_stack: size: 00000800
[ 39.600000] [CPU2] arm_dump_stack: ERROR: IRQ Stack pointer is not within
the stack
[ 39.600000] [CPU2] arm_dump_stack: User Stack:
[ 39.600000] [CPU2] arm_dump_stack: sp: 108652f0
[ 39.600000] [CPU2] arm_dump_stack: base: 10864bf0
[ 39.600000] [CPU2] arm_dump_stack: size: 000007e8
```
--
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]