Skip to content

Commit

Permalink
Workaround libstdcpp TLS error (apache#19010)
Browse files Browse the repository at this point in the history
Workaround apache#17546 issue with
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in
static TLS block.

We do not yet a more "correct" solution to the problem but in order to
avoid raising new issues by users of the prod image, we implement the
workaround now.

The side effect of this is slightly (in the range of 100s of
milliseconds) slower load for any binary started and a little memory
used for Heap allocated by initialization of libstdc++.

This overhead is not happening for binaries that already link
dynamically libstdc++.
  • Loading branch information
potiuk authored and sharon2719 committed Oct 27, 2021
1 parent e55ecc0 commit 1bb9d9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,14 @@ LABEL org.apache.airflow.distro="debian" \
# to learn more about the way how signals are handled by the image
ENV DUMB_INIT_SETSID="1"

# This one is to workaround https://github.com/apache/airflow/issues/17546
# issue with /usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block
# We do not yet a more "correct" solution to the problem but in order to avoid raising new issues
# by users of the prod image, we implement the workaround now.
# The side effect of this is slightly (in the range of 100s of milliseconds) slower load for any
# binary started and a little memory used for Heap allocated by initialization of libstdc++
# This overhead is not happening for binaries that already link dynamically libstdc++
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6"

ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"]
CMD []
10 changes: 10 additions & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,16 @@ LABEL org.apache.airflow.distro="debian" \
org.opencontainers.image.title="Continuous Integration Airflow Image" \
org.opencontainers.image.description="Installed Apache Airflow with Continuous Integration dependencies"

# This one is to workaround https://github.com/apache/airflow/issues/17546
# issue with /usr/lib/x86_64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block
# We do not yet a more "correct" solution to the problem but in order to avoid raising new issues
# by users of the prod image, we implement the workaround now.
# The side effect of this is slightly (in the range of 100s of milliseconds) slower load for any
# binary started and a little memory used for Heap allocated by initialization of libstdc++
# This overhead is not happening for binaries that already link dynamically libstdc++
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6"


EXPOSE 8080

ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"]

0 comments on commit 1bb9d9c

Please sign in to comment.