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

plugin: R15 clobbered when loading outside variables #36509

Open
timorl opened this issue Jan 11, 2020 · 0 comments
Open

plugin: R15 clobbered when loading outside variables #36509

timorl opened this issue Jan 11, 2020 · 0 comments

Comments

@timorl
Copy link

@timorl timorl commented Jan 11, 2020

What version of Go are you using (go version)?

$ go version
go version go1.13.5 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/timorl/.cache/go-build"
GOENV="/home/timorl/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="[REDACTED]"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="x86_64-pc-linux-gnu-gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build858965079=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Encountered a bug when using cloudflare/bn256 inside of a plugin. After reporting it here we have a minimal example here.

The minimal example loads 1 into R15, then reads an unrelated variable and returns the contents of R15.

What did you expect to see?

The number 1 being returned.

What did you see instead?

Random huge numbers.

Other

I strongly suspect this is essentially the same problem as #18820, but with a different library. From what I understand this probably won't be changed, but I could not find any official statement that no one should expect using R15 and loading variables to work together when dynamically linking, so it is technically still a bug, right?

@timorl timorl changed the title Pluins clobber R15 Plugins clobber R15 when loading outside variables Jan 11, 2020
@smasher164 smasher164 changed the title Plugins clobber R15 when loading outside variables plugin: R15 clobbered when loading outside variables Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.