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 2022/11/28 08:26:10 UTC

[GitHub] [incubator-brpc] SillyBoyenjoy opened a new issue, #2025: 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11

SillyBoyenjoy opened a new issue, #2025:
URL: https://github.com/apache/incubator-brpc/issues/2025

   **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 <min> value or use a ...<max> 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
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org.apache.org

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


Re: [I] 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11 (brpc)

Posted by "SillyBoyenjoy (via GitHub)" <gi...@apache.org>.
SillyBoyenjoy closed issue #2025: 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11
URL: https://github.com/apache/brpc/issues/2025


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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] leaf-potato commented on issue #2025: 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11

Posted by GitBox <gi...@apache.org>.
leaf-potato commented on issue #2025:
URL: https://github.com/apache/incubator-brpc/issues/2025#issuecomment-1330685155

   贴下core栈信息:
   1. `ulimit -c unlimited` 开启coredump
   2. `gdb echo_server ${coredump}` 查看core栈信息


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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


Re: [I] 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11 (brpc)

Posted by "SillyBoyenjoy (via GitHub)" <gi...@apache.org>.
SillyBoyenjoy commented on issue #2025:
URL: https://github.com/apache/brpc/issues/2025#issuecomment-1442750138

   class_name.cpp的问题修复了,后面level db的动态库加载也出现了coredump,采用静态库编译解决了。


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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] SillyBoyenjoy commented on issue #2025: 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11

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

   应该打开了,dyld是ios系统main执行前的动态链接器?我把LINK_SO打开后bt好像详细了点,问题似乎出在class_name.cpp里面?
   * thread 1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
     * frame 0: 0x0000000000000000
       frame 1: 0x00000001012e071c libbrpc.dylib`butil::demangle(name=<unavailable>) at class_name.cpp:54:9 [opt]
       frame 2: 0x00000001000057f0 echo_server`::__cxx_global_var_init.24() at class_name.h:35:62 [opt]
       frame 3: 0x0000000100031c1c dyld`invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 164
       frame 4: 0x000000010005afcc dyld`invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 340
       frame 5: 0x0000000100051988 dyld`invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 532
       frame 6: 0x000000010001df98 dyld`dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 168
       frame 7: 0x000000010005172c dyld`dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
       frame 8: 0x000000010005aa14 dyld`dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 516
       frame 9: 0x0000000100031b5c dyld`dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 172
       frame 10: 0x0000000100031d00 dyld`dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 208
       frame 11: 0x0000000100031dcc dyld`dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 124
       frame 12: 0x0000000100046db4 dyld`dyld4::APIs::runAllInitializersForMain() + 312
       frame 13: 0x0000000100021e00 dyld`dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3100
       frame 14: 0x00000001000210d4 dyld`start + 488


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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


Re: [I] 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11 (brpc)

Posted by "SillyBoyenjoy (via GitHub)" <gi...@apache.org>.
SillyBoyenjoy commented on issue #2025:
URL: https://github.com/apache/brpc/issues/2025#issuecomment-1442750503

   class_name.cpp的问题修复了,后面level db的动态库加载也出现了coredump,采用静态库编译解决了。


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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] leaf-potato commented on issue #2025: 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11

Posted by GitBox <gi...@apache.org>.
leaf-potato commented on issue #2025:
URL: https://github.com/apache/incubator-brpc/issues/2025#issuecomment-1334723850

   看着不太像,编译没开debug吧


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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


Re: [I] 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11 (brpc)

