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

make segfaults while building LuaJIT for Envoy when using bazel 7.x.y #1338

Open
asedeno opened this issue Dec 10, 2024 · 4 comments
Open

make segfaults while building LuaJIT for Envoy when using bazel 7.x.y #1338

asedeno opened this issue Dec 10, 2024 · 4 comments

Comments

@asedeno
Copy link

asedeno commented Dec 10, 2024

We're trying to update Envoy to Bazel 7.4.1 (see envoyproxy/envoy#37578).

One of our blockers is that our MacOS build is failing to build LuaJIT.1

Digging into it, I found that the GNUMake build from rules_foreign_cc was segfaulting on make -C src in LuaJIT's top-level Makefile. Furthermore, I could reproduce this segfault using the bazel/rules_foreign_cc-built make on a clean checkout of LuaJIT's source, otherwise entirely outside of bazel, both at toplevel via make -C src and in src with just make. I could not reproduce the segfault with a freshly built copy of GNUMake 4.4.1, which is the same version bazel/rules_foreign_cc had.

Here's a repository containing a minimal repro based on the build in Envoy:

This works fine with bazel 6.5.0, and breaks in all bazel 7.x.y that I've tried, including but not limited to 7.0.0 and 7.4.1.

I'm out of ideas on this for the day, but figured capturing this would be useful. Again, I'm seeing this only on MacOS.

Footnotes

  1. https://github.com/envoyproxy/envoy/actions/runs/12265446817/job/34221552445#step:16:956

@asedeno
Copy link
Author

asedeno commented Dec 11, 2024

I didn't mention macOS platform specifics, but yesterday I was working on an M1 MacBook pro running macOS 15 (Sequoia). Today I've further reproduced the issue on an older intel-based MacBook Pro running macOS 11 (BigSur).

@asedeno
Copy link
Author

asedeno commented Dec 11, 2024

I've tracked this down to LDFLAGS for the GNU make in rules_foreign_cc gaining a -lm.

@asedeno
Copy link
Author

asedeno commented Dec 12, 2024

In https://github.com/asedeno/luajit-bazel/tree/minus-luajit I've replaced LuaJIT with make_simple from examples/ in this repo, and then copied that to make_wildcard and tweaked one line in the Makefile to reproduce the segfault.

@asedeno
Copy link
Author

asedeno commented Dec 12, 2024

And this is a dupe of #1227, which has experienced radio silence since July.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant