-
Notifications
You must be signed in to change notification settings - Fork 4k
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
使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11 #2025
Comments
贴下core栈信息:
|
是mac才会有的问题,以下是lldb的backtrace:
|
看着不太像,编译没开debug吧 |
应该打开了,dyld是ios系统main执行前的动态链接器?我把LINK_SO打开后bt好像详细了点,问题似乎出在class_name.cpp里面?
|
@SillyBoyenjoy 可以试试PR #2037 |
class_name.cpp的问题修复了,后面level db的动态库加载也出现了coredump,采用静态库编译解决了。 |
@SillyBoyenjoy 确定问题是修复了吗,今天新clone的代码,运行cmake生成文件,执行就报错 ~/Develop/c/brpc/example/echo_c++ origin/release-1.4 cmake -B build && cmake --build build Update the VERSION argument value or use a ... suffix to tell -- The C compiler identification is AppleClang 12.0.5.12050022 ~/Develop/c/brpc/example/echo_c++ origin/release-1.4 ./build/echo_server |
Describe the bug (描述bug)
请问为什么我用cmake编译example里echo_c++里的echo_server进程启动即Segmentation fault: 11,但是直接用Makefile的make编译正常?
Versions (各种版本)
OS:macOS Monterey 12.2.1
Compiler:Clang
brpc:1.3.0
protobuf:3.17.3
cmake version 3.21.3
Additional context/screenshots (更多上下文/截图)
MacBook-Pro:echo_c++ sillyboyenjoy$ cmake -B build && cmake --build build && ./build/echo_server
CMake Deprecation Warning at CMakeLists.txt:18 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Protobuf: /opt/homebrew/lib/libprotobuf.dylib (found version "3.17.3")
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- CMAKE_CXX_FLAGS: -DGFLAGS_NS=google -DNDEBUG -O2 -D__const__=unused -pipe -W -Wall -Wno-unused-parameter -fPIC -fno-omit-frame-pointer -Wno-deprecated-declarations -Wno-inconsistent-missing-override
-- CMAKE_CXX_COMPILER_ID:Clang
-- Found OpenSSL: /opt/homebrew/Cellar/openssl@3/3.0.0/lib/libcrypto.dylib (found version "3.0.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/sillyboyenjoy/Project/incubator-brpc/example/echo_c++/build
[ 12%] Running cpp protocol buffer compiler on echo.proto
[ 25%] Building CXX object CMakeFiles/echo_server.dir/server.cpp.o
[ 37%] Building CXX object CMakeFiles/echo_server.dir/echo.pb.cc.o
[ 50%] Linking CXX executable echo_server
[ 50%] Built target echo_server
[ 62%] Building CXX object CMakeFiles/echo_client.dir/client.cpp.o
[ 75%] Building CXX object CMakeFiles/echo_client.dir/echo.pb.cc.o
[ 87%] Linking CXX executable echo_client
[100%] Built target echo_client
Segmentation fault: 11
The text was updated successfully, but these errors were encountered: