You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/07/27 07:50:56 UTC

[GitHub] [incubator-brpc] acelyc111 opened a new issue #1186: 编译ASAN版本报错

acelyc111 opened a new issue #1186:
URL: https://github.com/apache/incubator-brpc/issues/1186


   **Describe the bug (描述bug)**
   尝试编译ASAN版本的brpc库,将CMakeLists.txt修改:
   ```
   < set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer")
   ---
   > set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -O1 -fsanitize=address -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer")
   ```
   链接报错:
   ```
   [ 97%] Linking CXX executable ../../output/bin/rpc_press
   `.note.GNU-stack' referenced in section `.init_array.00099' of CMakeFiles/OBJ_LIB.dir/bthread/context.cpp.o: defined in discarded section `.note.GNU-stack' of CMakeFiles/OBJ_LIB.dir/bthread/context.cpp.o
   collect2: error: ld returned 1 exit status
   make[2]: *** [output/lib/libbrpc.so] Error 1
   make[1]: *** [src/CMakeFiles/brpc-shared.dir/all] Error 2
   make[1]: *** Waiting for unfinished jobs....
   ../../output/lib/libbrpc.a(file_path.cc.o): In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const':
   /usr/include/c++/7.3.0/bits/basic_string.h:912: undefined reference to `__asan_report_load8'
   ```
   
   **To Reproduce (复现方法)**
   -
   
   **Expected behavior (期望行为)**
   编译链接通过
   
   **Versions (各种版本)**
   OS:
   Compiler:
   brpc:
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] acelyc111 commented on issue #1186: 编译ASAN版本报错

Posted by GitBox <gi...@apache.org>.
acelyc111 commented on issue #1186:
URL: https://github.com/apache/incubator-brpc/issues/1186#issuecomment-671176220


   > "undefined reference to `__asan_report_load8'" reports a linking error, maybe you can try to add '-lasan'.
   
   @lorinlee Thanks! After I adding '-lasan', another link error reported: 
   ```
   `.note.GNU-stack' referenced in section `.init_array.00099' of ../../output/lib/libbrpc.a(context.cpp.o): defined in discarded section `.note.GNU-stack' of ../../output/lib/libbrpc.a(context.cpp.o)
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] lorinlee commented on issue #1186: 编译ASAN版本报错

Posted by GitBox <gi...@apache.org>.
lorinlee commented on issue #1186:
URL: https://github.com/apache/incubator-brpc/issues/1186#issuecomment-670528397


   "undefined reference to `__asan_report_load8'" reports a linking error, maybe you can try to add '-lasan'.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] warriorpaw commented on issue #1186: 编译ASAN版本报错

Posted by GitBox <gi...@apache.org>.
warriorpaw commented on issue #1186:
URL: https://github.com/apache/incubator-brpc/issues/1186#issuecomment-730384034


   > > "undefined reference to `__asan_report_load8'" reports a linking error, maybe you can try to add '-lasan'.
   > 
   > @lorinlee Thanks! After I adding '-lasan', another link error reported:
   > 
   > ```
   > `.note.GNU-stack' referenced in section `.init_array.00099' of ../../output/lib/libbrpc.a(context.cpp.o): defined in discarded section `.note.GNU-stack' of ../../output/lib/libbrpc.a(context.cpp.o)
   > ```
   
   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47071
   context.cpp里汇编写的不规范导致的,参照这个链接,在你所在平台对应的两个汇编函数结尾加上 一行".previous" "\n"就行了。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] acelyc111 commented on issue #1186: 编译ASAN版本报错

Posted by GitBox <gi...@apache.org>.
acelyc111 commented on issue #1186:
URL: https://github.com/apache/incubator-brpc/issues/1186#issuecomment-677673679


   @lorinlee 
   Versions (各种版本)
   OS: CentOS Linux release 7.5.1804
   Compiler: g++ 7.3.0
   brpc: 0.9.5
   protobuf: 3.5.1
   
   In fact I'm using a Apache Doris's build docker image: apachedoris/doris-dev:build-env-1.2
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] lorinlee commented on issue #1186: 编译ASAN版本报错

Posted by GitBox <gi...@apache.org>.
lorinlee commented on issue #1186:
URL: https://github.com/apache/incubator-brpc/issues/1186#issuecomment-676348098


   @acelyc111 please provide more information about the environment, thx, such as
   Versions (各种版本)
   OS:
   Compiler:
   brpc:
   protobuf:


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org