envoy: Envoy build broken on MacOS (luajit segmentation fault)
Title: Envoy build broken on MacOS (luajit segmentation fault)
Description: Envoy build is broken on MacOS.
Repro steps: Checkout https://github.com/envoyproxy/envoy/commit/f76cc4da2816759ed141ba71db8090b6aff52239 https://github.com/envoyproxy/envoy/pull/27211 That commit is the cause of the issue since build on macos is fine before that commit.
bazel build envoy
cat bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit_foreign_cc/Configure.log
Bazel external C/C++ Rules. Building library luajit
Environment:______________
TMPDIR=/var/folders/h7/pbfk8s4n235fjd3f4n6rqjm00000gp/T/
BUILD_WRAPPER_SCRIPT=bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit_foreign_cc/wrapper_build_script.sh
EXT_BUILD_ROOT=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy
INSTALLDIR=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit
__CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0
PATH=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy:/opt/homebrew/bin:/usr/local/bin:/opt/local/bin:/usr/bin:/bin
BUILD_TMPDIR=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit.build_tmpdir
PWD=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy
EXT_BUILD_DEPS=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit.ext_build_deps
SHLVL=3
BUILD_LOG=bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit_foreign_cc/Configure.log
BUILD_SCRIPT=bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit_foreign_cc/build_script.sh
_=/usr/bin/env
__________________________
+ mkdir -p /private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit.build_tmpdir/luajit
+ ARFLAGS='-static -s'
+ AR_FLAGS='-static -s'
+ ASFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -DABSL_MIN_LOG_LEVEL=4'
+ CFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -DABSL_MIN_LOG_LEVEL=4'
+ CXXFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -std=c++0x -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -DABSL_MIN_LOG_LEVEL=4 -std=c++17'
+ LDFLAGS='-undefined dynamic_lookup -headerpad_max_install_names -lc++ -lm'
+ AR=/usr/bin/libtool
+ CC=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/external/local_config_cc/cc_wrapper.sh
+ CXX=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/external/local_config_cc/cc_wrapper.sh
+ RANLIB=:
+ CPPFLAGS=
+ /private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/external/com_github_luajit_luajit/build.py --prefix=/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit.build_tmpdir/luajit
==== Building LuaJIT 2.1.0-beta3 ====
/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/rules_foreign_cc/toolchains/make/bin/make -C src
make[1]: Entering directory '/private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit.build_tmpdir/com_github_luajit_luajit/src'
make: *** [src/luajit] Segmentation fault: 11
+ set +x
cp: /private/var/tmp/_bazel_ctsai/dc58cdc16802e9ab1f2617ed8c35a161/sandbox/darwin-sandbox/6509/execroot/envoy/bazel-out/darwin_arm64-fastbuild/bin/external/envoy/bazel/foreign_cc/luajit.build_tmpdir/luajit/*: No such file or directory
Note: The Envoy_collect tool gathers a tarball with debug logs, config and the following admin endpoints: /stats, /clusters and /server_info. Please note if there are privacy concerns, sanitize the data prior to sharing the tarball/pasting.
Admin and Stats Output:
Include the admin output for the following endpoints: /stats, /clusters, /routes, /server_info. For more information, refer to the admin endpoint documentation.
Note: If there are privacy concerns, sanitize the data prior to sharing.
Config:
Include the config used to configure Envoy.
Logs:
Include the access logs and the Envoy logs.
Note: If there are privacy concerns, sanitize the data prior to sharing.
Call Stack:
If the Envoy binary is crashing, a call stack is required. Please refer to the Bazel Stack trace documentation.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 15 (13 by maintainers)
I’ve tried this fix by @adamkotwasinski
and it is working now