-
Notifications
You must be signed in to change notification settings - Fork 30
Crash woes #120
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
Closed
Closed
Crash woes #120
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For readability. Also may help with https://forum.rigsofrods.org/threads/rorserver-woes.3225/
And one compiler warning in "messaging.cpp".
77c3e75 to
eaf2e06
Compare
Collaborator
|
Got many AS warnings (i build with one warning and one error |
'pthread' was replaced by STL as threading/mutex provider. Socket setup - bind() and listen() is now done on main thread instead of complicated async setup with "ready" condition. Shutdown is now done by synchronously closing the listen-socket's file descriptor. The code which validates RoRnet connection was left mostly intact, just with some added error reporting.
pthread (with custom wrappers) replaced with STL thread. removed nonsense atomic `m_keep_running`, using single mutex with state enum.
Classic printf() vs. std::string.
Removed variable `SWBaseSocket::error_string` which was written and read on any error, without synchronization. This is a problem in Rigs of Rods server which uses each client socket from 2 threads: receiver and broadcaster. Function `SWBaseSocket::set_error()` was modified to only fill the supplied SWBaseError object, without touching anything in the SWBaseSocket object. Also, the function won't shut down the whole program with `exit()` anymore. "verbose mode" was removed completely.
Member
Author
|
Obsoleted by #143 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RoRserver crashes a lot. In effort to make gdb backtraces more informative, I partitioned the code to smaller functions. I also checked printf() format strings.
see https://forum.rigsofrods.org/threads/rorserver-woes.3225/
@tritonas00 If you get really bored, I found a tutorial (actually 2 explaining the same mechanism) how to pinpoint the exact crash site with gdb breakpoints: