-
Notifications
You must be signed in to change notification settings - Fork 1.1k
S3Client corrupts stack (or heap) on Ubuntu 24.04 #3038
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
Comments
Hi @torchedplatypi , Thank you for providing your build steps and some reproduction code. Please refer to our basic-use doc:
Unfortunately, the provided sample and the stack trace do not contain enough information to confirm that it is the case from our documentation. It would be great if you could provide a complete reproduction sample. Additionally,
is not doing anything except creating and destroying a temporary local object Best regards, |
I do call the shutdown function from our main binary. Here are the snippets of invoking our AWSHelper (which is our wrapper object Singleton, around an Aws::S3::S3Client):
Regarding Here is our original version, where the S3Client was initialized on the heap for easier management with our wrapper object:
AWSHelper.cpp
I imagine I am running into an issue with wrapping into a static object, but in execution I am declaring S3Client as a static variable inside a non-static class, which I don't believe is the edge case your basic-use doc note actually covers. I have been unable to find documentation, is there a canonical way to initialize and keep a singleton |
Hi @torchedplatypi , I agree that it is likely not the case of using the AWS SDK from a static wrapper. (You still have the issue that S3Client is getting destructed after ShutdownAPI is called, but your app execution does not reach that point). Regarding the issue, unfortunately, there is still not enough information to triage the issue.
That results in a segfault.
So far we've only advised against such usage in our documentation (to avoid wrapping the SDK Init-Shutdown methods and a client into a static class), but this is a recurring ask, so I guess we will have to provide a guidance / "API handle" wrapper. I can't give any estimate when it can be done though. Best regards, |
Hi Sergey, Thank you for the responses. I do not intend to abandon this, but currently, I cannot prioritize paring down our source base to a minimal example of just the SDK usage. My company can opt to pause the Ubuntu 22.04->24.04 migration as 22.04 is an LTS which is not EOL until 2027, so we can return to this issue at a less pressing time crunch. "It's never a bug in the kernel" :) Our implementation is inherently more suspect than the SDK or any tools/library changes from the Ubuntu upgrade. So it can very plausibly still be an issue with our implementation. But our implementation has been working for some time. Otherwise I will try to come update with a useful full stack trace if I can demonstrate it more minimally scoped to the SDK. |
A quick question, |
Yes I can confirm that. In my debugging, I spun up two fresh c7i EC2 instances, one with 22.04 and one with 24.04, ran the bash history steps I have pasted above in the Reproduction Steps. I then checked out our private repository and built and ran. 22.04 was functional, 24.04 failed. This was an attempt to isolate the problem to the OS release (as opposed to instance type [we'd previously been using burstable instances], or system configuration. I cannot think of any other variables that might be confounding. |
I tried running the hello_s3 sample in an ubuntu 24.04 docker container and it still runs fine. Here is the dockerfile that I used: FROM ubuntu:24.04
#install deps
RUN apt-get update
RUN apt-get install -y git cmake zlib1g-dev libssl-dev libcurl4-openssl-dev build-essential
#clone and build sdk
RUN git clone --depth 1 --recurse-submodules https://github.com/aws/aws-sdk-cpp && \
cd aws-sdk-cpp && \
mkdir build && \
cd build && \
cmake -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY="s3" .. && \
cmake --build . && \
cmake --install .
#copy code and build sample application
RUN mkdir sdk-example
COPY CMakeLists.txt sdk-example/CMakeLists.txt
COPY hello_s3.cpp sdk-example/hello_s3.cpp
RUN cd sdk-example && \
mkdir build && \
cd build && \
cmake .. && \
cmake --build . Does this only fail when you run it on a c7i EC2 with ubuntu 24.04? Can you try running the docker container to see if you still get the crash |
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. |
Describe the bug
on AWS c7i.large EC2 instance
attempt to initialize and use an instance of
Aws::S3::S3Client
in a non-trivial production program and the S3Client seems to corrupt the stack resulting inSIGILL, Illegal Instruction.
sThe "Hello S3" sample program here is still functional. Calling
ListBuckets()
from our application environment is also successful and does not cause stack corruption. So the bug may be localized to specific functions (other functions called in my application areGetObject
,PutObject
,ListObjects
, andHeadObject
)Expected Behavior
Continue functional operation of a production application built against the aws-sdk on Ubuntu 24.04 (migrating from Ubuntu 22.04)
Current Behavior
Some portions redacted of identifying information
Reproduction Steps
on AWS c7i.large EC2 instance, install AWS SDK per the documentation here
Now attempt to initialize and use an instance of
Aws::S3::S3Client
in a non-trivial production program and the S3Client seems to corrupt the stack resulting inSIGILL, Illegal Instruction.
sThe following are snippets of how the S3Client is instantiated by my application to confirm that it was blowing up the stack. Previously, we instantiated the client on the heap, and it caused SIGILLs in a different heap location. I rewrote to the following to instantiate it on the stack since the sample S3 Hello program creates the client on the stack, and the SIGILL backtrace moved to stack memory (when the program continues on to attempt to read and parse the file it downloaded from S3).
AWSHelper.hpp
AWSHelper.cpp
Possible Solution
This was and still remains functional on Ubuntu 22.04 as well as RHEL9.
Suspect there is a bug or lack of support for gcc 13 in Ubuntu 24.04
Additional Information/Context
No response
AWS CPP SDK version used
1.11.367
Compiler and Version used
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Operating System and version
Ubuntu 24.04 LTS -- Linux ip-172-31-15-168 6.8.0-1010-aws #10-Ubuntu SMP Thu Jun 13 17:36:15 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: