-
Notifications
You must be signed in to change notification settings - Fork 39
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
StackOverflowError on Alpine when using DefaultS3CrtAsyncClient #737
Comments
Can you provide more what the error is and CRT logs? To enable logs from CRT, please refer to https://github.com/awslabs/aws-crt-java#system-properties |
Ah, sorry, completely forgot to attach them yesterday. Stack Trace (from
|
As a datapoint, I'm observing the same issue when using
and it goes away when using |
Hey, I'm also seeing the similar issues here. Just wanted to raise it as a +1 I'm using the S3TransferManager:
but we're seeing the error log
We are using it to execute a putObject but we're running into it before the connection happens. And the image we are using is some modified version of: amazoncorretto:17 jdk-alpine 3.17 |
Hi, I looked into the issue before, and I think it's probably an issue from aws-sdk-java-v2 instead. I did reach out to them, but I guess the conversation was lost. Can you create the issue at https://github.com/aws/aws-sdk-java-v2, so that it will be tracked and triaged better. |
@TingDaoK Since no exception is thrown when using the default (non-crt) client, I'm not sure whether the issue is with the SDK. But if it helps to get more eyes on this to get to the bottom of it, copying this issue there is fine by me. |
yeah, but from the stack trace we can see the exception comes from the sdk level, and also the crt log shows everything succeed. So, my current assumption is something went wrong about the integration between aws-sdk-java-v2 and aws-crt. It only happens on alpine is also very interested and likely crt related. However, given the current logs and stack trace, I think we should start from the sdk side. |
The stack trace looks sliiightly different with
now Details
|
See also aws/aws-sdk-java-v2#4935 (comment) with attached log files with The used versions:
|
Any update on this? |
I encountered the same issue with:
|
Sorry for the late response. Can someone please share your current thread stack size and try increasing it? From the logs, we don’t see any errors, so I suspect it might be a smaller stack size on Alpine. |
@waahm7 see trace ( |
@agebhar1 Can you please try increasing the thread stack size by setting the |
@agebhar1 Thanks for the project. I have tried running it and getting
Is there anything else I am supposed to setup? |
I did @waahm7 inside the Alpine container via: $ PTHREAD_STACK_MIN=8388608 java -jar -Daws.crt.memory.tracing=2 -Daws.crt.log.level=Trace -Daws.crt.log.destination=File -Daws.crt.log.filename=xyz /mnt/aws-crt-java-with-dependencies.jar but still the |
Which version of Docker and Docker Compose and OS do you use? |
The definition of musl-1.2.5 $ rg PTHREAD_STACK_MIN
include/limits.h
67:#define PTHREAD_STACK_MIN 2048
src/conf/sysconf.c
91: [_SC_THREAD_STACK_MIN] = PTHREAD_STACK_MIN,
src/thread/pthread_attr_setstacksize.c
5: if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL;
src/thread/pthread_attr_setstack.c
5: if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL; |
Thanks, I have verified that the issue is the low thread stack size on Musl. I was able to reproduce the issue and was able to fix it by bumping the thread stack size to 2MiB. I am looking into a potential fix for this issue. |
Great news @waahm7 👍 How did you increased the thread stack size? I tried with the environment variable |
@agebhar1, Thank you for your help and the sample. I hacked our low-level code to increase the stack size using |
This should be fixed in https://github.com/awslabs/aws-crt-java/releases/tag/v0.30.3. Please try it out, and let me know if the issue persists. |
@waahm7 I can confirm this to be fixed using the following versions:
Thank you! |
I can confirm it too @waahm7 for the sample 👍 |
Describe the bug
Using the
DefaultS3CrtAsyncClient
as produced byS3AsyncClient.crtBuilder().build()
fails with aStackOverflowError
on Alpine when running aListObjectsRequest
.Using
S3AsyncClient.builder().build()
(no CRT) succeeds.Expected Behavior
The CRT client works just as fine as the normal client (if not better 😉).
Current Behavior
A
StackOverflowError
is raised.Reproduction Steps
Reproduction files:
Main.java
pom.xml
Dockerfile
Then building (with buildx) and running the container, passing a bucket name as command will result in a StackOverflowError.
Possible Solution
No response
Additional Information/Context
Using a non-alpine image (removing the
-alpine
suffixes in the build layer and run layer base image) does not result in the same exception.aws-crt-java version used
0.29.2
Java version used
21.0.1
Operating System and version
Alpine Linux v3.18
The text was updated successfully, but these errors were encountered: