The other call stack with int connection with fail

Thread [0] (Suspended: Signal 'SIGINT' received. Description: Interrupt.)

    3 _handle_Data_Address_Write()  0x8001f438
    2 __malloc_av_()  0x00000048
    1 <symbol is not available> 0x00410000

any suggestion?

thanks

Oscar

On Sun, Oct 4, 2009 at 9:39 AM, Oscar F <[email protected]> wrote:

> Hello Again. i don´t know what happend, but i have tested all solution and
> don´t work always is blocked in recv.
>
> I follow the call stack, because the debug mode doesn´t work at the moment,
> and this the result
>
> 9 _handle_Data_Address_Read()  0x8001fa34    *//FAIL here is the last call
> *
> 8 xTaskRemoveFromEventList() C:\Proyectos
> DAS\ProyectosAVRStudio32\Proyectos demos
> AVR32\Simulador_RTU\src\SOFTWARE_FRAMEWORK\SERVICES\FREERTOS\Source\tasks.c:1596
> 0x80012682
> 7 xTaskRemoveFromEventList() C:\Proyectos
> DAS\ProyectosAVRStudio32\Proyectos demos
> AVR32\Simulador_RTU\src\SOFTWARE_FRAMEWORK\SERVICES\FREERTOS\Source\tasks.c:1596
> 0x80012682
> 6 prvUnlockQueue() C:\Proyectos DAS\ProyectosAVRStudio32\Proyectos demos
> AVR32\Simulador_RTU\src\SOFTWARE_FRAMEWORK\SERVICES\FREERTOS\Source\queue.c:1056
> 0x80013358
> 5 xQueueGenericSend() C:\Proyectos DAS\ProyectosAVRStudio32\Proyectos demos
> AVR32\Simulador_RTU\src\SOFTWARE_FRAMEWORK\SERVICES\FREERTOS\Source\queue.c:539
> 0x80012ee8
> 4 sys_sem_signal() C:\Proyectos DAS\ProyectosAVRStudio32\Proyectos demos
> AVR32\Simulador_RTU\src\NETWORK\lwip-port\AT32UC3A\sys_arch.c:138
> 0x80016eca
> 3 do_recv() C:\Proyectos DAS\ProyectosAVRStudio32\Proyectos demos
> AVR32\Simulador_RTU\src\SOFTWARE_FRAMEWORK\SERVICES\lwip-1.3.0\src\api\api_msg.c:923
> 0x80011156
> 2 tcpip_thread() C:\Proyectos DAS\ProyectosAVRStudio32\Proyectos demos
> AVR32\Simulador_RTU\src\SOFTWARE_FRAMEWORK\SERVICES\lwip-1.3.0\src\api\tcpip.c:271
> 0x8000ed84
> 1 <symbol is not available> 0xdeadbeef
>
> Do you know what is the cause of the problem?
>
> Another thing:
> I have deleted the task WEB and TFTP example and now that i have more
> memory the problem appear more frecuency in the connection of the accept
> socket:
> always don´t fetch a _malloc instruction. I´ll put the call stack the nex
> time
>
> Thanks
> Oscar
>
>
>
>
>
>
>
>
>
>
>
> On Thu, Oct 1, 2009 at 8:17 AM, Oscar F <[email protected]> wrote:
>
>> Thank you again Kieran, first i would tell you the situation today.
>>
>> i have three socket, i received data of two and fail in the other. The
>> size of the buffer today is 2048, but i have a message of 12000 bytes. In
>> this moment i can´t declare this buffer because the application crack and
>> RTOS don´t enter. this is my other problem and i hope solve too.
>>
>> I have tested to define a little buffer ( 10 bytes ) but recv( ) don´t
>> enter in this socket. i don´t understand because in two socket work!! and in
>> the other no.
>>
>> The other solution (" make recv non-blocking") should test, but one
>> question: If enter in the fucntion and the size received is not the total,
>> select wait again, no ? and i only would have to do the call to recv (not
>> blocking ) until the lengh of the message is total received.
>>
>> please , if i want to define a big buffer 12000, what variable of config i
>> have to change in RTOS and lwipopts should i change. My micro is
>> AT32UC3A0512 and i think i have enough memory ( 512 Kb falsh and 64K of
>> SRAM). today the program need 200Kbytes en flash. Maybe i need to define the
>> buffer in internal flash and not in the RAM memory. I not sure but this
>> declaration fail:
>> static portCHAR BufferRx[TAM_RX_RTU];  TAM_RX_RTU=2048.
>> Any advice?
>>
>> Regards
>> Thanks
>> Oscar
>>
>> The CODE today:
>>
>> while(1){
>>           FD_ZERO(&readset);
>>           maxfd=0;
>>           print_dbg(" Metemos los 3 Sockets por donde podemos recibir para
>> entrar en el select \n");
>>           for(i=1;i<4;i++)
>>            {
>>              FD_SET(aSocket[i], &readset);
>>              print_dbg("socket : ");
>>              print_dbg_ulong(aSocket[i]);
>>              print_dbg("\n ");
>>              if (aSocket[i]> maxfd)
>>               maxfd = aSocket[i];
>>            }
>>
>>
>>
>>
>>           // Check for received packets on configured sockets (blocking )
>>           ret = select(maxfd+1, &readset, NULL, NULL, NULL);
>>
>>           print_dbg("select ha entrado \n");
>>
>>           if (ret > 0) //No error
>>             {
>>               //Check data for socket 1
>>               if (FD_ISSET(aSocket[1], &readset))
>>                *  ProcessRequestPC_to_RTU(aSocket[1]); //DON¨T RECEIVE*
>>
>>               //Check data for socket 2
>>               if (FD_ISSET(aSocket[2], &readset))
>>               * ProcessRequestPC_to_PCU(aSocket[2]);* *//RECEIVE OK*
>>
>>               //Check data for socket 3
>>               if (FD_ISSET(aSocket[3], &readset))
>>             *   ProcessRequestPC_Finish(aSocket[3]); //RECEIVE OK*
>>
>>             }
>>           else
>>           {
>>               print_dbg(" Error en select \n");
>>               CloseConnectionPC(aSocket,lSocket );
>>               return;
>>           }
>>           }
>>           }
>>
>>
>> void static ProcessRequestPC_to_RTU (int s)
>> {
>>  int result,nbytesRx;
>>  long code_command,length_command;
>>
>>   print_dbg("Recibido mensaje RTU \n");
>>   nbytesRx=0; //Total=0;
>>
>>   result = recv(s, BufferRx, TAM_RX_RTU, 0);
>>   if (result<=0) //Error or close connection
>>    {
>>     print_dbg("Fallo Recv \n");
>>     CloseConnectionPC(aSocket,lSocket );
>>     return;
>>    }
>>   nbytesRx+=result; //Byte received
>>   print_dbg("Procesando RTU 1 \n");
>>   //Calculate the Length. ¡¡¡¡¡ I supposed that 4 byte are received always
>> TAKE CARE!!!!!!!
>>   memcpy(&length_command, BufferRx, LENGHT_RX);
>>   if (length_command!=nbytesRx)
>>   {
>>    do{
>>        result = recv(s, BufferRx+nbytesRx, length_command-nbytesRx, 0);
>>        if (result<=0) //Error or close connection
>>           {
>>            print_dbg("Fallo Recv \n");
>>            CloseConnectionPC(aSocket,lSocket );
>>            return;
>>           }
>>        print_dbg("Procesando RTU 2 \n");
>>        nbytesRx+=result;
>>
>>      } while (nbytesRx<length_command);
>>   }
>>   //All message is received
>>   memcpy(&code_command, BufferRx+LENGHT_RX,L_CODE_RX); //copy the code of
>> message
>>
>>   switch(code_command)
>>   {
>>
>>
>>   }
>> }
>>
>> void static ProcessRequestPC_to_PCU (int s)
>> {
>>     int result,nbytesRx;
>>      long code_command,length_command;
>>
>>      print_dbg("Recibido mensaje PCU \n");
>>      nbytesRx=0;
>>
>>       result = recv(s, BufferRx, TAM_RX_RTU, 0);
>>       if (result<=0)
>>        {
>>         print_dbg("Fallo Recv \n");
>>         CloseConnectionPC(aSocket,lSocket );
>>         return;
>>        }
>>       nbytesRx+=result;
>>
>>       //Calculate the Length
>>       memcpy(&length_command, BufferRx, LENGHT_RX);
>>       if (length_command!=nbytesRx)
>>       {
>>        do{
>>            result = recv(s, BufferRx+nbytesRx, length_command-nbytesRx,
>> 0);
>>            if (result<=0)
>>               {
>>                print_dbg("Fallo Recv \n");
>>                CloseConnectionPC(aSocket,lSocket );
>>                return;
>>               }
>>              nbytesRx+=result;
>>
>>          } while (nbytesRx<length_command);
>>       }
>>       //All message is received
>>       memcpy(&code_command, BufferRx+LENGHT_RX, L_CODE_RX); //copy the
>> code of message
>>
>>       switch(code_command)
>>       {
>>
>>
>>       }
>>
>> }
>>
>> void static ProcessRequestPC_Finish (int s)
>> {
>>     int result,nbytesRx;
>>     long code_command,length_command;
>>
>>      print_dbg("Recibido mensaje Finish \n");
>>      nbytesRx=0;
>>
>>       result = recv(s, BufferRx, TAM_RX_RTU, 0);
>>       if (result<=0)
>>        {
>>         print_dbg("Fallo Recv \n");
>>         CloseConnectionPC(aSocket,lSocket );
>>         return;
>>        }
>>       nbytesRx+=result;
>>
>>       print_dbg("Procesando finish 1 \n");
>>       //Calculate the Length
>>       memcpy(&length_command, BufferRx, LENGHT_RX);
>>       if (length_command!=nbytesRx)
>>       {
>>        do{
>>            result = recv(s, BufferRx+nbytesRx, length_command-nbytesRx,
>> 0);
>>            if (result<=0)
>>               {
>>                print_dbg("Fallo Recv \n");
>>                CloseConnectionPC(aSocket,lSocket );
>>                return;
>>               }
>>              print_dbg("Procesando finish 2 \n");
>>              nbytesRx+=result;
>>
>>          } while (nbytesRx<length_command);
>>       }
>>       //All message is received
>>       memcpy(&code_command, BufferRx+LENGHT_RX, L_CODE_RX); //copy the
>> code of message
>>        print_dbg("Comando recibido= ");
>>       print_dbg_ulong(code_command);
>>       print_dbg("\n Longitud= ");
>>       print_dbg_ulong(length_command);
>>       switch(code_command)
>>       {
>>         case ID_SPR_01:
>>                        print_dbg("\n cerramos pero falla");
>>                        CloseConnectionPC(aSocket,lSocket );
>>                        return;
>>
>>       }
>>
>> }
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Sep 30, 2009 at 4:44 PM, Kieran Mansley <[email protected]>wrote:
>>
>>> On Wed, 2009-09-30 at 12:48 +0200, Oscar F wrote:
>>> > Hello again, the problem continous, in this moment i have achived
>>> > accept the connection, then i have inserted in a select struct the
>>> > three request socket .
>>> >
>>> > When the customer send me a request i awake in select, but i can read
>>> > anything, the program block in recv. The size of this reception is
>>> > variable, in my first connection i ´must receive 10 bytes.
>>>
>>> My guess is that you're stuck in this bit:
>>>
>>> >   result = recv(s, BufferRx,sizeof(BufferRx), 0);    //Block the
>>> > program and i saw with wireshark that the message is full with 10
>>> > bytes
>>>
>>> What is sizeof(BufferRx)?  The recv() function may block waiting for the
>>> buffer to be full, so if you have given it a large buffer, you could
>>> have to wait a while for it to fill up and return.  If I remember from
>>> your earlier posts you don't have much memory allocated to network
>>> buffers, so it may be that there are just not enough network buffers to
>>> hold that amount of data, and it never gets full, and recv never
>>> returns.
>>>
>>> You could either:
>>>  1) give a smaller length argument to recv() - it sounds like you only
>>> want 10 bytes of data, so give it the value 10.
>>>  2) make recv non-blocking by passing the MSG_DONTWAIT flag in the flags
>>> argument - it will then return whatever data it can get (which may be
>>> nothing, but as select has said there is some it should return
>>> something).
>>>
>>> Kieran
>>>
>>>
>>>
>>> _______________________________________________
>>> lwip-users mailing list
>>> [email protected]
>>> http://lists.nongnu.org/mailman/listinfo/lwip-users
>>>
>>
>>
>
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to