Skip to content

Android: Crash after invoking Aws::S3Crt::S3CrtClient::PutObject #1804

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

Closed
2 tasks done
sajusathyan opened this issue Oct 26, 2021 · 2 comments
Closed
2 tasks done

Android: Crash after invoking Aws::S3Crt::S3CrtClient::PutObject #1804

sajusathyan opened this issue Oct 26, 2021 · 2 comments
Assignees
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@sajusathyan
Copy link

Confirm by changing [ ] to [x] below:

Platform/OS/Hardware/Device
Android 10, API 29
Android NDK version 21.3.6528147

Describe the question
I compiled AWS SDK C++ 1.9.128 as a CMake External project and linked against my Android native library. I am trying to use the aws::s3-crt to load objects to the S3. But the application crashes after Aws::S3Crt::S3CrtClient::PutObject call. Is this crash due to:

  • AWS SDK C++ is not yet compatible with Android NDK version 21.3.6528147?
  • I have linked AWS SDK C++ incorrectly?
  • Something else?

Logs/output
Backtrace
2021-10-27 00:51:27.620 8960-8960/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-10-27 00:51:27.620 8960-8960/? A/DEBUG: Build fingerprint: 'HONOR/PCT-L29/HWPCT:10/HUAWEIPCT-L29/10.0.0.201C432:user/release-keys'
2021-10-27 00:51:27.620 8960-8960/? A/DEBUG: Revision: '0'
2021-10-27 00:51:27.620 8960-8960/? A/DEBUG: ABI: 'arm64'
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: Timestamp: 2021-10-27 00:51:27+0200
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: pid: 8682, tid: 8954, name: GLThread 9531 >>> com.xxxx.xxxxx <<<
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: uid: 10190
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: Cause: null pointer dereference

2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x0 0000007a4b9c3cb8 x1 0000007a3fd89048 x2 0000000000000000 x3 0000000000000000
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x4 0000000000000000 x5 0000007a6965bab8 x6 44454e4749534e55 x7 44414f4c5941502d
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x8 0000000000000008 x9 2b7dcc975d40f7f3 x10 0000007a5dcdec40 x11 0000000000000000
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x12 0000007a5dcdec48 x13 0000000000006500 x14 0000000000000020 x15 aaaaaaaaaaaaaaab
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x16 0000007b4d1b3ec8 x17 0000007b4d160104 x18 0000007a2d656000 x19 0000007a4b9c3cb8
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x20 0000007a3fd89048 x21 0000007a41399228 x22 00000000000022dc x23 0000007a6965cdd8
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x24 0000007a6965cd50 x25 0000007a6965cd50 x26 0000007a6965d020 x27 0000007a40dfc020
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: x28 0000007a40dfade0 x29 0000007a6965bbb0
2021-10-27 00:51:27.621 8960-8960/? A/DEBUG: sp 0000007a6965bb90 lr 0000007b4d13be70 pc 0000000000000008
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: backtrace:
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #00 pc 0000000000000008
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #1 pc 00000000000b6e6c /system/lib64/libcrypto.so (EVP_DigestInit_ex+72) (BuildId: abcdf953a84c2e1be6a750308d6a8f96)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #2 pc 00000000007c2c94 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_sha256_default_new+272) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #3 pc 00000000007bf5b4 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_sha256_new+32) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #4 pc 00000000007bfa1c /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_sha256_compute+32) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #5 pc 00000000006515bc /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #6 pc 000000000064e914 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #7 pc 000000000064e008 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_signing_build_canonical_request+208) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #8 pc 0000000000664588 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #9 pc 0000000000664b54 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #10 pc 000000000065ddc4 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #11 pc 00000000006555e8 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_credentials_provider_get_credentials+100) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #12 pc 00000000006644e4 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_sign_request_aws+472) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #13 pc 00000000004f6340 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-s3-crt.so (offset 0x5062000) (aws_s3_meta_request_sign_request_default+1012) (BuildId: 23c75df9a3d8b390d58fb31926c2e037b73c75c7)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #14 pc 00000000004f8cc8 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-s3-crt.so (offset 0x5062000) (BuildId: 23c75df9a3d8b390d58fb31926c2e037b73c75c7)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #15 pc 00000000004f8b08 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-s3-crt.so (offset 0x5062000) (BuildId: 23c75df9a3d8b390d58fb31926c2e037b73c75c7)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #16 pc 00000000007df984 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_task_run+272) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #17 pc 00000000007e0128 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #18 pc 00000000007e0c34 /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (aws_task_scheduler_run_all+76) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #19 pc 00000000006dc64c /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #20 pc 00000000007e77bc /data/app/com.xxxx.xxxxx-rrk5rjbwG1ykwCw4HfUxtQ==/base.apk!libaws-cpp-sdk-core.so (offset 0x3fce000) (BuildId: a705c7d3408224193ca5f5d991cc17afe35ee508)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #21 pc 00000000000ce190 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 2f04208be3c24ae761428c0bcfa6bcdf)
2021-10-27 00:51:27.629 8960-8960/? A/DEBUG: #22 pc 0000000000070ba8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 2f04208be3c24ae761428c0bcfa6bcdf)

   Aws::SDKOptions awsSDKoptions;
   
    //Turn on logging.
    awsSDKoptions.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;

    // Override the default log level for AWS common runtime libraries to see multipart upload entries in the log file.
    awsSDKoptions.loggingOptions.crt_logger_create_fn = []() {
        return Aws::MakeShared<Aws::Utils::Logging::DefaultCRTLogSystem>(ALLOCATION_TAG,
                                                                         Aws::Utils::Logging::LogLevel::Debug);
    };

    Aws::InitAPI(awsSDKoptions);

    Aws::S3Crt::ClientConfiguration config;
    config.region               = Aws::Region::EU_WEST_1;
    config.throughputTargetGbps = 5;
    config.partSize             = 8 * 1024 * 1024; // 8 MB.;

    const Aws::String accessKeyId = "MY_ACCESS_KEY";
    const Aws::String secretKey = "MY_SECRET_KEY";
    Aws::Auth::AWSCredentials credentials(accessKeyId, secretKey);

    auto awsS3CrtClient = Aws::MakeShared<Aws::S3Crt::S3CrtClient>(ALLOCATION_TAG,
                                                               credentials,
                                                               config);

    Aws::S3Crt::Model::PutObjectRequest request;
    request.WithBucket("my_s3_bucket").WithKey("objectKey");

    auto bodyStream = Aws::MakeShared<Aws::StringStream>(ALLOCATION_TAG, "Test");
    request.SetBody(bodyStream);

    awsS3CrtClient->PutObject(request);
@sajusathyan sajusathyan added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Oct 26, 2021
@jmklix
Copy link
Member

jmklix commented Oct 28, 2021

Can you provide more details on how you complied and linked your project to your android native library?

@jmklix jmklix self-assigned this Oct 28, 2021
@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 31, 2021
@github-actions github-actions bot closed this as completed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants