Skip to content

Latest Alpine image seg faults #20

Closed

Description

@zoidyzoidzoid
± docker run -it --rm memcached:1.4.37-alpine -o modern -m 32
Unable to find image 'memcached:1.4.37-alpine' locally
1.4.37-alpine: Pulling from library/memcached
6f821164d5b7: Pull complete
338fbb6cf27a: Pull complete
0930cf93b5b2: Pull complete
7bdbb30d4915: Pull complete
54c1d5e73dc6: Pull complete
Digest: sha256:ae33b9e8b100774d92277df779bc0d72bae81a2f62741106e7ea4cd683e2a507
Status: Downloaded newer image for memcached:1.4.37-alpine
± echo $?
139
± docker run -it --rm memcached:1.4.36-alpine -o modern -m 32
Unable to find image 'memcached:1.4.36-alpine' locally
1.4.36-alpine: Pulling from library/memcached
6f821164d5b7: Already exists
338fbb6cf27a: Already exists
714c5ae9370a: Pull complete
3a1e7538d8c8: Pull complete
952bb42ade1c: Pull complete
Digest: sha256:00b68b00139155817a8b1d69d74865563def06b3af1e6fc79ac541a1b2f6b961
Status: Downloaded newer image for memcached:1.4.36-alpine
^CSignal handled: Interrupt.

± echo $?
0

Activity

  1. tianon commented on Jun 21, 2017

    @tianon
    Member

    Seems to be something specifically to do with -o modern -- I can only reproduce by including that. 😕

  2. zoidyzoidzoid commented on Jul 7, 2017

    @zoidyzoidzoid
    Author

    And still happens with 14.39 😞

    Think it's us or upstream Alpine image?

  3. tianon commented on Jul 7, 2017

    @tianon
    Member

    For compiling memcached itself, we make no changes from Debian to Alpine, so it's bound to be something odd happening between memcached and musl. 😞

    Can it be reproduced with the Alpine package of memcached? (https://pkgs.alpinelinux.org/package/v3.6/main/x86_64/memcached)

    That would at least help us confirm that it's not something we're doing odd, and is instead more likely something musl-related.

    Here's our full Debian->Alpine diff, for context:

    --- debian/Dockerfile	2017-07-05 11:14:17.003901806 -0700
    +++ alpine/Dockerfile	2017-07-05 11:14:17.002901835 -0700
    @@ -1,25 +1,25 @@
    -FROM debian:jessie-slim
    +FROM alpine:3.5
     
     # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
    -RUN groupadd -r memcache && useradd -r -g memcache memcache
    +RUN adduser -D memcache
     
     ENV MEMCACHED_VERSION 1.4.39
     ENV MEMCACHED_SHA1 9d6f77f4f9f1b50289882fd88851dece7699c74b
     
     RUN set -x \
    -	&& buildDeps=' \
    +	&& apk add --no-cache --virtual .build-deps \
     		ca-certificates \
    -		dpkg-dev \
    +		coreutils \
    +		cyrus-sasl-dev \
    +		dpkg-dev dpkg \
     		gcc \
    -		libc6-dev \
    +		libc-dev \
     		libevent-dev \
    -		libsasl2-dev \
    +		libressl \
    +		linux-headers \
     		make \
     		perl \
    -		wget \
    -	' \
    -	&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
    -	&& rm -rf /var/lib/apt/lists/* \
    +		tar \
     	&& wget -O memcached.tar.gz "https://memcached.org/files/memcached-$MEMCACHED_VERSION.tar.gz" \
     	&& echo "$MEMCACHED_SHA1  memcached.tar.gz" | sha1sum -c - \
     	&& mkdir -p /usr/src/memcached \
    @@ -32,10 +32,15 @@
     	&& make -j "$(nproc)" \
     	&& make install \
     	&& cd / && rm -rf /usr/src/memcached \
    -	&& apt-mark manual \
    -		libevent-2.0-5 \
    -		libsasl2-2 \
    -	&& apt-get purge -y --auto-remove $buildDeps \
    +	&& runDeps="$( \
    +		scanelf --needed --nobanner --recursive /usr/local \
    +			| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
    +			| sort -u \
    +			| xargs -r apk info --installed \
    +			| sort -u \
    +	)" \
    +	&& apk add --virtual .memcached-rundeps $runDeps \
    +	&& apk del .build-deps \
     	&& memcached -V
     
     COPY docker-entrypoint.sh /usr/local/bin/
  4. zoidyzoidzoid commented on Jul 11, 2017

    @zoidyzoidzoid
    Author

    It's happening on edge with the packaged memcached when using -o modern as well. 😞

    docker run -it --rm alpine:edge                                                                                                                                  
    / # apk add --no-cache memcached
    / # memcached -V
    memcached 1.4.39
    
    / # memcached -u root -o modern
    Segmentation fault (core dumped)
    

    On 3.6.2 it behaves as expected because it uses 1.4.36:

    docker run -it --rm alpine
    / # cat /etc/alpine-release
    3.6.2
    / # apk add --no-cache memcached
    / # memcached -V
    memcached 1.4.36
    / # memcached -u root -o modern
    ^CSignal handled: Interrupt.
    
  5. dormando commented on Jul 16, 2017

    @dormando

    ahh sorry, I thought I'd responded for some reason.

    Not sure why that was missing... I just installed musl locally, compiled libevent with musl, then compiled memcached and was able to get it to crash... but it can't build memcached-debug under musl sadly :/

    I was able to do a quick bisect and narrowed it down to d184b4b08f92d0171c8a3a3f03fa22e33c6aaa55 - dunno what I did just yet but that does seem to be where it's segfaulting so I must've done something stupid.

  6. dormando commented on Jul 16, 2017

    @dormando

    found it, followed up in the linked issue. would appreciate some testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions