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
cmd/compile: -B on 32bit GOARCHs causes internal compiler error #48092
Comments
It looks like the crash is triggered when compiling internal/abi:
Tip also crashes. Other GOARCHs are also affected. Both |
This happens when we do:
The compiler uses an explicit "never use me" value for This happens in It's not entirely clear to me that this is a bug worth fixing. |
Change https://golang.org/cl/346589 mentions this issue: |
I don't think this is worth backporting, though. It's easy enough to work around by either not indexing 0-length arrays, or not using |
I agree that a backport is not needed here.
However it puzzled me to seriously think this was not worth fixing. It
means that library code that comes with Go did not compile with the
compiler it comes with, assuming a specific flag that doesn't have such an
indication.
(But a fix in the library code to not index 0-sized arrays would of course
have been just as good)
Anyway, thanks for the fix!
…On Tue, Aug 31, 2021, 17:50 GopherBot ***@***.***> wrote:
Closed #48092 <#48092> via 1f83a8c
<1f83a8c>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#48092 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB5NMHBZ5GZGT74H4WALCDT7VFCVANCNFSM5DEA4AXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
|
Summary: The -B option under gcflags disables runtime bounds checking on arrays. In itself this is not ideal plus doing so can apparently trigger the bug mentioned at: golang/go#48092 Unfortunately this change does add some overhead. Size comparison of old and new binaries: ``` 0 /tmp $ ls -l pp/flashy qq/flashy -rwxr-xr-x 1 doranand users 2555904 May 2 04:14 pp/flashy -rwxr-xr-x 1 doranand users 2949120 May 6 06:52 qq/flashy ``` Test Plan: ``` 0 ~/local/openbmc/tools/flashy $ ./build.sh && ./build_dev.sh && go test ./... && echo it wokred ok github.com/facebook/openbmc/tools/flashy 1.288s ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/common (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/galaxy100 (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/wedge100 (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/yamp (cached) ? github.com/facebook/openbmc/tools/flashy/flash_procedure [no test files] ok github.com/facebook/openbmc/tools/flashy/install 0.022s ok github.com/facebook/openbmc/tools/flashy/lib/fileutils (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash/flashcp (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash/flashutils (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash/flashutils/devices (cached) ? github.com/facebook/openbmc/tools/flashy/lib/logger [no test files] ok github.com/facebook/openbmc/tools/flashy/lib/step (cached) ok github.com/facebook/openbmc/tools/flashy/lib/utils (cached) ok github.com/facebook/openbmc/tools/flashy/lib/validate (cached) ok github.com/facebook/openbmc/tools/flashy/lib/validate/image (cached) ok github.com/facebook/openbmc/tools/flashy/lib/validate/partition (cached) ? github.com/facebook/openbmc/tools/flashy/tests [no test files] ? github.com/facebook/openbmc/tools/flashy/utilities [no test files] it wokred ``` Build ephemeral fbpkg and use to test upgrade a BMC: ``` 0 ~/local/openbmc $ fbpkg build -E openbmc.utils.flashy fbpkg/client.py:5112: DeprecationWarning: 'click.get_terminal_size()' is deprecated and will be removed in Click 8.1. Use 'shutil.get_terminal_size()' instead. 2022-05-06 06:52:11,363 fbpkg.build INFO: found configerator config: openbmc/fbpkgs/utils/openbmc.utils.flashy.fbpkg There are uncommitted changes in this repository. See: https://fburl.com/fbpkg_local_changes . This may make debugging this version impossible. Proceed? [y/N]: y 2022-05-06 06:52:31,432 fbpkg.build INFO: Building: openbmc.utils.flashy 2022-05-06 06:52:32,127 fbpkg.build INFO: creating fbpkg archive for openbmc.utils.flashy:1b41dcd 2022-05-06 06:52:32,139 fbpkg.util INFO: generating CHECKSUMS file for openbmc.utils.flashy:1b41dcd 2022-05-06 06:52:32,139 fbpkg.compression INFO: compressing /tmp/tmpnaugfb08/fbpkg__openbmc.utils.flashy:1b41dcd.tar using /usr/bin/pigz 2022-05-06 06:52:32,192 fbpkg.build INFO: generating fbpkg MetaData 2022-05-06 06:52:33,022 fbpkg.meta INFO: creating package versions in staging 2022-05-06 06:52:40,147 fbpkg.meta INFO: creating package versions complete openbmc.utils.flashy:1b41dcd 0 ~/local/openbmc $ oobgrader --wait --flashy-tag 1b41dcd --host fboss8845197-oob.snc1 --force ... Host Workflow ID Progress Status Result --------------------- ------------------------------------ ---------- ----------------------- ---------------------- fboss8845197-oob.snc1 f4af702d-9834-4ee0-a5b1-ee26eb9c7af4 finished WorkflowStatus.FINISHED FinishStatus.SUCCEEDED ``` Reviewed By: deathowl fbshipit-source-id: 849a4423478b8e517a41937163909964eaeaf57b
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
A Win32 PE EXE file that does nothing.
What did you see instead?
Note: without the
-B
flag, the issue does not occur. Onlinux/amd64
andwindows/amd64
-B
is fine to use and improves performance.The text was updated successfully, but these errors were encountered: