Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl_tls.c:5875 alloc(16717 bytes) failed (IDFGH-4286) #2673

Closed
zhaochengwei opened this issue Nov 6, 2018 · 8 comments
Closed

ssl_tls.c:5875 alloc(16717 bytes) failed (IDFGH-4286) #2673

zhaochengwei opened this issue Nov 6, 2018 · 8 comments

Comments

@zhaochengwei
Copy link

image
As you can see, 16384 is TLS maximum message content length.But I met this problem, So what's the problem?
image

esp-idf v3.1

@negativekelvin
Copy link
Contributor

You probably ran out of free heap. You need 40k to do ssl with full length buffers.

@zhaochengwei
Copy link
Author

You probably ran out of free heap. You need 40k to do ssl with full length buffers.

So, how can I enlarge my full length buffers?

@negativekelvin
Copy link
Contributor

No, it means there is not enough memory available. You can try some of the menuconfig option for asymmetric buffers or reduce your app memory usage or use wrover/psram.

@zhaochengwei
Copy link
Author

No, it means there is not enough memory available. You can try some of the menuconfig option for asymmetric buffers or reduce your app memory usage or use wrover/psram.

OK,I solved the problem thank you !

@Jigar3690
Copy link

@zhaochengwei How did you resolved it? I am facing the same issue with exact same number of bytes!
mbedtls: ssl_tls.c:6893 alloc(16717 bytes) failed I did enough memory leak analysis already. Tried increasing the stack size as well. But no change.

@github-actions github-actions bot changed the title ssl_tls.c:5875 alloc(16717 bytes) failed ssl_tls.c:5875 alloc(16717 bytes) failed (IDFGH-4286) Nov 18, 2020
0xFEEDC0DE64 pushed a commit to 0xFEEDC0DE64/esp-idf that referenced this issue May 5, 2021
@VitoLeo92
Copy link

VitoLeo92 commented Nov 22, 2022

No, it means there is not enough memory available. You can try some of the menuconfig option for asymmetric buffers or reduce your app memory usage or use wrover/psram.

OK,I solved the problem thank you !

@zhaochengwei How did you resolved it?

@HamzaHajeir
Copy link

HamzaHajeir commented Jun 11, 2023

I'm having the exact same issue,
the number is a preprocessor-defined.
My heap is very large at the moment of the call H=143412 and the maximum heap block is also very large M=110580 :

             > altcp_tls: TCP_WND is smaller than the RX decrypion buffer, connection RX might stall!
04:10:41.028 > H4AT:1: H=143412 M=110580 S=4684
04:10:41.029 > IDF/components/mbedtls/mbedtls/library/ssl_tls.c:3857: alloc(16717 bytes) failed
04:10:41.030 > mbedtls_ssl_setup failed
04:10:41.031 > tcp_close: closing in State: CLOSED

@hitecSmartHome
Copy link

Facing the same issue. I also have enough max contigous heap block but calloc fails with mbedtls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants