-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
socket: tcp application crashes when there are no more net buffers in case of reception #33516
Comments
I ran I checked this viewing line 44 in I would try to manually update to 1.13.0 to see if there's a change in your issue. I'm not sure how to change this in Zephyr itself since this Cmake file is only generated when I build. This is how the Cmake code looks like on my end for reference: set(CIVETWEB_VERSION "1.11.0" CACHE STRING "The version of the civetweb library")
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" CIVETWEB_VERSION_MATCH "${CIVETWEB_VERSION}")
if ("${CIVETWEB_VERSION_MATCH}" STREQUAL "")
message(FATAL_ERROR "Must specify a semantic version: major.minor.patch")
endif()
set(CIVETWEB_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(CIVETWEB_VERSION_MINOR "${CMAKE_MATCH_2}")
set(CIVETWEB_VERSION_PATCH "${CMAKE_MATCH_3}")
message(STATUS "Found Civetweb version v${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}") # <-- I added this line |
@GunZi200 thank you for the quick replay. I tested also the modbus-tcp server with the same procedure and it works without any issue. It seems that the civetwebserver has some flaws. Cmake file at my side
|
I have updated civetweb from https://github.com/civetweb/civetweb Cmake file
|
Ok, I created a separate issue to update the version. #33520 Your issue is something else. Are you sure this is not a bug on civetweb’s end? Where in the code does the buffer overflow take place? I don’t have the board to test myself. Hopefully someone more familiar with the code can help you. |
Ok. I did a small research on this issue. As it seems, civetweb causing the overflow and is not related to socket api. I will close this issue.
|
@psanyi I've been looking into Zephyr's version of Civetweb more... I discovered that Zephyr uses this repo: https://github.com/zephyrproject-rtos/civetweb I looked into the history and am wondering if this commit (which is not used by Zephyrs revision) may help you?: zephyrproject-rtos/civetweb@3565451 specifically see this issue which looks very similar to yours: #27020 it was never resolved completely. I know Zephyr does not use this commit because this is what the compiled size looks like for your board:
After zephyrproject-rtos/civetweb@3565451:
But then again you tested with v1.14 and this did not fix the issue for you. Maybe some of these sizes in the sample's
|
Regarding stack sizes (this issue and the corresponding issue on CivetWeb civetweb/civetweb#981). Please either use a stack size of at least 16 kB, or shrink other buffers as well: Important: Reducing the stack size below 16 kB does not work without reducing MG_BUF_LEN. |
Here is my complete project configuration.
Footprint
Civet server config options
|
Tcp application crashes when receiving a huge packet and there are no more net buffers.
I reproduced this error on a Nucleo-144 (STM32F429) development board.
Steps to reproduce the behavior:
Prepare the board with a net app (e.g. civetweb)
cd zephyr
west build samples/net/civetweb/http_server -b nucleo_f429zi
west flash
Testing procedure:
Expected behavior
The stack should wait until the buffer frees or drop the packages to
prevent an overflow
Logs and console output
Environment:
The text was updated successfully, but these errors were encountered: