torproject / tor Public
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
Bug31571 035 #1277
Merged
torproject-pusher
merged 5 commits into
torproject:maint-0.3.5
from
teor2345:bug31571_035
Dec 5, 2019
Merged
Bug31571 035 #1277
torproject-pusher
merged 5 commits into
torproject:maint-0.3.5
from
teor2345:bug31571_035
Dec 5, 2019
Conversation
We want to report the tor version, even on platforms that don't have backtrace support (like Android). This commit stores the backtrace Tor version, regardless of USE_BACKTRACE. Preparation for 31571.
Previously, we just logged it in the crash handler. Part of 31571.
…ation Some platforms (macOS, maybe others?) can swallow the last write before an abort. This issue is probably caused by a race condition between write buffer cache flushing, and process termination. So we write an extra newline, to make sure that the message always gets through. Fixes bug 31571; bugfix on 0.3.5.1-alpha.
Pull Request Test Coverage Report for Build 6038
|
nmathewson
reviewed
Aug 30, 2019
src/lib/err/backtrace.c
Outdated
| @@ -274,7 +270,10 @@ configure_backtrace_handler(const char *tor_version) | |||
| snprintf(version, sizeof(version), "Tor %s", tor_version); | |||
| } | |||
|
|
|||
| return install_bt_handler(version); | |||
| strncpy(bt_version, version, sizeof(bt_version) - 1); | |||
In general our style is to prefer strlcpy unless there is a strong reason not to use it.
I moved the previous implementation between functions.
I can change the whole module to use strlcpy() in another commit?
ac929fb
to
eb99d49
We can't use strlcat() or strlcpy() in torerr, because they are defined in string/compat_string.h on some platforms, and string uses torerr. Part of 31571.
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.
No description provided.
The text was updated successfully, but these errors were encountered: