-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
g++ fpermissive compilation error for strdupa on musl when buiding from source #15729
Comments
Hello @xhebox, Could you please provide complete steps to reproduce the above issue at our end. Thanks! |
Edited, it really needs nothing more than normal building instructions. You could try this on alpine linux with docker. I am on my own custom linux distro with musl libc. |
I will send a patch removing the strdupa, since there is exactly one usage in whole of bazel. |
Strdupa has potential to be unsafe thanks to the possibly unbound stack usage. It also generates warnings when compiled on musl. This commit therefore replaces it with properly checked heap allocation using strdup. Fixes bazelbuild#15729
@bazel-io flag |
@bazel-io fork 5.3.0 |
Strdupa has potential to be unsafe thanks to the possibly unbound stack usage. It also generates warnings when compiled on musl. This commit therefore replaces it with properly checked heap allocation using strdup. Fixes #15729 Closes #15763. PiperOrigin-RevId: 458440234 Change-Id: I8c8574f654295086f767b4fc4ca6fc1e59097beb Co-authored-by: Tomas Volf <tomas.volf@showmax.com>
Description of the bug:
g++ will report errors as follows:
I've sent patches to musl, ref this. Despite whether musl will accept the patch, I agreed with the author of musl that using strdupa is probably not a good idea. And we have other replacement.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Build bazel 5.2.0 on musl by:
You could try this on an docker alpine linux image.
Which operating system are you running Bazel on?
linux with musl libc
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: