Closed hks2002 closed 10 months ago
just tested it. Can you try using the latest master? I seem to have fixed the bug after 1.9.0 releasing.
However I'm getting this error when running drogon_ctl
2023-11-14 10:22:44.337 drogon_ctl[3063:41086122] -[NSString initWithBytes:length:encoding:]: unrecognized selector sent to instance 0x600000820310
[1] 3063 segmentation fault ./drogon_ctl/drogon_ctl version
Will debug later
updated the source to the latest.
this is my new github actions file
name: Build macos-clang
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
jobs:
build:
name: '${{matrix.link}} - ${{matrix.build-type}} - ${{matrix.tls-provider}}'
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
link: [ 'STATIC', 'SHARED' ]
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build-type: ['Debug', 'Release']
tls-provider: ['', 'openssl', 'botan']
steps:
- name: Install dependencies
run: |
brew install botan spdlog
- name: Install gtest
run: |
wget https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz
tar xf v1.13.0.tar.gz
cd googletest-1.13.0
cmake .
make
sudo make install
- name: Checkout Trantor source code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Create build directory
run: |
mkdir build
- name: Create Build Environment & Configure Cmake SHARED
shell: bash
working-directory: ${{env.GITHUB_WORKSPACE}}
if: ${{matrix.link}} == "SHARED"
run: |
cd build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=ON \
-DUSE_SPDLOG=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DTRANTOR_USE_TLS=${{matrix.tls-provider}}
- name: Create Build Environment & Configure Cmake STATIC
shell: bash
working-directory: ${{env.GITHUB_WORKSPACE}}
if: ${{matrix.link}} == "STATIC"
run: |
cd build
cmake .. \
-DBUILD_TESTING=ON \
-DUSE_SPDLOG=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DTRANTOR_USE_TLS=${{matrix.tls-provider}}
- name: Build
shell: bash
working-directory: ${{env.GITHUB_WORKSPACE}}
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cd build
sudo make && sudo make install
- name: Test
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd build
make test
and these is the result there still have error in the github actions.
Run cd build
[ 1%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/AsyncFileLogger.cc.o
[ 2%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/ConcurrentTaskQueue.cc.o
[ 3%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/Date.cc.o
[ 4%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/LogStream.cc.o
[ [5](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:6)%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/Logger.cc.o
[ [6](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:7)%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/MsgBuffer.cc.o
[ [7](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:8)%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/SerialTaskQueue.cc.o
[ [8](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:9)%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/TimingWheel.cc.o
[ [9](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:10)%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/Utilities.cc.o
[ [10](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:11)%] Building CXX object CMakeFiles/trantor.dir/trantor/net/EventLoop.cc.o
[ [11](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:12)%] Building CXX object CMakeFiles/trantor.dir/trantor/net/EventLoopThread.cc.o
[ [12](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:13)%] Building CXX object CMakeFiles/trantor.dir/trantor/net/EventLoopThreadPool.cc.o
[ [13](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:14)%] Building CXX object CMakeFiles/trantor.dir/trantor/net/InetAddress.cc.o
[ [14](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:15)%] Building CXX object CMakeFiles/trantor.dir/trantor/net/TcpClient.cc.o
[ [15](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:16)%] Building CXX object CMakeFiles/trantor.dir/trantor/net/TcpServer.cc.o
[ 17%] Building CXX object CMakeFiles/trantor.dir/trantor/net/Channel.cc.o
[ 18%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Acceptor.cc.o
[ 19%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Connector.cc.o
[ 20%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Poller.cc.o
[ 21%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Socket.cc.o
[ 22%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/TcpConnectionImpl.cc.o
[ 23%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Timer.cc.o
[ 24%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/TimerQueue.cc.o
[ 25%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/poller/EpollPoller.cc.o
[ 26%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/poller/KQueue.cc.o
[ 27%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/poller/PollPoller.cc.o
[ 28%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/tlsprovider/BotanTLSProvider.cc.o
[ 29%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/crypto/botan.cc.o
[ 30%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/AresResolver.cc.o
[ 31%] Linking CXX shared library libtrantor.dylib
[ 31%] Built target trantor
[ 32%] Building CXX object trantor/tests/CMakeFiles/ssl_server_test.dir/SSLServerTest.cc.o
[ 34%] Linking CXX executable ssl_server_test
[ 34%] Built target ssl_server_test
[ 35%] Building CXX object trantor/tests/CMakeFiles/ssl_client_test.dir/SSLClientTest.cc.o
[ 36%] Linking CXX executable ssl_client_test
[ 36%] Built target ssl_client_test
[ 37%] Building CXX object trantor/tests/CMakeFiles/serial_task_queue_test1.dir/SerialTaskQueueTest1.cc.o
[ 38%] Linking CXX executable serial_task_queue_test1
[ 38%] Built target serial_task_queue_test1
[ 39%] Building CXX object trantor/tests/CMakeFiles/serial_task_queue_test2.dir/SerialTaskQueueTest2.cc.o
[ 40%] Linking CXX executable serial_task_queue_test2
[ 40%] Built target serial_task_queue_test2
[ 41%] Building CXX object trantor/tests/CMakeFiles/timer_test.dir/TimerTest.cc.o
[ 42%] Linking CXX executable timer_test
[ 42%] Built target timer_test
[ 43%] Building CXX object trantor/tests/CMakeFiles/timer_test1.dir/TimerTest1.cc.o
[ 44%] Linking CXX executable timer_test1
[ 44%] Built target timer_test1
[ 45%] Building CXX object trantor/tests/CMakeFiles/run_in_loop_test1.dir/RunInLoopTest1.cc.o
[ 46%] Linking CXX executable run_in_loop_test1
[ 46%] Built target run_in_loop_test1
[ 47%] Building CXX object trantor/tests/CMakeFiles/run_in_loop_test2.dir/RunInLoopTest2.cc.o
[ 48%] Linking CXX executable run_in_loop_test2
[ 48%] Built target run_in_loop_test2
[ 50%] Building CXX object trantor/tests/CMakeFiles/logger_test.dir/LoggerTest.cc.o
[ 51%] Linking CXX executable logger_test
[ 51%] Built target logger_test
[ 52%] Building CXX object trantor/tests/CMakeFiles/async_file_logger_test.dir/AsyncFileLoggerTest.cc.o
[ 53%] Linking CXX executable async_file_logger_test
[ 53%] Built target async_file_logger_test
[ 54%] Building CXX object trantor/tests/CMakeFiles/tcp_server_test.dir/TcpServerTest.cc.o
[ 55%] Linking CXX executable tcp_server_test
[ 55%] Built target tcp_server_test
[ 56%] Building CXX object trantor/tests/CMakeFiles/concurrent_task_queue_test.dir/ConcurrentTaskQueueTest.cc.o
[ 57%] Linking CXX executable concurrent_task_queue_test
[ 57%] Built target concurrent_task_queue_test
[ 58%] Building CXX object trantor/tests/CMakeFiles/tcp_client_test.dir/TcpClientTest.cc.o
/Users/runner/work/trantor/trantor/trantor/tests/TcpClientTest.cc:63:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(tmp, "%d client!!", i);
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
1 warning generated.
[ 59%] Linking CXX executable tcp_client_test
[ 59%] Built target tcp_client_test
[ 60%] Building CXX object trantor/tests/CMakeFiles/async_file_logger_test1.dir/AsyncFileLoggerTest1.cc.o
[ 61%] Linking CXX executable async_file_logger_test1
[ 61%] Built target async_file_logger_test1
[ 62%] Building CXX object trantor/tests/CMakeFiles/sendfile_test.dir/SendfileTest.cc.o
/Users/runner/work/trantor/trantor/trantor/tests/SendfileTest.cc:68:25: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(str, "\n%d files sent!\n", counter);
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
/Users/runner/work/trantor/trantor/trantor/tests/SendfileTest.cc:79:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(str, "\n%d files sent!\n", counter);
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
2 warnings generated.
[ 63%] Linking CXX executable sendfile_test
[ 63%] Built target sendfile_test
[ 64%] Building CXX object trantor/tests/CMakeFiles/sendstream_test.dir/SendstreamTest.cc.o
/Users/runner/work/trantor/trantor/trantor/tests/SendstreamTest.cc:84:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(str, "\n%d streams sent!\n", counter);
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
/Users/runner/work/trantor/trantor/trantor/tests/SendstreamTest.cc:106:17: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
sprintf(str, "\n%d streams sent!\n", counter);
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
2 warnings generated.
[ 65%] Linking CXX executable sendstream_test
[ 65%] Built target sendstream_test
[ 67%] Building CXX object trantor/tests/CMakeFiles/timing_wheel_test.dir/TimingWheelTest.cc.o
[ 68%] Linking CXX executable timing_wheel_test
[ 68%] Built target timing_wheel_test
[ 69%] Building CXX object trantor/tests/CMakeFiles/kickoff_test.dir/KickoffTest.cc.o
[ 70%] Linking CXX executable kickoff_test
[ 70%] Built target kickoff_test
[ 71%] Building CXX object trantor/tests/CMakeFiles/dns_test.dir/DnsTest.cc.o
[ 72%] Linking CXX executable dns_test
[ 72%] Built target dns_test
[ 73%] Building CXX object trantor/tests/CMakeFiles/run_on_quit_test.dir/RunOnQuitTest.cc.o
[ 74%] Linking CXX executable run_on_quit_test
[ 74%] Built target run_on_quit_test
[ 75%] Building CXX object trantor/tests/CMakeFiles/path_conversion_test.dir/PathConversionTest.cc.o
[ 76%] Linking CXX executable path_conversion_test
[ 76%] Built target path_conversion_test
[ 77%] Building CXX object trantor/tests/CMakeFiles/logger_macro_test.dir/LoggerMacroTest.cc.o
[ 78%] Linking CXX executable logger_macro_test
[ 78%] Built target logger_macro_test
[ 79%] Building CXX object trantor/tests/CMakeFiles/delayed_ssl_server_test.dir/DelayedSSLServerTest.cc.o
[ 80%] Linking CXX executable delayed_ssl_server_test
[ 80%] Built target delayed_ssl_server_test
[ 81%] Building CXX object trantor/tests/CMakeFiles/delayed_ssl_client_test.dir/DelayedSSLClientTest.cc.o
[ 82%] Linking CXX executable delayed_ssl_client_test
[ 82%] Built target delayed_ssl_client_test
[ 84%] Building CXX object trantor/tests/CMakeFiles/spdlogger_test.dir/SpdLoggerTest.cc.o
[ 85%] Linking CXX executable spdlogger_test
[ 85%] Built target spdlogger_test
[ 86%] Building CXX object trantor/unittests/CMakeFiles/msgbuffer_unittest.dir/MsgBufferUnittest.cc.o
[ 87%] Linking CXX executable msgbuffer_unittest
2023-11-[16](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:17) 13:53:13.072 msgbuffer_unittest[3090:105[18](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:19)] -[NSString initWithBytes:length:encoding:]: unrecognized selector sent to instance 0x600001428250
CMake Error at /usr/local/Cellar/cmake/3.27.6/share/cmake/Modules/GoogleTestAddTests.cmake:112 (message):
Error running test executable.
Path: '/Users/runner/work/trantor/trantor/build/trantor/unittests/msgbuffer_unittest'
Result: Segmentation fault
Output:
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.27.6/share/cmake/Modules/GoogleTestAddTests.cmake:[22](https://github.com/hks2002/trantor/actions/runs/6891625876/job/18747095598#step:8:23)5 (gtest_discover_tests_impl)
make[2]: *** [trantor/unittests/msgbuffer_unittest] Error 1
make[2]: *** Deleting file `trantor/unittests/msgbuffer_unittest'
make[1]: *** [trantor/unittests/CMakeFiles/msgbuffer_unittest.dir/all] Error 2
make: *** [all] Error 2
Error: Process completed with exit code 2.
@marty1885 see all from here https://github.com/hks2002/trantor/actions/runs/6891625876
@hks2002 I think this is a bug either in Botan or MacOS. It crashed during botan initializing. I'll check with botan developers. This might take a while.
@hks2002 Can you try #303 ? Should fix the issue on MacOS. LMK if it works and I'll merge it
@marty1885 It works now.
cd build sudo make && sudo make install shell: /bin/bash --noprofile --norc -e -o pipefail {0} [ 1%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/AsyncFileLogger.cc.o [ 2%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/ConcurrentTaskQueue.cc.o [ 3%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/Date.cc.o [ 4%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/LogStream.cc.o [ 5%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/Logger.cc.o [ 6%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/MsgBuffer.cc.o [ 7%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/SerialTaskQueue.cc.o [ 8%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/TimingWheel.cc.o [ 9%] Building CXX object CMakeFiles/trantor.dir/trantor/utils/Utilities.cc.o [ 10%] Building CXX object CMakeFiles/trantor.dir/trantor/net/EventLoop.cc.o [ 11%] Building CXX object CMakeFiles/trantor.dir/trantor/net/EventLoopThread.cc.o [ 13%] Building CXX object CMakeFiles/trantor.dir/trantor/net/EventLoopThreadPool.cc.o [ 14%] Building CXX object CMakeFiles/trantor.dir/trantor/net/InetAddress.cc.o [ 15%] Building CXX object CMakeFiles/trantor.dir/trantor/net/TcpClient.cc.o [ 16%] Building CXX object CMakeFiles/trantor.dir/trantor/net/TcpServer.cc.o [ 17%] Building CXX object CMakeFiles/trantor.dir/trantor/net/Channel.cc.o [ 18%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Acceptor.cc.o [ 19%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Connector.cc.o [ 20%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Poller.cc.o [ 21%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Socket.cc.o [ 22%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/TcpConnectionImpl.cc.o [ 23%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/Timer.cc.o [ 25%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/TimerQueue.cc.o [ 26%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/poller/EpollPoller.cc.o [ 27%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/poller/KQueue.cc.o [ 28%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/poller/PollPoller.cc.o [ 29%] Building CXX object CMakeFiles/trantor.dir/trantor/net/inner/tlsprovider/BotanTLSProvider.cc.o /Users/runner/work/trantor/trantor/trantor/net/inner/tlsprovider/BotanTLSProvider.cc:345:10: error: 'BotanTLSProvider::tls_verify_cert_chain' hides overloaded virtual function [-Werror,-Woverloaded-virtual] void tls_verify_cert_chain( ^ /usr/local/Cellar/botan/3.2.0/include/botan-3/botan/tls_callbacks.h:167:20: note: hidden overloaded virtual function 'Botan::TLS::Callbacks::tls_verify_cert_chain' declared here: type mismatch at 5th parameter ('std::string_view' (aka 'basic_string_view') vs 'const std::string &' (aka 'const basic_string<char, char_traits, allocator> &'))
virtual void tls_verify_cert_chain(const std::vector& cert_chain,
^
1 error generated.
make[2]: [CMakeFiles/trantor.dir/trantor/net/inner/tlsprovider/BotanTLSProvider.cc.o] Error 1
make[1]: [CMakeFiles/trantor.dir/all] Error 2
make: *** [all] Error 2