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
runtime: Random golang memory corruption on all supported architectures. #23788
Comments
This looks like memory corruption. Have you tried running your program under the race detector? See https://blog.golang.org/race-detector . |
If a compiler is using undeclared variable ,the bug does not fall in category of memory corruption. In this case compiler is using undeclared variable and thus the code should not even compile. |
Can you please provide small self contained example of the compiler using an undeclared variable. Thanks. |
I would have already submitted here but Its not easy to create a simple test case for this case. Have documented sufficiently here https://github.com/deroproject/derosuite/blob/995d27eec249c7b3d908ebcf28af1449184c6cbf/crypto/ringct/mlsag.go#L159 |
I don’t understand what you mean by an undeclared variable. Could you possibly write a small program in the playground to show this, it doesn’t need to reproduce the bug your demonstrated here. Can you also try passing -gcflags=“-l -N” to disable optimisations and see if that affects the outcome. |
The race detector barks at your project. I'm using
and several others. |
It is also not true that the compiler is using undeclared variables. You wrote in the comment you linked:
If you comment line 179 here, the code in the second loop, at line 195, will start using variable |
Thanks for pointing out the mistake. |
What version of Go are you using (
go version
)?go version go1.9.2 linux/amd64
go 1.10 rc1
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/godero2"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build165738707=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
Bug affects all golang supported architectures.
What did you do?
It looks some undefined, uninitialized memory address is affecting the normal execution of the program. At first place program should not even get compiled.
See below for more details.
Bug can be reproduced by compiling following:
https://github.com/deroproject/derosuite/tree/master/cmd/derod
Pls see more details below:
https://github.com/deroproject/derosuite/blob/995d27eec249c7b3d908ebcf28af1449184c6cbf/crypto/ringct/mlsag.go#L161
If possible, provide a recipe for reproducing the error.
Comment Line no. 179 https://github.com/deroproject/derosuite/blob/995d27eec249c7b3d908ebcf28af1449184c6cbf/crypto/ringct/mlsag.go#L179
And
Uncomment Line no. 183 https://github.com/deroproject/derosuite/blob/995d27eec249c7b3d908ebcf28af1449184c6cbf/crypto/ringct/mlsag.go#L183
What did you expect to see?
Crypto checksums should get verified without any errors.
What did you see instead?
Crypto checksums starts failing randomly.
The text was updated successfully, but these errors were encountered: