ARMmbed / ARMmbed/sal-stack-lwip
tcp_echo_client test fails when trying to send 4096 byte packet
- Dominant language
- C
- Stars
- 4
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Hi
The tcp_echo_client test fails with the following error when trying to send a 4096 byte data packet:
`MBED: Failed to send 4096 bytes. err=Memory allocation failed`
The full serial console trace for the test is shown below.
```
$ mbedhtrun -v -d E: -f ".\build\frdm-k64f-gcc\test\sal-stack-lwip-test-tcp_echo_client.bin" -p COM40:9600 -C 4 -c default -m K64F -e test/host_tests
HOST: Inspecting 'd:\datastore\public\jobs\yr2016\2245\sdh_dev_3\sal-stack-lwip\test\host_tests' for local host tests...
HOST: Loading module 'sal_tcpclient.py':
HOST: Found host test implementation: sal_tcpclient.SalTcpClientTest -|> mbed_host_tests.host_tests.base_host_test.BaseHostTest
HOST: Registering 'sal_tcpclient.SalTcpClientTest' as 'sal_tcpclient'
HOST: Loading module 'sal_tcpserver.py':
HOST: Found host test implementation: sal_tcpserver.SalTcpServerTest -|> mbed_host_tests.host_tests.base_host_test.BaseHostTest
HOST: Registering 'sal_tcpserver.SalTcpServerTest' as 'sal_tcpserver'
HOST: Loading module 'sal_udpserver.py':
HOST: Found host test implementation: sal_udpserver.SalUdpServerTest -|> mbed_host_tests.host_tests.base_host_test.BaseHostTest
HOST: Registering 'sal_udpserver.SalUdpServerTest' as 'sal_udpserver'
MBED: Instrumentation: "COM40" and disk: "E:"
HOST: Copy image onto target...
1 file(s) copied.
HOST: Initialize serial port...
...port ready!
HOST: Reset target...
HOST: Detecting test case properties...
HOST: Property 'timeout' = '20'
HOST: Property 'host_test_name' = 'sal_tcpserver'
HOST: Property 'description' = 'SalTcpServerTest'
HOST: Property 'test_id' = 'Socket Abstract Layer TCP Connection/Tx/Rx Socket Stream Test'
HOST: Start test...
MBED: MBED: SAL TCP Client waiting for server IP and port...
MBED:
MBED:
HOST: Sending server IP Address to target...
MBED: MBED: Address received: 10.2.203.21:56101
MBED: TCP client IP Address is 10.2.203.161
HOST: Connection received...
MBED: MBED: TCPClient IP Address is 10.2.203.161
MBED: {{summary socket_api_test_connect_close [PASS] (0/18 FAILED)}}
MBED:
HOST: Connection received...
HOST: Received 32 bytes of data
MBED: socket_api_test_echo_client_connected af: 1, pf: 2, connect: 1, server: 10.2.203.21:56101
MBED: TARGET sent 32 bytes
MBED: TARGET received 32 bytes
HOST: Received 64 bytes of data
MBED: TARGET sent 64 bytes
MBED: TARGET received 64 bytes
HOST: Received 128 bytes of data
MBED: TARGET sent 128 bytes
MBED: TARGET received 128 bytes
HOST: Received 256 bytes of data
MBED: TARGET sent 256 bytes
MBED: TARGET received 256 bytes
HOST: Received 512 bytes of data
MBED: TARGET sent 512 bytes
MBED: TARGET received 512 bytes
HOST: Received 1024 bytes of data
MBED: TARGET sent 1024 bytes
MBED: TARGET received 1024 bytes
HOST: Received 2048 bytes of data
MBED: TARGET sent 2048 bytes
MBED: TARGET received 2048 bytes
MBED: socket_api_test_echo_client_connected:466 err!=SOCKET_ERROR_NONE [FAIL]
MBED: Failed to send 4096 bytes. err=Memory allocation failed
MBED: socket_api_test_echo_client_connected:507 timedout!=0 [FAIL]
MBED: socket_api_test_echo_client_connected:542 rx_bytes!=nWords * sizeof(uint16_t) [FAIL]
MBED: Expected 4096, got 0
MBED: socket_api_test_echo_client_connected:552 match!=true [FAIL]
MBED: Mismatch in 4096 byte packet at offset 4
MBED: {{summary socket_api_test_echo_client_connected [FAIL] (4/75 FAILED)}}
HOST: Connection received...
MBED: server:10.2.203.21:56101
HOST: Received 8 bytes of data
HOST: Requesting server shutdown
MBED: {{summary tcp_ec_send_shutdown_host_script [PASS] (0/12 FAILED)}}
MBED: {{failure}}
MBED: {{end}}
HOST: Terminating Test
HOST: Passive mode...
```
Thanks
Simon
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the tcp_echo_client test and the test/host_tests/sal_tcpclient.py host test, then reproduce the 4096-byte case using the command shown in the report. Trace the memory allocation failure after the 2048-byte send; done means the 4096-byte packet is sent, echoed, and the test summary passes without timeout or mismatch failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100