aws/aws-sdk-cpp

S3client Abnormal operation of gcc12 version in Debian system (Aws::Client::ClientConfiguration)

Closed this issue · 4 comments

Describe the issue

S3client runs normally under gcc4.8 in Centos system
The gcc12 version runs abnormally in the Debian system, with the exception code line and stack as follows

Aws::Client::ClientConfiguration cfg;
cfg.region = region.c_str();

#0 0x00007ffff54b7e3a in __GI___libc_free (mem=0xbb8) at ./malloc/malloc.c:3362
https://github.com/aws/aws-sdk-cpp/issues/1 0x00007ffff4b3fd55 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) ()
from /lib/x86_64-linux-gnu/libstdc++.so.6
https://github.com/aws/aws-sdk-cpp/pull/2 0x00007ffff4b40d6e in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_replace(unsigned long, unsigned long, char const*, unsigned long) ()
from /lib/x86_64-linux-gnu/libstdc++.so.6
https://github.com/aws/aws-sdk-cpp/issues/3 0x00007ffff7ab33de in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::assign (__s=0x555555820be0 "cn-beijing", this=0x7fffffffdb38)
at /usr/include/c++/12/bits/basic_string.h:1647
https://github.com/aws/aws-sdk-cpp/pull/4 std::__cxx11::basic_string<char, std::char_traits, std::allocator >::operator= (__s=0x555555820be0 "cn-beijing", this=0x7fffffffdb38) at /usr/include/c++/12/bits/basic_string.h:815
https://github.com/aws/aws-sdk-cpp/issues/5 CSOperatorS3::init (this=0x555555720a40) at /home/306838/Cloudstory/PS-StorageClient/Trunk/cpp/S3Plugin/src/CSOperatorS3.cpp:73
(gdb) p cfg
$1 = {userAgent = "", scheme = Aws::Http::Scheme::HTTP, region = <error: Cannot access memory at address 0xbb8>, useDualStack = true, useFIPS = false, maxConnections = 0, httpRequestTimeoutMs = 93824995167016,
requestTimeoutMs = 93824995166992, connectTimeoutMs = 140737299715544, enableTcpKeepAlive = false, tcpKeepAliveIntervalMs = 140737299715544, lowSpeedLimit = 0,
retryStrategy = std::shared_ptrAws::Client::RetryStrategy (expired, weak count 0) = {
get() = 0x7ffff4c195d8 <std::basic_string<char, std::char_traits, std::allocator >::_Rep::_S_empty_rep_storage+24>}, endpointOverride = "", proxyScheme = (unknown: 0xf4c195d8), proxyHost = "",
proxyPort = 1433758720, proxyUserName = "", proxyPassword = "", proxySSLCertPath = "", proxySSLCertType = "", proxySSLKeyPath = "", proxySSLKeyType = "", proxySSLKeyPassword = "", nonProxyHosts = {
_vptr.Array = 0x0, m_size = 0, m_data = std::unique_ptr<std::__cxx11::basic_string<char, std::char_traits, std::allocator >> = {get() = 0x0}},
executor = <error reading variable: Cannot access memory at address 0x9>, verifySSL = false, caPath = "",
caFile = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>,
writeRateLimiter = std::shared_ptrAws::Utils::RateLimits::RateLimiterInterface (use count 60, weak count -1) = {get() = 0x3d},
readRateLimiter = std::shared_ptrAws::Utils::RateLimits::RateLimiterInterface (use count -63320, weak count 264275271) = {get() = 0x55555571f660}, httpLibOverride = 60,
followRedirects = Aws::Client::FollowRedirectsPolicy::DEFAULT, disableExpectHeader = 199, enableClockSkewAdjustment = 21, enableHostPrefixInjection = 171, enableEndpointDiscovery = {m_storage = {__data = "",
__align = {}}, m_value = 0x555555720a40}, profileName = "", useRequestCompression = Aws::Client::UseRequestCompression::FALSE}

Links

Aws::Client::ClientConfiguration cfg;

Can you make sure you have a clean build folder when you are building on Debian?

Please also provide more detailed build steps for how to reproduce this exception.

Can you make sure you have a clean build folder when you are building on Debian?

Please also provide more detailed build steps for how to reproduce this exception.

thank you for your answer,i have a clean build again,Does S3client not support GCC12 version

CPP SDK supports GCC12.
Problems like the one you are observing are typically due to some mismatch with build artifacts, so clean rebuild of both sdk and your app typically helps.
I dont have a Debian system handy, but AL2 with GCC works fine for this sample. If you are still getting this error after clean rebuild, we might need more info on exact platform you are observing the issue on. Ideally, a Dockerfile with exact OS and compiler versions that repro the issue would help.

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.