Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upResolve multithread crash (#175) #225
Conversation
codecov
bot
commented
Dec 11, 2018
•
Codecov Report
@@ Coverage Diff @@
## master #225 +/- ##
==========================================
+ Coverage 93.69% 97.57% +3.87%
==========================================
Files 37 37
Lines 984 1113 +129
Branches 59 0 -59
==========================================
+ Hits 922 1086 +164
+ Misses 29 27 -2
+ Partials 33 0 -33
Continue to review full report at Codecov.
|
And for this one as well, I'll review them at the same time (this week some time). |
dossjh
commented
Jul 4, 2019
•
@qchateau I am using your fork, however muiltthread servers still crash for me. As soon as the client closes the connection regardless if the client is doing async or not. Do you have any ideas? |
I don't have much time atm but send me a sample code to reproduce your crash and I'll take a look |
dossjh
commented
Jul 11, 2019
•
Ok, I have figured out what the cause is, and created a MWE. in the calculator example if you replace the subtraction function with: Then you change the server to run async(4) (for example, any thing more than 1 will cause the crash). Then close the client before the function returns. The server will crash immediately. I consider myself a beginner, but I really love this RPC implementation, it is the simplest I have seen, so I will see if I can figure something out! |
dossjh
commented
Jul 15, 2019
@qchateau I know you said you dont have much time so i made a gist with the proper code. The example client doesn't need to be modified. server: https://gist.github.com/dossjh/582b050802a9634df756b0e9c0969baa Thanks for your help. |
I don't know how you get there. Testing it on my fork and it runs without troubles. I replaced
I'm using Ubuntu 18.10, GCC 8.3.0, and compiled in Release mode. |
qchateau commentedDec 11, 2018
•
edited
Hi, the main goal of this PR is to solve issue #175. Here is the description of what each commit does:
a0e6123 : Add a unit test reproducting issue #175
b18569a : fix thread safety in session management
8a98779 : Prevent the server_session to be destroyed while its closing code is still queued, causing a segfault
b134678 : Fixed socket double close. If (exit_) is true, then the session is already closed and the socket_.close() is queued
We use your library actively, please give me a feedback on this PR so it could be accepted in the official repository. It would be beneficial for everyone to avoid another fork.