Skip to content
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

Segmentation fault #123

Closed
AlexDiede opened this issue Mar 8, 2016 · 6 comments
Closed

Segmentation fault #123

AlexDiede opened this issue Mar 8, 2016 · 6 comments
Labels
help wanted We are asking the community to submit a PR to resolve this issue.

Comments

@AlexDiede
Copy link

Latest version (d48e71b) segfaults when I'm trying to get a shard iterator for my kinesis app. Here is a minimal code example that shows the issue:

`// excluding includes/using statements for brevity

AWSCredentials creds("ACCESS_KEY", "SECRET_KEY");
ClientConfiguration config;
config.region = Aws::Region::US_WEST_2;
auto client = Aws::MakeUnique<KinesisClient>("kinesis_client", creds, config);

GetShardIteratorRequest request;
request.SetStreamName("stream");
request.SetShardId("shardId-000000000000");
request.SetShardType(ShardIteratorTypeMapper::GetShardIteratorFromTypeForName("LATEST"));
auto response = client->GetShardIterator(request);`

The program is build on Ubuntu 14.04 with the following g++ command:
g++ test.cpp -g -std=c++11 -pthread -I../aws_lib/include -L../aws_lib/lib -laws-cpp-sdk-core -laws-cpp-sdk-kinesis -lcurl -lcrypto

g++ is version 5.3.0.

I built up a debug version and got this stack trace from gdb:
`#0 0x00007ffff7549a00 in std::string::compare(std::string const&) const () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x0000000000407d9f in std::operator< <char, std::char_traits, std::allocator > (__lhs="content-type",

__rhs=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>) at /usr/include/c++/5/bits/basic_string.h:4991

#2 0x0000000000407be7 in std::lessstd::string::operator() (this=0x7fffffffd5b0, __x="content-type",

__y=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>) at /usr/include/c++/5/bits/stl_function.h:387

#3 0x00000000004077cb in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > >::_M_get_insert_unique_pos (

this=0x7fffffffd5b0, __k="content-type") at /usr/include/c++/5/bits/stl_tree.h:1810

#4 0x00000000004070bf in std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > >::_M_insert_unique<std::pair<std::string, std::string> >(std::pair<std::string, std::string>&&) (this=0x7fffffffd5b0,

__v=<unknown type in /home/alex/dev/tests/a.out, CU 0x0, DIE 0x149ba>)
at /usr/include/c++/5/bits/stl_tree.h:1863

#5 0x0000000000406b52 in std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > >::insert<std::pair<std::string, std::string>, void>(std::pair<std::string, std::string>&&) (this=0x7fffffffd5b0,

__x=<unknown type in /home/alex/dev/tests/a.out, CU 0x0, DIE 0x14137>)
at /usr/include/c++/5/bits/stl_map.h:621

#6 0x000000000040681a in Aws::Kinesis::KinesisRequest::GetHeaders (this=0x7fffffffdcc0)

at ../aws_lib/include/aws/kinesis/KinesisRequest.h:36

#7 0x000000000048a673 in Aws::Client::AWSClient::BuildHttpRequest (this=0x752670, request=..., httpRequest=

std::shared_ptr (count 1, weak 0) 0x770570) at /home/alex/dev/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp:308

#8 0x0000000000489736 in Aws::Client::AWSClient::AttemptOneRequest (this=0x752670, uri="https://kinesis.us-west-2.amazonaws.com/",

request=..., method=Aws::Http::HTTP_POST) at /home/alex/dev/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp:183

#9 0x00000000004891df in Aws::Client::AWSClient::AttemptExhaustively (this=0x752670, uri="https://kinesis.us-west-2.amazonaws.com/",

request=..., method=Aws::Http::HTTP_POST) at /home/alex/dev/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp:131

#10 0x000000000048aa4b in Aws::Client::AWSJsonClient::MakeRequest (this=0x752670, uri="https://kinesis.us-west-2.amazonaws.com/",

request=..., method=Aws::Http::HTTP_POST) at /home/alex/dev/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp:353

#11 0x00000000004123ca in Aws::Kinesis::KinesisClient::GetShardIterator (this=0x752670, request=...)

at /home/alex/dev/aws-sdk-cpp/aws-cpp-sdk-kinesis/source/KinesisClient.cpp:298

#12 0x0000000000405f8e in main (argc=1, argv=0x7fffffffde68) at test.cpp:34

`

I believe this issue was introduced in commit 9ad3128 as reverting to commit d48e71b (the previous one) resolves the issue.

@JonathanHenson
Copy link
Contributor

What's your build command for the SDK?

@AlexDiede
Copy link
Author

cmake -DBUILD_ONLY="aws-cpp-sdk-kinesis" -DSTATIC_LINKING=1 <root-sdk-dir>
followed by 'make' for the initial build.
For the debug build I used:
cmake -DBUILD_ONLY="aws-cpp-sdk-kinesis" -DSTATIC_LINKING=1 -DCMAKE_CXX_FLAGS="-g" <root-sdk-dir>

@JonathanHenson
Copy link
Contributor

I'm having trouble reproducing. What happens if you dynamically link?

@AlexDiede
Copy link
Author

Result is the same using dynamic linking. Build command: cmake -DBUILD_ONLY="aws-cpp-sdk-kinesis" -DCUSTOM_MEMORY_MANAGEMENT=0 <root-sdk-dir>

Cmake is version 3.2.2 btw.

krzysztof-trzepla pushed a commit to krzysztof-trzepla/aws-sdk-cpp that referenced this issue May 21, 2016
…storage-directory-should-be to develop

# By Jakub Kudzia
# Via Jakub Kudzia
* commit '67cb66fb3e19a208664f2fde8a7b8252a6b2c016':
  VFS-1832 - bugfixes
  VFS-1832 - create default storage dir if it doesn't exits
  VFS-1832 - add host path of posix storage to env_up output
  VFS-1832 - create volume for storage in temporary dir
@qiuyi21
Copy link

qiuyi21 commented Jul 26, 2017

I have this issue in Windows and can't solve it.
v1.0.164

@singku
Copy link
Contributor

singku commented Nov 13, 2018

Reopen this if you still have problem after updating SDK to latest.

@singku singku closed this as completed Nov 13, 2018
@justnance justnance added help wanted We are asking the community to submit a PR to resolve this issue. and removed help wanted labels Apr 19, 2019
cobookman pushed a commit to cobookman/aws-sdk-cpp that referenced this issue Jan 17, 2022
* Added job for Windows+VC14

* Avoid long path problems

* updated builder to v0.6.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We are asking the community to submit a PR to resolve this issue.
Projects
None yet
Development

No branches or pull requests

6 participants