Skip to content

Segmentation fault #123

Closed
Closed
@AlexDiede

Description

@AlexDiede

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe are asking the community to submit a PR to resolve this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions