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

SIGSEGV AWSCRT_12530715878252778108libaws-crt-jni.so+0x10a8dc aws_s3_client_make_meta_request+0x10c #5597

Open
mrkam2 opened this issue Sep 13, 2024 · 0 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@mrkam2
Copy link

mrkam2 commented Sep 13, 2024

Describe the bug

Getting this crash invoking .getObject on GetObjectRequest.

Expected Behavior

No crash

Current Behavior

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000f17a0e3ca8dc, pid=7, tid=158
#
# JRE version: OpenJDK Runtime Environment Corretto-17.0.9.8.1 (17.0.9+8) (build 17.0.9+8-LTS)
# Java VM: OpenJDK 64-Bit Server VM Corretto-17.0.9.8.1 (17.0.9+8-LTS, mixed mode, sharing, tiered, compressed class ptrs, g1 gc, linux-aarch64)
# Problematic frame:
# C  [AWSCRT_12530715878252778108libaws-crt-jni.so+0x10a8dc]  aws_s3_client_make_meta_request+0x10c
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /rush/job/core.7)
#
# An error report file with more information is saved as:
# /cache/hs_err_pid7.log

In the file above, top of the thread contained these frames:

---------------  T H R E A D  ---------------

Current thread (0x0000ece3a3226fc0):  JavaThread "clojure-agent-send-off-pool-26" [_thread_in_native, id=166, stack(0x0000ecd4b0394000,0x0000ecd4b0592000)]

