You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
在线上容器内编译生成的程序运行正常, 但是本地交叉编译后放在线上容器内运行崩溃.
线上宿主机arm centos, 容器 ubuntu,
To Reproduce
#include
#include
#include
#include <sw/redis++/redis++.h>
using namespace std;
using namespace sw::redis;
int redis_test() {
ConnectionOptions connection_options;
connection_options.host = "172.18.10.7"; // Required.
connection_options.port = 6301; // Optional. The default port is 6379.
connection_options.password = "7Un9oVRyVZ"; // Optional. No password by default.
connection_options.db = 0; // Optional. Use the 0th database by default.
// Optional. Timeout before we successfully send request to or receive response from redis.
// By default, the timeout is 0ms, i.e. never timeout and block until we send or receive successfuly.
// NOTE: if any command is timed out, we throw a TimeoutError exception.
connection_options.socket_timeout = std::chrono::milliseconds(0);
shared_ptr<Redis> redis_;
try
{
redis_ = std::make_shared<Redis>(connection_options);
}
catch(const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (redis_ == nullptr) {
cout << "failed to alloc redis" << endl;
return -1;
}
cout << "run sucess..." << endl;
return 0;
// Connect to Redis server with a single connection.
// Redis redis1(connection_options);
} Expected behavior
crash :
(gdb) bt
#0 0x0000aaaaab41f020 in sw::redis::ConnectionPool::ConnectionPool(sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&) () #1 0x0000aaaaaac0933c in __gnu_cxx::new_allocatorsw::redis::ConnectionPool::construct<sw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (
this=, __p=)
at /usr/aarch64-linux-gnu/include/c++/7/ext/new_allocator.h:136 #2 std::allocator_traits<std::allocatorsw::redis::ConnectionPool >::construct<sw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=...,
__p=) at /usr/aarch64-linux-gnu/include/c++/7/bits/alloc_traits.h:475 #3 std::__shared_ptr<sw::redis::ConnectionPool, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocatorsw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=..., __tag=..., this=)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr_base.h:1327 #4 std::shared_ptrsw::redis::ConnectionPool::shared_ptr<std::allocatorsw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=..., __tag=...,
this=) at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:344 #5 std::allocate_shared<sw::redis::ConnectionPool, std::allocatorsw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=...)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:691 #6 std::make_shared<sw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> () at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:707 #7 __gnu_cxx::new_allocatorsw::redis::Redis::construct<sw::redis::Redis, sw::redis::ConnectionOptions&> (this=, __p=0xaaaaab700990, pool_opts=..., connection_opts=...,
this=) at /opt/rtc/censor-stream/3rdparty/prefix/include/sw/redis++/redis.h:56 #8 std::allocator_traits<std::allocatorsw::redis::Redis >::construct<sw::redis::Redis, sw::redis::C---Type to continue, or q to quit---
onnectionOptions&> (__a=..., __p=0xaaaaab700990)
at /usr/aarch64-linux-gnu/include/c++/7/bits/alloc_traits.h:475 #9 std::__shared_ptr<sw::redis::Redis, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocatorsw::redis::Redis, sw::redis::ConnectionOptions&> (__a=..., __tag=..., this=)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr_base.h:1327 #10 std::shared_ptrsw::redis::Redis::shared_ptr<std::allocatorsw::redis::Redis, sw::redis::ConnectionOptions&> (__a=..., __tag=..., this=)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:344 #11 std::allocate_shared<sw::redis::Redis, std::allocatorsw::redis::Redis, sw::redis::ConnectionOptions&> (__a=...) at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:691 #12 std::make_shared<sw::redis::Redis, sw::redis::ConnectionOptions&> ()
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:707 #13 RedisPush::RedisPush (this=0xaaaaab70afc0, host=..., port=, password=...,
db=, timeout=, expire=)
at /opt/rtc/censor-stream/src/rtc/redis_push.cpp:24
Describe the bug
在线上容器内编译生成的程序运行正常, 但是本地交叉编译后放在线上容器内运行崩溃.
线上宿主机arm centos, 容器 ubuntu,
To Reproduce
#include
#include
#include
#include <sw/redis++/redis++.h>
using namespace std;
using namespace sw::redis;
int redis_test() {
ConnectionOptions connection_options;
connection_options.host = "172.18.10.7"; // Required.
connection_options.port = 6301; // Optional. The default port is 6379.
connection_options.password = "7Un9oVRyVZ"; // Optional. No password by default.
connection_options.db = 0; // Optional. Use the 0th database by default.
}
Expected behavior
crash :
(gdb) bt
#0 0x0000aaaaab41f020 in sw::redis::ConnectionPool::ConnectionPool(sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&) ()
#1 0x0000aaaaaac0933c in __gnu_cxx::new_allocatorsw::redis::ConnectionPool::construct<sw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (
this=, __p=)
at /usr/aarch64-linux-gnu/include/c++/7/ext/new_allocator.h:136
#2 std::allocator_traits<std::allocatorsw::redis::ConnectionPool >::construct<sw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=...,
__p=) at /usr/aarch64-linux-gnu/include/c++/7/bits/alloc_traits.h:475
#3 std::__shared_ptr<sw::redis::ConnectionPool, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocatorsw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=..., __tag=..., this=)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr_base.h:1327
#4 std::shared_ptrsw::redis::ConnectionPool::shared_ptr<std::allocatorsw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=..., __tag=...,
this=) at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:344
#5 std::allocate_shared<sw::redis::ConnectionPool, std::allocatorsw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> (__a=...)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:691
#6 std::make_shared<sw::redis::ConnectionPool, sw::redis::ConnectionPoolOptions const&, sw::redis::ConnectionOptions const&> () at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:707
#7 __gnu_cxx::new_allocatorsw::redis::Redis::construct<sw::redis::Redis, sw::redis::ConnectionOptions&> (this=, __p=0xaaaaab700990, pool_opts=..., connection_opts=...,
this=) at /opt/rtc/censor-stream/3rdparty/prefix/include/sw/redis++/redis.h:56
#8 std::allocator_traits<std::allocatorsw::redis::Redis >::construct<sw::redis::Redis, sw::redis::C---Type to continue, or q to quit---
onnectionOptions&> (__a=..., __p=0xaaaaab700990)
at /usr/aarch64-linux-gnu/include/c++/7/bits/alloc_traits.h:475
#9 std::__shared_ptr<sw::redis::Redis, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocatorsw::redis::Redis, sw::redis::ConnectionOptions&> (__a=..., __tag=..., this=)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr_base.h:1327
#10 std::shared_ptrsw::redis::Redis::shared_ptr<std::allocatorsw::redis::Redis, sw::redis::ConnectionOptions&> (__a=..., __tag=..., this=)
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:344
#11 std::allocate_shared<sw::redis::Redis, std::allocatorsw::redis::Redis, sw::redis::ConnectionOptions&> (__a=...) at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:691
#12 std::make_shared<sw::redis::Redis, sw::redis::ConnectionOptions&> ()
at /usr/aarch64-linux-gnu/include/c++/7/bits/shared_ptr.h:707
#13 RedisPush::RedisPush (this=0xaaaaab70afc0, host=..., port=, password=...,
db=, timeout=, expire=)
at /opt/rtc/censor-stream/src/rtc/redis_push.cpp:24
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: