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

Segmentation fault on alpine 19 #8423

Closed
cloudcode-hungary opened this issue Dec 21, 2023 · 12 comments
Closed

Segmentation fault on alpine 19 #8423

cloudcode-hungary opened this issue Dec 21, 2023 · 12 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness p2 This is a standard priority issue

Comments

@cloudcode-hungary
Copy link

Describe the bug

Any command run under alpine 3.19 results in segmentation error.

aws --version
Segmentation fault (core dumped)

Alpine linux 3.19 has been included in docker images just recently, definietly related.

Expected Behavior

Works fine under the latest alpine image.

Current Behavior

Crashes with segmentation fault

Reproduction Steps

It can be reproduced in a docker image.

FROM docker:dind

RUN curl -sL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip \
    && unzip awscliv2.zip \
    && aws/install \
    && rm -rf \
        awscliv2.zip \
        aws \
        /usr/local/aws-cli/v2/*/dist/aws_completer \
        /usr/local/aws-cli/v2/*/dist/awscli/data/ac.index \
        /usr/local/aws-cli/v2/*/dist/awscli/examples

RUN aws --version
# errorSegmentation fault (core dumped)

Chaging the source image: FROM docker:24.0.7-dind-alpine3.18 and everything works fine.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.13.29 Python/3.11.6 Linux/6.2.0-39-generic exe/x86_64.alpine.3 prompt/off

Environment details (OS name and version, etc.)

Alpine linux 3.19 (official docker:dind image)

@cloudcode-hungary cloudcode-hungary added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 21, 2023
@LadaVarga
Copy link

Hello,
This version is used on CircleCI when we use aws-s3 orb. Is there any workaround for this.

@ale-munozarancibia
Copy link

Hi, I found the same segmentation fault problem using Fedora Linux 35 x86-64.

@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jan 18, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 18, 2024
@RyanFitzSimmonsAK
Copy link
Contributor

Hi, thanks for reaching out and for your patience. If it produces meaningful logging before the error, could you provide debug logs of a command resulting in a segmentation fault? You can get debug logs by adding --debug to the command. Thanks!

@ale-munozarancibia
Copy link

Thanks @RyanFitzSimmonsAK! I ran /usr/local/bin/aws --version --debug but did not get any logs, only output was Segmentation fault (core dumped)

@timothybonci
Copy link

timothybonci commented Jan 25, 2024

I'm getting seg fault on install, and if I try and run "install --debug", I get "Got an unexpected argument: --debug"

Edit: ^^^ This is install from the download (https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip). Switching to using the apk in the registry works.

@cloneluke
Copy link

cloneluke commented Jan 31, 2024

bump this, I got the error also and did some investigating

on Dec 7, 3.19 alpine came out

Docker Hub

00c673c8-41dd-4e8d-a562-ab66484b1a11

terraform uses the latest alpine in its docker hub image here:

terraform/Dockerfile at 53c34ff49cfbc1f70d7cdd3dca8040551c53737a · hashicorp/terraform (github.com)
image-20240129-192345

terraform 1.66 came out on dec 13 and built on alpine 3.19

Tags · hashicorp/terraform (github.com)

fc236446-c94f-42b6-8e9c-2b8a2eb4c7f4

I got the error using the above docker hub image in circle ci which is based on alpine 3.19

image

If I change to terraform 1.65 image (alpine 3.18) all of the above works fine.

I tested with aws-cli 2.15.15 and 2.15.3, both are broken, I did not go furth back than that.

@ragnarkurmwunder
Copy link

This works in 3.19: RUN apk add aws-cli

@cloneluke
Copy link

This works in 3.19: RUN apk add aws-cli

Installing package is fine, running the cli after install is what throws a segmentation fault for me.

@kimyu92
Copy link

kimyu92 commented Feb 7, 2024

Running into same seg fault core dump issues with alpine 3.19.

@elliot
Copy link

elliot commented Feb 14, 2024

Could be an issue with the linker

cbf3a00de678:~# ldd /usr/local/bin/aws
	/lib64/ld-linux-x86-64.so.2 (0x7f5f68ffc000)
	libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f5f68ffc000)
	libz.so.1 => /lib/libz.so.1 (0x7f5f68fe2000)
	libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f5f68ffc000)
	libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f5f68ffc000)
Error relocating /usr/local/bin/aws: __strcat_chk: symbol not found
Error relocating /usr/local/bin/aws: __snprintf_chk: symbol not found
Error relocating /usr/local/bin/aws: __vfprintf_chk: symbol not found
Error relocating /usr/local/bin/aws: __realpath_chk: symbol not found
Error relocating /usr/local/bin/aws: __strdup: symbol not found
Error relocating /usr/local/bin/aws: __memcpy_chk: symbol not found
Error relocating /usr/local/bin/aws: __vsnprintf_chk: symbol not found
Error relocating /usr/local/bin/aws: __strcpy_chk: symbol not found
Error relocating /usr/local/bin/aws: __fprintf_chk: symbol not found

@cloneluke
Copy link

if you are on circleci, using the aws cli orb and can go to the latest aws cli 2.13.25 , then you can upgrade your orb:

https://github.com/CircleCI-Public/aws-cli-orb/releases/tag/v4.1.3

@otremblay and @brentmmarks helped fix the orb that had a workaround before for alpine:

CircleCI-Public/aws-cli-orb@c5a792e

of specific interest:

image

CircleCI-Public/aws-cli-orb@c5a792e#diff-f844f8b30ba3e4871302ed76f5c918662bd1e96e57fb7c10ff0cade4ad9e355aL17-L33

upgrade of orb:

image

also this old issue shows that same method of install here:

apk add --no-cache aws-cli

#4971

@tim-finnigan
Copy link
Contributor

tim-finnigan commented Aug 6, 2024

Please refer to the documentation to Build and install the AWS CLI from source for this use case. As noted there, Alpine Linux uses musl, but the current installers require glibc causing the pre-built installers to not immediately work. But this approach works for me:

FROM python:3.11-alpine3.19 AS builder

ENV AWSCLI_VERSION=2.17.21

RUN apk add --no-cache \
    curl \
    make \
    cmake \
    gcc \
    g++ \
    libc-dev \
    libffi-dev \
    openssl-dev \
    && curl https://awscli.amazonaws.com/awscli-${AWSCLI_VERSION}.tar.gz | tar -xz \
    && cd awscli-${AWSCLI_VERSION} \
    && ./configure --prefix=/opt/aws-cli/ --with-download-deps \
    && make \
    && make install

FROM python:3.11-alpine3.19

RUN apk --no-cache add groff

COPY --from=builder /opt/aws-cli/ /opt/aws-cli/

ENTRYPOINT ["/opt/aws-cli/bin/aws"]

@tim-finnigan tim-finnigan added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Aug 6, 2024
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 10, 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. closed-for-staleness p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

10 participants