This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Fdpoll after Mailbox_pend error

Other Parts Discussed in Thread: SYSBIOS

Hi,

I have c6678 ,ndk 2.00.04.26, SYS/BIOS  6.32.05.54

my project is based on tcp server in client ndk example. In the daemon server function, each iteration of the loop I use fdPoll to wait for the file descriptor event for 1 ms.

I receive a buffer  by recvnc and send by mailbox to another task (inbox) , receive a buffer back from the task  by another mailbox (outbox) and send it back by send function.

Part of the code:

 

 

int dtask_tcp_echo( SOCKET s, UINT32 unused )

{

.....

FDPOLLITEM dPollIt[1];

fdPollIt[0].fd=s;

fdPollIt[0].eventsRequested=POLLIN;

for(;;)

{

  if(fdPoll(fdPollIt,1,1)>0)

  {

     length = (int)recvnc( s, (void **)&pBuf,MSG_DONTWAIT, &hBuffer );

     if (length>0)

      {     

          Mailbox_post(inbox,pBuf,timeout);

          if (Mailbox_pend(outbox,outBuf,timeout)!=0)

           {

               succSend=send( s, outBufCpy, outLength, 0 );

           }

      }

  }

}

In the first iteration of the for loop it works o.k. next time there is an error in fdpoll :

[C66xx_0] Internal exception: IERR=0x10

[C66xx_0] Resource conflict exception

[C66xx_0] ti.sysbios.family.c64p.Exception: line 248: E_exceptionMin: pc = 0x80309ec0, sp = 0x008605e0.

[C66xx_0] xdc.runtime.Error.raise: terminating execution

Thanks

Aviv

 

 

 

  • Aviv,

    This looks like a program memory corruption issue. 

    Have you looked at the indicated PC address to see what is there, and what is supposed to be there?  

    Can you check stacks with the ROV tool to verify that there are no overflows?

    Scott

  •  Hi Scott.

    I increased the size of the stack and I get:

     

    [C66xx_0] A0=0x481ce400 A1=0x0

    [C66xx_0] A2=0x1 A3=0x80d7b5c0

    [C66xx_0] A4=0x80a05cb8 A5=0x80a05ca8

    [C66xx_0] A6=0x0 A7=0x0

    [C66xx_0] A8=0xb7d0000 A9=0x2

    [C66xx_0] A10=0x80d5d2c4 A11=0x809ffb30

    [C66xx_0] A12=0x0 A13=0x809ffb1c

    [C66xx_0] A14=0x0 A15=0x0

    [C66xx_0] A16=0x80a357d0 A17=0x0

    [C66xx_0] A18=0x80a357b0 A19=0x20

    [C66xx_0] A20=0x0 A21=0x0

    [C66xx_0] A22=0x2005000 A23=0x804ffc98

    [C66xx_0] A24=0x2005000 A25=0x80d82500

    [C66xx_0] A26=0x804ffc98 A27=0x804ffc98

    [C66xx_0] A28=0x2005000 A29=0x200

    [C66xx_0] A30=0x0 A31=0x80d7b594

    [C66xx_0] B0=0x80a35718 B1=0x0

    [C66xx_0] B2=0x0 B3=0x80d7e710

    [C66xx_0] B4=0x80d62f50 B5=0x80a00000

    [C66xx_0] B6=0x159 B7=0x1

    [C66xx_0] B8=0x80d7e6c8 B9=0x803a94

    [C66xx_0] B10=0x80d39740 B11=0x64

    [C66xx_0] B12=0x809ffb64 B13=0x809ffb1c

    [C66xx_0] B14=0x80d82118 B15=0x809ffae0

    [C66xx_0] B16=0x80a357f0 B17=0x0

    [C66xx_0] B18=0x3 B19=0x0

    [C66xx_0] B20=0x28 B21=0x80d8206c

    [C66xx_0] B22=0xf B23=0x0

    [C66xx_0] B24=0x80d7d8c4 B25=0xcc00281

    [C66xx_0] B26=0x804550 B27=0x0

    [C66xx_0] B28=0x20000000 B29=0xc0

    [C66xx_0] B30=0x0 B31=0x80a3579c

    [C66xx_0] NTSR=0x1020e

    [C66xx_0] ITSR=0x20f

    [C66xx_0] IRP=0x80d0a728

    [C66xx_0] SSR=0x0

    [C66xx_0] AMR=0x0

    [C66xx_0] RILC=0x0

    [C66xx_0] ILC=0x0

    [C66xx_0] Exception at 0x80d7e738

    [C66xx_0] EFR=0x2 NRP=0x80d7e738

    [C66xx_0] Internal exception: IERR=0x8

    [C66xx_0] Opcode exception

    [C66xx_0] ti.sysbios.family.c64p.Exception: line 248: E_exceptionMin: pc = 0x80d0a728, sp = 0x809ffae0.

    [C66xx_0] xdc.runtime.Error.raise: terminating execution

     

    The Dissasembly code in 0x80d7e738, is:

    ti_sysbios_knl_Task_Object__table__V:
    80d7e680:   80A05B28     [ A1]  MVK.S1        0x40b6,A1
    80d7e684:   80D7E958     [ A1]  INTSP.L1      A21,A1
    80d7e688:   00000005            LDHU.D1T1     *-A0[0],A0
    80d7e68c:   00000020 ||         BPOS.S1       ti_sysbios_knl_Task_Object__table__V (PC+0 = 0x80d7e680),A0
    80d7e690:   804FFFB8     [ A1]  LOR.L1X         A31,B19,A0
    80d7e694:   00000001            NOP          
    80d7e698:   00000000 ||         NOP          
    80d7e69c:   00500000            NOP          
    80d7e6a0:   80000000     [ A1]  NOP          
    80d7e6a4:   00000000            NOP          
    80d7e6a8:   80D12028     [ A1]  MVK.S1        0xffffa240,A1
    80d7e6ac:   00000000            NOP          
    80d7e6b0:   00000000            NOP          
    80d7e6b4:   00000000            NOP          
    80d7e6b8:   80D6F760     [ A1]  CMPEQ2.S1X    A23,B21,A1
    80d7e6bc:   00000001            NOP          
    80d7e6c0:   80D7E958 ||  [ A1]  INTSP.L1      A21,A1
    80d7e6c4:   00000000            NOP          
    80d7e6c8:   80D7E938     [ A1]  INTSPU.L1     A21,A1
    80d7e6cc:   80D7E938     [ A1]  INTSPU.L1     A21,A1
    80d7e6d0:   00000001            NOP          
    80d7e6d4:   00000002 ||         NOP          
    80d7e6d8:   809FFFB8     [ A1]  LOR.L1X         A31,B7,A1
    80d7e6dc:   00000001            NOP          
    80d7e6e0:   00000000 ||         NOP          
    80d7e6e4:   00500000            NOP          
    80d7e6e8:   80500000     [ A1]  NOP          
    80d7e6ec:   00000000            NOP          
    80d7e6f0:   80D0B9D8     [ A1]  CMPGTU.L1X    0x5,B20,A1
    80d7e6f4:   00000000            NOP          
    80d7e6f8:   00000000            NOP          
    80d7e6fc:   00000000            NOP          
    80d7e700:   80D6F770     [ A1]  ROTL.M1X      B21,A23,A1
    80d7e704:   00000001            NOP          
    80d7e708:   80D7E938 ||  [ A1]  INTSPU.L1     A21,A1
    80d7e70c:   00000000            NOP          
    80d7e710:   80D7E930     [ A1]  ADD2.D1       A31,A21,A1
    80d7e714:   80D7E930     [ A1]  ADD2.D1       A31,A21,A1
    80d7e718:   00000000            NOP          
    80d7e71c:   00000001            NOP          
    80d7e720:   80A005F0 ||  [ A1]  MPYSP2DP.M1   A0,A8,A1:A0
    80d7e724:   00000001            NOP          
    80d7e728:   00000000 ||         NOP          
    80d7e72c:   00000800            MPY32.M1      A0,A0,A0
    80d7e730:   80A00000     [ A1]  NOP          
    80d7e734:   00000000            NOP          
    80d7e738:   80D57F40            .word         0x80d57f40 

     

    The Dissasembly code in 0x80d0a728, is:

    210                     succSend=send( s, outBufCpy, outLength, 0 );
              $C$RL43:
    80d0a726:   ACCD                LDW.D2T1      *B15[5],A4
    80d0a728:   12002CFE            ADDAW.D2      B15,44,B4
    80d0a72c:   10831813            CALLP.S2      send (PC+268480 = 0x80d4bfe0),B3
    80d0a730:   030028ED ||         LDW.D2T1      *+B15[40],A6
    80d0a734:   0727     ||         MVK.L2        0,B6

    Thanks

    Aviv

     

  • Aviv,

    Looks like there is some corruption in your program.  Look at the value of NRP,  that is the line causing the exception:

    80d7e738:   80D57F40            .word         0x80d57f40

    Looks like this part of the code got corrupted.

    Judah