[asio] windows service async server crashes after running for a while; though it works fine from console
I have an existing console async server that I converted to a windows service. After running for a while (about 1-2 hours), the service would eventually crash caused by stack overflow on different parts of the code (been trying different approach on the code that causes the stack overflow exception but to no avail as it would still crash on a different location) Now, I have been wondering if an async server approach is really suitable for a windows server or should I then opt to convert it to synchronous instead. I used the combination of *io_service::reset()* and* io_service::run() *to block the current code as I've read somewhere that thread running the *io_service::run()* shouldn't immediately exit if it is running as a windows service. Do note that my previous implementation was just calling the *io_service::run() *on another thread, but this doesn't seem to work as per the explanation and solution mentioned above.
On 23 July 2017 at 19:16, Kyoryu Kurayami via Boost
I have an existing console async server that I converted to a windows service. After running for a while (about 1-2 hours), the service would eventually crash caused by stack overflow on different parts of the code (been trying different approach on the code that causes the stack overflow exception but to no avail as it would still crash on a different location)
You may want to consider raising the initial stack commitment https://msdn.microsoft.com/en-us/library/35yc2tc3.aspx for the failing application. There's also an article https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugging... addressing this issue. degski -- "*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend, Schmerzen aus Schwäche stillend.*" - Novalis 1798
participants (2)
-
degski
-
Kyoryu Kurayami