Stack: [0x0000ecd4b0394000,0x0000ecd4b0592000],  sp=0x0000ecd4b058d7b0,  free space=2021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [AWSCRT_16837631838463822470libaws-crt-jni.so+0x10a8dc]  aws_s3_client_make_meta_request+0x10c
C  [AWSCRT_16837631838463822470libaws-crt-jni.so+0x9c6d4]  Java_software_amazon_awssdk_crt_s3_S3Client_s3ClientMakeMetaRequest+0x4c4
j  software.amazon.awssdk.crt.s3.S3Client.s3ClientMakeMetaRequest(JLsoftware/amazon/awssdk/crt/s3/S3MetaRequest;[BIIIZ[I[BLsoftware/amazon/awssdk/crt/http/HttpRequestBodyStream;[BLsoftware/amazon/awssdk/crt/auth/signing/AwsSigningConfig;Lsoftware/amazon/awssdk/crt/s3/S3MetaRequestResponseHandlerNativeAdapter;[BLsoftware/amazon/awssdk/crt/s3/ResumeToken;)J+0
j  software.amazon.awssdk.crt.s3.S3Client.makeMetaRequest(Lsoftware/amazon/awssdk/crt/s3/S3MetaRequestOptions;)Lsoftware/amazon/awssdk/crt/s3/S3MetaRequest;+251
j  software.amazon.awssdk.services.s3.internal.crt.S3CrtAsyncHttpClient.execute(Lsoftware/amazon/awssdk/http/async/AsyncExecuteRequest;)Ljava/util/concurrent/CompletableFuture;+200
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.doExecuteHttpRequest(Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;Lsoftware/amazon/awssdk/http/async/AsyncExecuteRequest;)Ljava/util/concurrent/CompletableFuture;+15
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.executeHttpRequest(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+157
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.lambda$execute$1(Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;Ljava/util/concurrent/CompletableFuture;Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;)V+3
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage$$Lambda$1657+0x0000000302364d78.accept(Ljava/lang/Object;)V+16
j  java.util.concurrent.CompletableFuture.uniAcceptNow(Ljava/lang/Object;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;+73 [email protected]
j  java.util.concurrent.CompletableFuture.uniAcceptStage(Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;+25 [email protected]
J 10249 c1 software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.execute(Ljava/util/concurrent/CompletableFuture;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture; (35 bytes) @ 0x0000ece38a5a74d8 [0x0000ece38a5a65c0+0x0000000000000f18]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18bac4 [0x0000ece38a18b8c0+0x0000000000000204]
J 10181 c1 software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallAttemptMetricCollectionStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture; (57 bytes) @ 0x0000ece38a563078 [0x0000ece38a562800+0x0000000000000878]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallAttemptMetricCollectionStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.attemptExecute(Ljava/util/concurrent/CompletableFuture;)V+25
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.maybeAttemptExecute(Ljava/util/concurrent/CompletableFuture;)V+181
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.execute()Ljava/util/concurrent/CompletableFuture;+10
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+11
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18ba00 [0x0000ece38a18b8c0+0x0000000000000140]
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18ba00 [0x0000ece38a18b8c0+0x0000000000000140]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncExecutionFailureExceptionReportingStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+6
J 10475 c1 software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncExecutionFailureExceptionReportingStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (10 bytes) @ 0x0000ece38a65e7e8 [0x0000ece38a65e640+0x00000000000001a8]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallTimeoutTrackingStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+67
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallTimeoutTrackingStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallMetricCollectionStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+28
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallMetricCollectionStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18bac4 [0x0000ece38a18b8c0+0x0000000000000204]
j  software.amazon.awssdk.core.internal.http.AmazonAsyncHttpClient$RequestExecutionBuilderImpl.execute(Lsoftware/amazon/awssdk/core/internal/http/TransformingAsyncResponseHandler;)Ljava/util/concurrent/CompletableFuture;+188
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.invoke(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/async/AsyncRequestBody;Lsoftware/amazon/awssdk/core/SdkRequest;Lsoftware/amazon/awssdk/core/http/ExecutionContext;Lsoftware/amazon/awssdk/core/internal/http/TransformingAsyncResponseHandler;)Ljava/util/concurrent/CompletableFuture;+34
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.doExecute(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/http/ExecutionContext;Lsoftware/amazon/awssdk/core/internal/http/TransformingAsyncResponseHandler;)Ljava/util/concurrent/CompletableFuture;+136
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.lambda$execute$3(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+131
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler$$Lambda$2528+0x0000000302415a00.get()Ljava/lang/Object;+12
J 10166 c1 software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.measureApiCallSuccess(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Ljava/util/function/Supplier;)Ljava/util/concurrent/CompletableFuture; (45 bytes) @ 0x0000ece38a559bb8 [0x0000ece38a559a80+0x0000000000000138]
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.execute(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+10
j  software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler.execute(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+3
j  software.amazon.awssdk.services.s3.DefaultS3AsyncClient.getObject(Lsoftware/amazon/awssdk/services/s3/model/GetObjectRequest;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+234
j  software.amazon.awssdk.services.s3.DelegatingS3AsyncClient.lambda$getObject$42(Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;Lsoftware/amazon/awssdk/services/s3/model/GetObjectRequest;)Ljava/util/concurrent/CompletableFuture;+6
j  software.amazon.awssdk.services.s3.DelegatingS3AsyncClient$$Lambda$2443+0x0000000302409728.apply(Ljava/lang/Object;)Ljava/lang/Object;+12
J 10282 c1 software.amazon.awssdk.services.s3.DelegatingS3AsyncClient.invokeOperation(Lsoftware/amazon/awssdk/services/s3/model/S3Request;Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture; (11 bytes) @ 0x0000ece38a5c0274 [0x0000ece38a5c0140+0x0000000000000134]
j  software.amazon.awssdk.services.s3.DelegatingS3AsyncClient.getObject(Lsoftware/amazon/awssdk/services/s3/model/GetObjectRequest;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+9

Here are other details from the crash file:

Host: AArch64, 32 cores, 61G, Ubuntu 22.04.4 LTS
Time: Thu Sep 12 20:09:39 2024 UTC elapsed time: 17.831889 seconds (0d 0h 0m 17s)

Here are tops of other threads in the same crash report:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  software.amazon.awssdk.crt.s3.S3Client.s3ClientMakeMetaRequest(JLsoftware/amazon/awssdk/crt/s3/S3MetaRequest;[BIIIZ[I[BLsoftware/amazon/awssdk/crt/http/HttpRequestBodyStream;[BLsoftware/amazon/awssdk/crt/auth/signing/AwsSigningConfig;Lsoftware/amazon/awssdk/crt/s3/S3MetaRequestResponseHandlerNativeAdapter;[BLsoftware/amazon/awssdk/crt/s3/ResumeToken;)J+0
j  software.amazon.awssdk.crt.s3.S3Client.makeMetaRequest(Lsoftware/amazon/awssdk/crt/s3/S3MetaRequestOptions;)Lsoftware/amazon/awssdk/crt/s3/S3MetaRequest;+251
j  software.amazon.awssdk.services.s3.internal.crt.S3CrtAsyncHttpClient.execute(Lsoftware/amazon/awssdk/http/async/AsyncExecuteRequest;)Ljava/util/concurrent/CompletableFuture;+200
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.doExecuteHttpRequest(Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;Lsoftware/amazon/awssdk/http/async/AsyncExecuteRequest;)Ljava/util/concurrent/CompletableFuture;+15
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.executeHttpRequest(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+157
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.lambda$execute$1(Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;Ljava/util/concurrent/CompletableFuture;Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;)V+3
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage$$Lambda$1657+0x0000000302364d78.accept(Ljava/lang/Object;)V+16
j  java.util.concurrent.CompletableFuture.uniAcceptNow(Ljava/lang/Object;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;+73 [email protected]
j  java.util.concurrent.CompletableFuture.uniAcceptStage(Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;+25 [email protected]
J 10249 c1 software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.execute(Ljava/util/concurrent/CompletableFuture;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture; (35 bytes) @ 0x0000ece38a5a74d8 [0x0000ece38a5a65c0+0x0000000000000f18]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18bac4 [0x0000ece38a18b8c0+0x0000000000000204]
J 10181 c1 software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallAttemptMetricCollectionStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture; (57 bytes) @ 0x0000ece38a563078 [0x0000ece38a562800+0x0000000000000878]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallAttemptMetricCollectionStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.attemptExecute(Ljava/util/concurrent/CompletableFuture;)V+25
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.maybeAttemptExecute(Ljava/util/concurrent/CompletableFuture;)V+181
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.execute()Ljava/util/concurrent/CompletableFuture;+10
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+11
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18ba00 [0x0000ece38a18b8c0+0x0000000000000140]
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18ba00 [0x0000ece38a18b8c0+0x0000000000000140]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncExecutionFailureExceptionReportingStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+6
J 10475 c1 software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncExecutionFailureExceptionReportingStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (10 bytes) @ 0x0000ece38a65e7e8 [0x0000ece38a65e640+0x00000000000001a8]
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallTimeoutTrackingStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+67
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallTimeoutTrackingStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallMetricCollectionStage.execute(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/util/concurrent/CompletableFuture;+28
j  software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncApiCallMetricCollectionStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object;+6
J 7794 c1 software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(Ljava/lang/Object;Lsoftware/amazon/awssdk/core/internal/http/RequestExecutionContext;)Ljava/lang/Object; (22 bytes) @ 0x0000ece38a18bac4 [0x0000ece38a18b8c0+0x0000000000000204]
j  software.amazon.awssdk.core.internal.http.AmazonAsyncHttpClient$RequestExecutionBuilderImpl.execute(Lsoftware/amazon/awssdk/core/internal/http/TransformingAsyncResponseHandler;)Ljava/util/concurrent/CompletableFuture;+188
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.invoke(Lsoftware/amazon/awssdk/http/SdkHttpFullRequest;Lsoftware/amazon/awssdk/core/async/AsyncRequestBody;Lsoftware/amazon/awssdk/core/SdkRequest;Lsoftware/amazon/awssdk/core/http/ExecutionContext;Lsoftware/amazon/awssdk/core/internal/http/TransformingAsyncResponseHandler;)Ljava/util/concurrent/CompletableFuture;+34
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.doExecute(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/http/ExecutionContext;Lsoftware/amazon/awssdk/core/internal/http/TransformingAsyncResponseHandler;)Ljava/util/concurrent/CompletableFuture;+136
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.lambda$execute$3(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+131
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler$$Lambda$2528+0x0000000302415a00.get()Ljava/lang/Object;+12
J 10166 c1 software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.measureApiCallSuccess(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Ljava/util/function/Supplier;)Ljava/util/concurrent/CompletableFuture; (45 bytes) @ 0x0000ece38a559bb8 [0x0000ece38a559a80+0x0000000000000138]
j  software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler.execute(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+10
j  software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler.execute(Lsoftware/amazon/awssdk/core/client/handler/ClientExecutionParams;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+3
j  software.amazon.awssdk.services.s3.DefaultS3AsyncClient.getObject(Lsoftware/amazon/awssdk/services/s3/model/GetObjectRequest;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+234
j  software.amazon.awssdk.services.s3.DelegatingS3AsyncClient.lambda$getObject$42(Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;Lsoftware/amazon/awssdk/services/s3/model/GetObjectRequest;)Ljava/util/concurrent/CompletableFuture;+6
j  software.amazon.awssdk.services.s3.DelegatingS3AsyncClient$$Lambda$2443+0x0000000302409728.apply(Ljava/lang/Object;)Ljava/lang/Object;+12
J 10282 c1 software.amazon.awssdk.services.s3.DelegatingS3AsyncClient.invokeOperation(Lsoftware/amazon/awssdk/services/s3/model/S3Request;Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture; (11 bytes) @ 0x0000ece38a5c0274 [0x0000ece38a5c0140+0x0000000000000134]
j  software.amazon.awssdk.services.s3.DelegatingS3AsyncClient.getObject(Lsoftware/amazon/awssdk/services/s3/model/GetObjectRequest;Lsoftware/amazon/awssdk/core/async/AsyncResponseTransformer;)Ljava/util/concurrent/CompletableFuture;+9

Is there anything else in the crash report that could be of the interest to diagnose the issue?

Reproduction Steps

This is roughly what the code was doing (converted from Clojure into Java by chatGPT).

On top of this, this code used a single S3AsyncClient instance from a multiple threads. It was also consuming the InputStream using Channels.newChannel and invoking .read on it once and then closing it (often times not reading the input stream fully). It was then throwing and exception (due to premature EOF) and closing the input stream. When I fixed the code to invoke .read until the content is fully read, these crashes stopped.

import software.amazon.awssdk.services.s3.S3AsyncClient;
import software.amazon.awssdk.services.s3.model.GetObjectRequest;
import software.amazon.awssdk.core.async.AsyncResponseTransformer;

import java.io.InputStream;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

class ObjectRequestBuilder {

    public static GetObjectRequest getObjectRequest(String bucket, String key, Long offset, Long length) {
        GetObjectRequest.Builder builder = GetObjectRequest.builder()
            .bucket(bucket)
            .key(key);

        if (offset != null || length != null) {
            builder.range(bytesRange(offset, length));
        }

        return builder.build();
    }

    private static String bytesRange(Long offset, Long length) {
        // Assuming bytesRange is a utility function that builds the range string.
        if (offset == null) offset = 0L;
        if (length == null) return "bytes=" + offset + "-";
        return "bytes=" + offset + "-" + (offset + length - 1);
    }
}

public class S3ObjectFetcher {

    public static InputStream getObjectStream(S3AsyncClient client, String bucket, String key, Long offset, Long length) throws ExecutionException, InterruptedException {
        // Build the GetObjectRequest using the previously translated method.
        GetObjectRequest request = ObjectRequestBuilder.getObjectRequest(bucket, key, offset, length);

        // Fetch the object as an InputStream using AsyncResponseTransformer.
        CompletableFuture<InputStream> futureInputStream = client.getObject(request, AsyncResponseTransformer.toBlockingInputStream());

        // Since getObject is asynchronous, we need to block and wait for the result.
        return futureInputStream.get();
    }
}

Possible Solution

No response

Additional Information/Context

          software.amazon.awssdk.crt/aws-crt {:mvn/version "0.24.0"}
          software.amazon.awssdk/auth {:mvn/version "2.20.117"}
          software.amazon.awssdk/aws-core {:mvn/version "2.20.117"}
          software.amazon.awssdk/iam {:mvn/version "2.20.117"}
          software.amazon.awssdk/profiles {:mvn/version "2.20.117"}
          software.amazon.awssdk/regions {:mvn/version "2.20.117"}
          software.amazon.awssdk/s3 {:mvn/version "2.20.117"}
          software.amazon.awssdk/s3-transfer-manager {:mvn/version "2.20.117"}
          software.amazon.awssdk/sdk-core {:mvn/version "2.20.117"}
          software.amazon.awssdk/secretsmanager {:mvn/version "2.20.117"}
          software.amazon.awssdk/sesv2 {:mvn/version "2.20.117"}
          software.amazon.awssdk/sts {:mvn/version "2.20.117"}

AWS Java SDK version used

2.20.117

JDK version used

Corretto-17.0.9.8.1

Operating System and version

Ubuntu 22.04.4 LTS

@mrkam2 mrkam2 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant