lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] lwip lock


From: Tazzari Davide
Subject: Re: [lwip-users] lwip lock
Date: Mon, 18 Apr 2011 10:17:27 +0200

New information about the problem.
I have seen that probably my UDP server was not correctly written as Kieran supposed.

Here are my changes

 

portTASK_FUNCTION( vBasicUDPCOMSERVER, pvParameters )

{

static struct netconn *conn;

static struct netbuf * pxRxBuffer;

struct ip_addr *addr;

struct ip_addr destip;

unsigned int uiTxLen;

char pcTxData[BUFFER_LENGTH];

char * pcRxData;

    conn = netconn_new(NETCONN_UDP);

    netconn_bind(conn, NULL, UDPCOMNET_PORT);

 

    for (;;)

    {

        pxRxBuffer = netconn_recv(conn);

        if (pxRxBuffer != NULL)

        {

            addr = netbuf_fromaddr(pxRxBuffer);

            destip = *addr;

            unsigned short usLength = pxRxBuffer->p->tot_len;

            pcRxData = (char *) pvPortMalloc(usLength);

            if (pcRxData != NULL)

            {

                netbuf_copy(pxRxBuffer, pcRxData, usLength);

                InitTxBuffer(pcTxData);

                uiTxLen = VsInterpreter(usLength, (char *) pcRxData, (char *) pcTxData, BUFFER_LENGTH);

                vPortFree(pcRxData);

                if (uiTxLen > 0)

                {

                    struct netbuf * pxTxBuffer;

                    pxTxBuffer = netbuf_new();

                    // Reference the request data into net_buf

                    netbuf_ref( pxTxBuffer , pcTxData , uiTxLen );

                    netconn_sendto(conn, pxTxBuffer, & destip, UDPCOMNET_PORT);

                    netbuf_delete(pxTxBuffer);

                }

            }

            netbuf_delete(pxRxBuffer); // De-allocate packet buffer

        }

    }

}

 

Of course, nothing has changed because my problem happens even with only web server activated. Anyway, both udp servers has been changed

 

I have done other tests.

With explorer I asked for the same page: a very simple page with few data, no images, no js … nothing but that page. First load ok. Second, third, fourth and so on ok but, when I pressed F5 to reload the page faster, after some correct reloads everything stops.

I have used wireshark.

Often, I have seen that my browser sends a [SYN] with no answer from the device

Sometimes (very very  few), after a [SYN] I immediatly receive a [RST, ACK].

 

As you may remember from my last post every access to the web server creates a new task to serve it.

At the beginning I have 28 tasks running; after the crash I have 28 tasks running. So, no tasks has been left frozen or stucked

The TCP_SEG pcb seems completely lost as written in my first post.  

TCP_SEG Stats: Max Used 12, Max 12, Used 12, Error 23

The error is growning up one per each requests. Firefox makes 3 requests per reload and the error has grown from 23 to 26

 

I have seen also that the SYS_TIMEOUT has a lot  of errors: 188!

In this case the stats are Max Used 6, Max 6, Used 1, Error 188

After a request, the error doesn’t increase.

 

Last, but not least, the mem ram pointer address.

As written in the first post the lfree pointer is stucked to an intermediate address

I suppose that TCP_SEG and the lfree stucked pointer are related but I don’t know why.

 

Any further idea?

Does anybody need other tests to investigate?

 

Best regards

Davide

 

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]