-
Notifications
You must be signed in to change notification settings - Fork 197
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
fix #387: fix tls block #379
fix #387: fix tls block #379
Conversation
Options.cmake
Outdated
@@ -48,7 +48,7 @@ endif (ENABLE_SQL_IO) | |||
option(ENABLE_ASAN "Enable Address Sanitizer." OFF) | |||
if (ENABLE_ASAN) | |||
message("Address Sanitizer is enabled.") | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan") | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_ASAN -fsanitize=address -fno-omit-frame-pointer -static-libasan") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个做什么用?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看到下面了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DENABLE_ASAN 改完了删掉吧
test/test_cpp_procedure.cpp
Outdated
@@ -445,6 +452,23 @@ TEST_F(TestCppPlugin, CppPlugin) { | |||
"#include <stdlib.h>", (plugin::CodeType)6, | |||
"test", true, "v1")); | |||
} | |||
#ifndef ENABLE_ASAN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一般是#ifndef __SANITIZE_ADDRESS__
下面这里有内存问题?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asan下dlclose并不会真正卸载动态库,这是asan一直就有的问题了:google/sanitizers#89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我改成__SANITIZE_ADDRESS__吧
src/plugin/cpp_plugin.cpp
Outdated
throw InternalError("Failed to unload library [{}].", name); | ||
// using namespace lgraph::dll; | ||
// PluginInfo* info = dynamic_cast<PluginInfo*>(pinfo); | ||
// if (!UnloadDynamicLibrary(info->lib_handle)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释清掉,然后留一个函数头说明一下
@@ -33,6 +33,41 @@ CppPluginManagerImpl::CppPluginManagerImpl(LightningGraph* db, const std::string | |||
|
|||
CppPluginManagerImpl::~CppPluginManagerImpl() {} | |||
|
|||
void CppPluginManagerImpl::OpenDynamicLib(const PluginInfoBase* pinfo, DynamicLibinfo &dinfo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文件头加点儿注释说明一下tls block的问题吧
fix #387 |
fix tls block