Closed simoberny closed 2 years ago
There's a recent patch (https://github.com/an-tao/trantor/pull/225?w=1) which seems to be related to your problem, please try using the latest version of drogon.
Yes, it works. I think I missed that patch for a few hours. Thank you!
Describe the bug I'm using Drogon in my project and everything works as expected in running status. When I try to quit() and gently close the application, I randomly get Segmentation fault, even Bus error in rare case. I'am using Drogon in a separate thread
To Reproduce In the main thread, I call a thread on startServer() function When on some event I close application and I call stopServer(), I get seg fault. This is not due to the premature exit of application.
I tried other solutions also following your tests, some seem to improve the situation, but randomly it always returns to the seg fault state.
Expected behavior I need Drogon to gently close on command.
Desktop:
Additional context I debugged using Valgrind and obtained the following:
Valgrind log
### ``` ==8034== Thread 8 DrogonIoLoop: ==8034== Invalid read of size 8 ==8034== at 0x6170600: std::_Rb_tree_increment(std::_Rb_tree_node_base const*) (in /usr/lib/libstdc++.so.6.0.28) ==8034== by 0xACFC8F: std::_Rb_tree_const_iterator