[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Last call for 1.4.0rc1 issues
From: |
Paul Archer |
Subject: |
Re: [lwip-users] Last call for 1.4.0rc1 issues |
Date: |
Fri, 17 Sep 2010 12:21:30 +1000 |
Hey Kieran,
I sent this to the list a few weeks ago, but never got a response. I
am not 100% sure if it is lwip's issue, or whether its something I
have incorrectly done. Either way its something I would raise as an
issue in rc1.
Regards Paul
From: Paul Archer <address@hidden>
To: address@hidden
Date: Thu, 2 Sep 2010 12:31:50 +1000
Subject: 1.4.0.rc1 Assert in pbuf_free() when using lwip_close()
Hi all,
I have an assert being raised in pbuf_free() from an invalid pbuf type.
I open a UDP socket, send threw some packets and receive some packets.
Then if I try to close the UDP socket I get
An assert in pbuf_free() with
pbuf_free()
pbuf_free: sane type
If it helps I am running it with FreeRTOS version 6.0.2
I have attached my lwip system function calls (sys-arch.c) and also my
lwipopts.h
I have traced the code and it seems to follow
lwip_close()
free_socket()
netbuf_delete()
pbuf_free()
What this means is that buf->p is being either corrupted (somewhere in
my code of somewhere in lwip) or its being freed in the incorrect
order, and hence freed once in use again.
The code I used to trigger this was:
struct sockaddr_in sLocalAddr;
int lSocket;
if ((lSocket = lwip_socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
free(socket);
DTRACE("Unable to find a spare UDP Socket");
return NULL;
}
memset(&sLocalAddr, 0, sizeof(sLocalAddr));
/*Source*/
sLocalAddr.sin_family = AF_INET;
sLocalAddr.sin_len = sizeof(sLocalAddr);
sLocalAddr.sin_addr.s_addr = htonl(INADDR_ANY);
sLocalAddr.sin_port = src->port;
if (lwip_bind(lSocket, (struct sockaddr *)&sLocalAddr,
sizeof(sLocalAddr)) < 0) {
lwip_close(lSocket);
DTRACE("Unable to bind to port %d", ntohs(src->port));
return NULL;
}
//A couple of
nbytes = lwip_recvfrom((int)sock->data, buf, len, flags,
(struct sockaddr *)&sFromAddr, &from_len);
//and a few
nbytes = lwip_sendto((int)sock->data, buf, len, 0, (struct sockaddr
*)&sDestAddr, sizeof(sDestAddr));
//Then
lwip_close(lSocket);
pbuf_free()
pbuf_free(): type 176
pbuf_free: sane type
On Thu, Sep 16, 2010 at 11:23 PM, Kieran Mansley <address@hidden> wrote:
> If anyone knows of any problems with lwIP 1.4.0rc1 and they haven't yet
> published them, please do so. If I don't hear of anything major I'll
> make the proper release.
>
> Thanks
>
> Kieran
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
--
----
Regards
Paul Archer
address@hidden