You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been spending some time today trying to understand why the simplest Poco application with a web server was crashing. After a lot of trials, I finally pinpointed the source of the problem.
If I send an http request which contains a body (size != 0) to my simple web server, after the timeout I have setup in HTTPServerParams, the application crashes with the following logs: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Timeout [in file "D:\xxxxxxxxx\ThirdParties\src\poco\Foundation\src\ErrorHandler.cpp", line 38] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
and the call stack displays this: Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: Poco::TimeoutException at memory location 0x000000B8826FE5B0. Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000. Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: Poco::TimeoutException at memory location 0x000000B8826FE5B0. Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: Poco::TimeoutException at memory location 0x000000B8826F9F20. Timeout [in file "D:\Dev\Git-CMake-tests\ThirdParties\src\poco\Foundation\src\ErrorHandler.cpp", line 38] A breakpoint instruction (__debugbreak() statement or a similar call) was executed in tests.exe.
I could reproduce that at least on Windows 11 with both VS2019 and VS2022. I tried to compile the same source code on an ARM Linux instance and the Poco::TimeoutException is not thrown in that case (haven't tried yet on an x86 Linux instance but I guess it will not crash).
To fix this, I have to call HTTPServerRequest::stream()::read(). When doing this on Windows web server, then the exception is not thrown.
Have two questions then:
any idea why the behavior is different on Windows and Linux?
why do we have to consume the body to avoid the crash? is there a real reason that I can't fathom?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been spending some time today trying to understand why the simplest Poco application with a web server was crashing. After a lot of trials, I finally pinpointed the source of the problem.
If I send an http request which contains a body (size != 0) to my simple web server, after the timeout I have setup in HTTPServerParams, the application crashes with the following logs:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Timeout [in file "D:\xxxxxxxxx\ThirdParties\src\poco\Foundation\src\ErrorHandler.cpp", line 38] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
and the call stack displays this:
Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: Poco::TimeoutException at memory location 0x000000B8826FE5B0. Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000. Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: Poco::TimeoutException at memory location 0x000000B8826FE5B0. Exception thrown at 0x00007FFA4C18051C in tests.exe: Microsoft C++ exception: Poco::TimeoutException at memory location 0x000000B8826F9F20. Timeout [in file "D:\Dev\Git-CMake-tests\ThirdParties\src\poco\Foundation\src\ErrorHandler.cpp", line 38] A breakpoint instruction (__debugbreak() statement or a similar call) was executed in tests.exe.
I could reproduce that at least on Windows 11 with both VS2019 and VS2022. I tried to compile the same source code on an ARM Linux instance and the
Poco::TimeoutException
is not thrown in that case (haven't tried yet on an x86 Linux instance but I guess it will not crash).To fix this, I have to call
HTTPServerRequest::stream()::read()
. When doing this on Windows web server, then the exception is not thrown.Have two questions then:
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions