lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Crash in tcp_output


From: Rustam Mustafin
Subject: [lwip-users] Crash in tcp_output
Date: Wed, 9 Dec 2020 01:28:41 +0500

Good afternoon!

I am using the latest lwip from git. Port from amazon-freertos https://github.com/aws/amazon-freertos/blob/master/libraries/3rdparty/lwip_osal/src/sys_arch.c.
FreeRTOS version 10.3.1. I attach the lwipopts.h configuration.

I create 4 interfaces, but now I use only 1. Receiving packets for each interface in a separate FreeRTOS task. Using sockets lwip create port 80 and do standard listen / accept for connections. After some time, I get an error accessing memory in the tcp_output function, I can only get the address of the instruction and the ASM code of the function. To make the error appear faster for testing, I run a request for the test.png file in the while loop.

I receive packets by allocating a buffer in PBUF_POOL:
struct pbuf * pBuf = pbuf_alloc (PBUF_RAW, t_sizeInBytes, PBUF_POOL);
if (pBuf! = NULL) {
for (q = pBuf; q! = NULL; q = q-> next) {
memcpy (q-> payload, pack, q-> len);
pack = pack + q-> len;
}
}
return pBuf;

Request processing pseudocode(all in 1 task):
sock = accept;
read (sock);
write (sock);
shutdown (sock, RDRW);
close (sock);

If I run wget of the file from the device in a while loop:
while:; do (wget -c 192.168.1.1/test.png && rm test.png); done
In a couple of minutes I get an assert message or a crash:
Assertion "tcp_receive: valid queue length" failed at line 1134 in src / lwip / src / core / tcp_in.

Crash is obtained in the tcp_output function after calling lwip_htonl.
Any idea why this might be?

Best regards,
Rustam Mustafin

Attachment: lwipopts.h
Description: Text Data


reply via email to

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