every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?

梁权 liang_1911 at 163.com
Sun Dec 2 08:07:38 CET 2018


To simplify the problem, i do a test without QT like the following program:
#define MALLOC_SIZE 8*1024*1024
int main()
{
int err;
char *addr=(char *)0;
time_t now;
struct tm *timenow;
time(&now);
timenow = localtime(&now);
printf("%s\n", asctime(timenow));
addr = (char *)malloc(MALLOC_SIZE);
if (addr)
printf("malloc ok\n");
do
{
if (addr){
memset(addr, 0x12, MALLOC_SIZE/2);
                        memset(addr + MALLOC_SIZE/2, 0x34, MALLOC_SIZE/2);
}
usleep(1000);
}while(1);
return 0;
}
After i enable the interrupt for several minutes,  the error occur:
root at am335x-evm:~/tmp# ./testMemset 
Sun Dec  2 14:38:11 2018
malloc ok
[  311.700939] Unable to handle kernel paging request at virtual address b6e76000
[  311.708290] pgd = cdfd8000
[  311.711004] [b6e76000] *pgd=8e7b7831, *pte=80bd118f, *ppte=80bd1a3e
[  311.718141] Internal error: Oops: 81f [#1] PREEMPT ARM
[  311.723327] Modules linked in: motionDrv(O) FPGA(O)
[  311.728237] CPU: 0 PID: 659 Comm: testMemset Tainted: G           O    4.14.67-gd315a9bb00 #115
[  311.736960] Hardware name: Generic AM33XX (Flattened Device Tree)
[  311.743091] I-pipe domain: Linux
[  311.746324] task: cdedf600 task.stack: cdb92000
[  311.750899] PC is at 0xb6ecee78
[  311.754041] LR is at 0xb6ecee58
[  311.757182] pc : [<b6ecee78>]    lr : [<b6ecee58>]    psr: 20000113
[  311.763466] sp : cdb93ff8  ip : 34343434  fp : 00000000
[  311.768712] r10: b6f77000  r9 : 00000000  r8 : 00000000
[  311.773958] r7 : beb0dc20  r6 : 00008525  r5 : beb0dc48  r4 : 00000000
[  311.780516] r3 : b6e76000  r2 : 00000006  r1 : 34343434  r0 : b6a75008
[  311.787073] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  311.794241] Control: 10c5387d  Table: 8dfd8019  DAC: 00000055
[  311.800006] Process testMemset (pid: 659, stack limit = 0xcdb92218)
[  311.806289] Stack: (0xcdb93ff8 to 0xcdb94000)
[  311.810681] 3fe0:                                                       00000000 00000000
[  311.818886] Backtrace: no frame pointer
[  311.822729] Code: 28a31002 2afffff6 e2022007 e2522001 (24c31001) 
[  311.830628] ---[ end trace a41a426083b826ca ]---
Segmentation fault
wether the kernel  have the Philippe's pathc or not , the situation is the same.

so in my opinion,it is maybe the robust  of this version of the ipipe-patch or  xenomai is not so well  to make this happen? 
i will have a try with the 4.9 kenerl  tomorrow, and  hope can eliminate this problem. if not , i am afraid i have to give up the xenomai on my project.
--

----------------------------------------------
          梁权
THANKS & BR!



At 2018-12-01 00:44:10, "梁权" <liang_1911 at 163.com> wrote:

