diff options
author | Loic Dachary <ldachary@redhat.com> | 2016-11-01 12:24:56 +0100 |
---|---|---|
committer | Loic Dachary <ldachary@redhat.com> | 2016-11-01 13:33:08 +0100 |
commit | 17fe16d46188c01fce4ca8f4581fab3807a9b0f1 (patch) | |
tree | e965ac461aad65f56a0f76a3057ded4c7aa1e6fd | |
parent | Merge pull request #11559 from dillaman/wip-17618 (diff) | |
download | ceph-17fe16d46188c01fce4ca8f4581fab3807a9b0f1.tar.xz ceph-17fe16d46188c01fce4ca8f4581fab3807a9b0f1.zip |
tests: TestErasureCodePluginJerasure must stop the log thread
When a log entry is created in dout.h, it holds a pointer to the
static size_t _log_exp_length
variable. When OnExitManager::~OnExitManager from Log.cc is called
during global destruction, it may happen after the static variables
referenced by some entries have been deallocated. The flush() function
will try to access these deallocated variables via the hint_size()
method and core dump.
To prevent this race, the Log::stop() method must be called explicitly
to ensure no entries are left when the global destructors are called.
Fixes: http://tracker.ceph.com/issues/17561
Signed-off-by: Loic Dachary <ldachary@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | src/test/erasure-code/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/test/erasure-code/TestErasureCodePluginJerasure.cc | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/test/erasure-code/CMakeLists.txt b/src/test/erasure-code/CMakeLists.txt index d987a1a677d..c829822bd36 100644 --- a/src/test/erasure-code/CMakeLists.txt +++ b/src/test/erasure-code/CMakeLists.txt @@ -81,7 +81,7 @@ target_link_libraries(unittest_erasure_code add_executable(unittest_erasure_code_plugin_jerasure TestErasureCodePluginJerasure.cc ) -#add_ceph_unittest(unittest_erasure_code_plugin_jerasure ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_jerasure) +add_ceph_unittest(unittest_erasure_code_plugin_jerasure ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_jerasure) target_link_libraries(unittest_erasure_code_plugin_jerasure global osd diff --git a/src/test/erasure-code/TestErasureCodePluginJerasure.cc b/src/test/erasure-code/TestErasureCodePluginJerasure.cc index 9b1e1c7d389..ff90c8e35ae 100644 --- a/src/test/erasure-code/TestErasureCodePluginJerasure.cc +++ b/src/test/erasure-code/TestErasureCodePluginJerasure.cc @@ -20,6 +20,7 @@ #include "global/global_init.h" #include "erasure-code/ErasureCodePlugin.h" #include "common/ceph_argparse.h" +#include "log/Log.h" #include "global/global_context.h" #include "common/config.h" #include "gtest/gtest.h" @@ -73,7 +74,9 @@ int main(int argc, char **argv) g_conf->set_val("erasure_code_dir", directory, false, false); ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + int status = RUN_ALL_TESTS(); + g_ceph_context->_log->stop(); + return status; } /* |