Posted by "zyong (via GitHub)" <gi...@apache.org>.
zyong commented on issue #2025:
URL: https://github.com/apache/brpc/issues/2025#issuecomment-1455035079

   @SillyBoyenjoy 确定问题是修复了吗,今天新clone的代码,运行cmake生成文件,执行就报错
   OS:macOS Ventura 13.2.1 (22D68)
   Compiler:Clang
   brpc:1.4.0. master版本测试也不行
   protobuf:3.15.8
   cmake version 3.20.1
   
    ~/Develop/c/brpc/example/echo_c++   origin/release-1.4  cmake -B build && cmake --build build
   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 <min> value or use a ...<max> suffix to tell
     CMake that the project does not need compatibility with older versions.
   
   
   -- The C compiler identification is AppleClang 12.0.5.12050022
   -- The CXX compiler identification is AppleClang 12.0.5.12050022
   -- 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: /usr/local/lib/libprotobuf.dylib (found version "3.15.8")
   -- Looking for clock_gettime
   -- Looking for clock_gettime - found
   -- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.1.1k")
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /Users/zhaoyong/Develop/c/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
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:20:9: warning: 'OSAtomicCompareAndSwap32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap32(old_value, new_value,
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:503:9: note: 'OSAtomicCompareAndSwap32' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:34:13: warning: 'OSAtomicCompareAndSwap32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     } while (!OSAtomicCompareAndSwap32(old_value, new_value,
               ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:503:9: note: 'OSAtomicCompareAndSwap32' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:41:10: warning: 'OSAtomicAdd32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd32(increment, const_cast<Atomic32*>(ptr));
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:147:9: note: 'OSAtomicAdd32' has been explicitly marked deprecated here
   int32_t OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:46:10: warning: 'OSAtomicAdd32Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd32Barrier(increment, const_cast<Atomic32*>(ptr));
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:162:9: note: 'OSAtomicAdd32Barrier' has been explicitly marked deprecated here
   int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:50:3: warning: 'OSMemoryBarrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_thread_fence() from <atomic> instead [-Wdeprecated-declarations]
     OSMemoryBarrier();
     ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:750:9: note: 'OSMemoryBarrier' has been explicitly marked deprecated here
   void    OSMemoryBarrier( void );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:58:9: warning: 'OSAtomicCompareAndSwap32Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong() from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap32Barrier(old_value, new_value,
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:519:9: note: 'OSAtomicCompareAndSwap32Barrier' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:111:9: warning: 'OSAtomicCompareAndSwap64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap64(old_value, new_value,
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:629:9: note: 'OSAtomicCompareAndSwap64' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:125:13: warning: 'OSAtomicCompareAndSwap64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     } while (!OSAtomicCompareAndSwap64(old_value, new_value,
               ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:629:9: note: 'OSAtomicCompareAndSwap64' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:132:10: warning: 'OSAtomicAdd64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd64(increment, reinterpret_cast<volatile int64_t*>(ptr));
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:232:9: note: 'OSAtomicAdd64' has been explicitly marked deprecated here
   int64_t OSAtomicAdd64( int64_t __theAmount,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:137:10: warning: 'OSAtomicAdd64Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd64Barrier(increment,
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:248:9: note: 'OSAtomicAdd64Barrier' has been explicitly marked deprecated here
   int64_t OSAtomicAdd64Barrier( int64_t __theAmount,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/server.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:146:9: warning: 'OSAtomicCompareAndSwap64Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong() from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap64Barrier(
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:646:9: note: 'OSAtomicCompareAndSwap64Barrier' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue,
           ^
   11 warnings generated.
   [ 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
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:20:9: warning: 'OSAtomicCompareAndSwap32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap32(old_value, new_value,
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:503:9: note: 'OSAtomicCompareAndSwap32' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:34:13: warning: 'OSAtomicCompareAndSwap32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     } while (!OSAtomicCompareAndSwap32(old_value, new_value,
               ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:503:9: note: 'OSAtomicCompareAndSwap32' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:41:10: warning: 'OSAtomicAdd32' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd32(increment, const_cast<Atomic32*>(ptr));
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:147:9: note: 'OSAtomicAdd32' has been explicitly marked deprecated here
   int32_t OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:46:10: warning: 'OSAtomicAdd32Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd32Barrier(increment, const_cast<Atomic32*>(ptr));
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:162:9: note: 'OSAtomicAdd32Barrier' has been explicitly marked deprecated here
   int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:50:3: warning: 'OSMemoryBarrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_thread_fence() from <atomic> instead [-Wdeprecated-declarations]
     OSMemoryBarrier();
     ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:750:9: note: 'OSMemoryBarrier' has been explicitly marked deprecated here
   void    OSMemoryBarrier( void );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:58:9: warning: 'OSAtomicCompareAndSwap32Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong() from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap32Barrier(old_value, new_value,
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:519:9: note: 'OSAtomicCompareAndSwap32Barrier' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue );
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:111:9: warning: 'OSAtomicCompareAndSwap64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap64(old_value, new_value,
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:629:9: note: 'OSAtomicCompareAndSwap64' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:125:13: warning: 'OSAtomicCompareAndSwap64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     } while (!OSAtomicCompareAndSwap64(old_value, new_value,
               ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:629:9: note: 'OSAtomicCompareAndSwap64' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:132:10: warning: 'OSAtomicAdd64' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add_explicit(std::memory_order_relaxed) from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd64(increment, reinterpret_cast<volatile int64_t*>(ptr));
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:232:9: note: 'OSAtomicAdd64' has been explicitly marked deprecated here
   int64_t OSAtomicAdd64( int64_t __theAmount,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:137:10: warning: 'OSAtomicAdd64Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_fetch_add() from <atomic> instead [-Wdeprecated-declarations]
     return OSAtomicAdd64Barrier(increment,
            ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:248:9: note: 'OSAtomicAdd64Barrier' has been explicitly marked deprecated here
   int64_t OSAtomicAdd64Barrier( int64_t __theAmount,
           ^
   In file included from /Users/zhaoyong/Develop/c/brpc/example/echo_c++/client.cpp:21:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/logging.h:32:
   In file included from /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops.h:147:
   /Users/zhaoyong/Develop/c/brpc/cmake-build-debug/output/include/butil/atomicops_internals_mac.h:146:9: warning: 'OSAtomicCompareAndSwap64Barrier' is deprecated: first deprecated in macOS 10.12 - Use std::atomic_compare_exchange_strong() from <atomic> instead [-Wdeprecated-declarations]
       if (OSAtomicCompareAndSwap64Barrier(
           ^
   /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/libkern/OSAtomicDeprecated.h:646:9: note: 'OSAtomicCompareAndSwap64Barrier' has been explicitly marked deprecated here
   bool    OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue,
           ^
   11 warnings generated.
   [ 75%] Building CXX object CMakeFiles/echo_client.dir/echo.pb.cc.o
   [ 87%] Linking CXX executable echo_client
   [100%] Built target echo_client
   
      ~/Develop/c/brpc/example/echo_c++   origin/release-1.4  ./build/echo_server
   [1]    89260 segmentation fault  ./build/echo_server
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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] wwbmmm commented on issue #2025: 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11

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

   @SillyBoyenjoy 可以试试PR #2037 


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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] SillyBoyenjoy commented on issue #2025: 使用cmake编译example里echo_c++进程启动即报Segmentation fault: 11

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

   是mac才会有的问题,以下是lldb的backtrace:
     * frame #0: 0x0000000000000000
       frame #1: 0x00000001ab00f718 libobjc.A.dylib`load_images + 1616
       frame #2: 0x000000010116b9a8 dyld`dyld4::RuntimeState::notifyObjCInit(dyld4::Loader const*) + 164
       frame #3: 0x0000000101171cf4 dyld`dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 196
       frame #4: 0x0000000101171cdc dyld`dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 172
       frame #5: 0x0000000101171dcc dyld`dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 124
       frame #6: 0x0000000101186db4 dyld`dyld4::APIs::runAllInitializersForMain() + 312
       frame #7: 0x0000000101161e00 dyld`dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3100
       frame #8: 0x00000001011610d4 dyld`start + 488


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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