i try this patch  several times,  the QT app still crashed after runing few minutes. and the kenerl report the error like this:
root at am335x-evm:~/tmp# [ 1696.313121] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT ARM
[ 1696.320258] Modules linked in: motionDrv(O) FPGA(O)
[ 1696.325169] CPU: 0 PID: 606 Comm: HMI_V2 Tainted: G           O    4.14.67-gd315a9bb00 #115
[ 1696.333557] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1696.339657] I-pipe domain: Linux
[ 1696.342920] task: cda6c600 task.stack: cdad6000
[ 1696.347465] PC is at 0xb5c27c64
[ 1696.350607] LR is at 0xb5c27c60
[ 1696.353779] pc : [<b5c27c64>]    lr : [<b5c27c60>]    psr: 60070113
[ 1696.360062] sp : cdad7ff8  ip : b61060ec  fp : 00000000
[ 1696.365308] r10: 00000000  r9 : b6100fa8  r8 : 0031e2a8
[ 1696.370554] r7 : 00362b18  r6 : bef16a84  r5 : 003623a8  r4 : b610b40c
[ 1696.377081] r3 : 000083d0  r2 : 00000000  r1 : 00000000  r0 : 0035f8b0
[ 1696.383639] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1696.390807] Control: 10c5387d  Table: 8e7b8019  DAC: 00000055
[ 1696.396571] Process HMI_V2 (pid: 606, stack limit = 0xcdad6218)
[ 1696.402519] Stack: (0xcdad7ff8 to 0xcdad8000)
[ 1696.406911] 7fe0:                                                       00000000 00000000
[ 1696.415116] Backtrace: no frame pointer
[ 1696.418959] Code: 6820e83c 4010e8bd ba20f76f 4604b510 (f76c6800) 
[ 1696.427652] ---[ end trace 4f2a065db149444a ]---
or like this:
[  801.038004] Unable to handle kernel paging request at virtual address 302e3020
[  801.045476] pgd = cda04000
[  801.048313] [302e3020] *pgd=00000000
[  801.052857] Internal error: Oops: 80000005 [#1] PREEMPT ARM
[  801.058592] Modules linked in: motionDrv(O) FPGA(O)
[  801.064173] CPU: 0 PID: 601 Comm: HMI_V2 Tainted: G           O    4.14.67-gd315a9bb00 #113
[  801.073019] Hardware name: Generic AM33XX (Flattened Device Tree)
[  801.079241] I-pipe domain: Linux
[  801.083023] task: cdaaa400 task.stack: cf04c000
[  801.087720] PC is at 0x302e3020
[  801.090923] LR is at 0xb5888f2c
[  801.094491] pc : [<302e3020>]    lr : [<b5888f2c>]    psr: 60070113
[  801.100866] sp : cf04dff8  ip : 000000ac  fp : be942a08
[  801.106417] r10: 00000039  r9 : 00000321  r8 : 00000032
[  801.111816] r7 : 0038f6e8  r6 : 00398800  r5 : 00000000  r4 : 001024a0
[  801.118434] r3 : 00000000  r2 : 00000006  r1 : 00398800  r0 : be9424a4
[  801.125388] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  801.132709] Control: 10c5387d  Table: 8da04019  DAC: 00000055
[  801.138565] Process HMI_V2 (pid: 601, stack limit = 0xcf04c218)
[  801.144909] Stack: (0xcf04dff8 to 0xcf04e000)
[  801.149423] dfe0:                                                       00000000 00000000
[  801.157963] Backtrace: invalid frame pointer 0xbe942a08
[  801.163331] Code: bad PC value
[  801.166534] ---[ end trace 98fa8ef156ddf39e ]---
or this:
[ 1417.451198] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 1417.459556] pgd = cd870000
[ 1417.463185] [00000000] *pgd=8d8b9831, *pte=00000000, *ppte=00000000
[ 1417.469621] Internal error: Oops: 817 [#2] PREEMPT ARM
[ 1417.474806] Modules linked in: motionDrv(O) FPGA(O)
[ 1417.479717] CPU: 0 PID: 628 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #113
[ 1417.488104] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1417.494204] I-pipe domain: Linux
[ 1417.497468] task: cdb11800 task.stack: cd8be000
[ 1417.502013] PC is at 0xb5b56a48
[ 1417.505154] LR is at 0xb5b56a44
[ 1417.508296] pc : [<b5b56a48>]    lr : [<b5b56a44>]    psr: 60070113
[ 1417.514609] sp : cd8bfff8  ip : b6096ff8  fp : 00000000
[ 1417.519856] r10: 00347130  r9 : b608ffa8  r8 : 004d956a
[ 1417.525102] r7 : 00330c98  r6 : 00000000  r5 : ffffffff  r4 : ffffffff
[ 1417.531629] r3 : 0035e9c0  r2 : 00000000  r1 : bee89a08  r0 : 00330c98
[ 1417.538187] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1417.545354] Control: 10c5387d  Table: 8d870019  DAC: 00000055
[ 1417.551119] Process HMI_V2 (pid: 628, stack limit = 0xcd8be218)
[ 1417.557067] Stack: (0xcd8bfff8 to 0xcd8c0000)
[ 1417.561459] ffe0:                                                       00000000 00000000
[ 1417.569663] Backtrace: no frame pointer
[ 1417.573507] Code: 461fda04 685b19bb d1f54298 1c563a01 (0682ea4f) 
[ 1417.581894] ---[ end trace 98fa8ef156ddf39f ]---


besides that, there is another thing i was curious on; at the beginning i register the interrupt by using the
rtdm_request_irq func; however it have no effect; then i add the following code before i call rtdm_request_irq:
irq_set_handler(irqNo,handle_simple_irq); 
it work around.  i think this code has nothing to do with the problem, so i didn't mention it before。
----------------------------------------------
          梁权
THANKS & BR!
At 2018-11-30 00:40:49, "Philippe Gerum" <rpm at xenomai.org> wrote:
>On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
>> hi,
>> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
>> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
>> to  handler this interrupt immediately, i register  the interrupt handler in xenomai domain.Also there is a QT applictation running on the board;  and here is the problem i encounter:
>> if i open the interrupt and run the QT application simultaneously, the QT application will get wrong like this after a few minutes(but the linux is still running fine):
>> [ 1601.496828] Unhandled fault: page domain fault (0x01b) at 0xb6fa135c
>
>Any improvement with this patch in?
>
>diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
>index 3569b3174372..c53f51357b3c 100644
>--- a/arch/arm/kernel/entry-armv.S
>+++ b/arch/arm/kernel/entry-armv.S
>@@ -296,6 +296,7 @@ __und_svc:
> 	bl	__ipipe_notify_trap		@ branch to trap handler
> 	cmp	r0, #0
> 	bne	__und_svc_finish
>+	uaccess_enable ip
> #endif /* CONFIG_IPIPE */
> 	@
> 	@ call emulation code, which returns using r9 if it has emulated
>
>-- 
>Philippe.


More information about the Xenomai mailing list