diff options
author | Josh Gao <jmgao@google.com> | 2018-02-13 13:16:17 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-04-13 17:34:20 -0700 |
commit | 1cc7bd80a6bc7f0908ae05b904cf9a0609609880 (patch) | |
tree | 6ade74f70af25a28e6164f287814de91c85530c1 /debuggerd/debuggerd_test.cpp | |
parent | 07de83831f9a2bf67e1c4a4df72baed42b26c7e9 (diff) |
debuggerd: remove maximum abort message length.
Let the logging implementation be the imposer of limits.
Bug: http://b/64759619
Test: debuggerd_test
Change-Id: I8bc73bf2301ce071668993b740880224846a4e75
Diffstat (limited to 'debuggerd/debuggerd_test.cpp')
-rw-r--r-- | debuggerd/debuggerd_test.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index 397ff2f11..e410be910 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp @@ -354,7 +354,14 @@ TEST_F(CrasherTest, abort_message) { int intercept_result; unique_fd output_fd; StartProcess([]() { - android_set_abort_message("abort message goes here"); + // Arrived at experimentally; + // logd truncates at 4062. + // strlen("Abort message: ''") is 17. + // That's 4045, but we also want a NUL. + char buf[4045 + 1]; + memset(buf, 'x', sizeof(buf)); + buf[sizeof(buf) - 1] = '\0'; + android_set_abort_message(buf); abort(); }); StartIntercept(&output_fd); @@ -366,7 +373,7 @@ TEST_F(CrasherTest, abort_message) { std::string result; ConsumeFd(std::move(output_fd), &result); - ASSERT_MATCH(result, R"(Abort message: 'abort message goes here')"); + ASSERT_MATCH(result, R"(Abort message: 'x{4045}')"); } TEST_F(CrasherTest, abort_message_backtrace) { |