Skip to content
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
merged 5 commits into from Dec 5, 2019
Merged

Bug31571 035 #1277

merged 5 commits into from Dec 5, 2019

Conversation

Labels
None yet
Projects
None yet
4 participants
@teor2345
Copy link
Contributor

@teor2345 teor2345 commented Aug 30, 2019

No description provided.

teor2345 added 4 commits Aug 30, 2019
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.
@coveralls
Copy link

@coveralls coveralls commented Aug 30, 2019

Pull Request Test Coverage Report for Build 6038

  • 11 of 15 (73.33%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 60.412%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib/err/backtrace.c 11 13 84.62%
src/lib/err/torerr.c 0 2 0.0%
Totals Coverage Status
Change from base Build 6000: 0.1%
Covered Lines: 42966
Relevant Lines: 71122

💛 - Coveralls

@@ -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);
Copy link
Contributor

@nmathewson nmathewson Aug 30, 2019

In general our style is to prefer strlcpy unless there is a strong reason not to use it.

Copy link
Contributor Author

@teor2345 teor2345 Aug 30, 2019

I moved the previous implementation between functions.

I can change the whole module to use strlcpy() in another commit?

Copy link
Contributor Author

@teor2345 teor2345 Sep 3, 2019

Fixed in ac929fb

src/lib/err/torerr.c Show resolved Hide resolved
@teor2345 teor2345 force-pushed the bug31571_035 branch 2 times, most recently from ac929fb to eb99d49 Sep 4, 2019
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.
@torproject-pusher torproject-pusher merged commit f311d06 into torproject:maint-0.3.5 Dec 5, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment