Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go1.10 plan9/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env
)?
GOARCH='amd64'
GOBIN='/usr/henesy/go/bin'
GOCACHE='/usr/henesy/lib/cache/go-build'
GOEXE=''
GOHOSTARCH='amd64'
GOHOSTOS='plan9'
GOOS='plan9'
GOPATH='/usr/henesy/git'
GORACE=''
GOROOT='/sys/go/go'
GOTMPDIR=''
GOTOOLDIR='/sys/go/go/pkg/tool/plan9_amd64'
GCCGO='gccgo'
CC='6c'
CXX='g++'
CGO_ENABLED='0'
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build797076891=/tmp/go-build -gno-record-gcc-switches'
What did you do?
I ran/built https://github.com/src-d/go-git with a patch on the https://github.com/src-d/go-billy dependency as per src-d/go-billy#52.
If you go install
go-git without any changes, the library builds and you can then build the demo programs in go-git/_examples
clone.go and commit.go successfully. Clone will run successfully, but if you build and run commit you get the following crash error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal sys: trap: fault read code=0x0 addr=0x0 pc=0x509499]
goroutine 1 [running]:
gopkg.in/src-d/go-git%2ev4.(*Worktree).doUpdateFileToIndex(0x4209a3aa0, 0x420954200, 0x5c3607, 0x9, 0x3f34afae9c41494b, 0xbc744bc185055bf0, 0x6121711061217110, 0x0, 0x20f94d)
/usr/henesy/git/src/gopkg.in/src-d/go-git.v4/worktree_status.go:375 +0x149
gopkg.in/src-d/go-git%2ev4.(*Worktree).addOrUpdateFileToIndex(0x4209a3aa0, 0x5c3607, 0x9, 0x3f34afae9c41494b, 0xbc744bc185055bf0, 0x61217110, 0x0, 0x0)
/usr/henesy/git/src/gopkg.in/src-d/go-git.v4/worktree_status.go:343 +0x15e
gopkg.in/src-d/go-git%2ev4.(*Worktree).Add(0x4209a3aa0, 0x5c3607, 0x9, 0x0, 0x0, 0x0, 0x10, 0x4209a8490)
/usr/henesy/git/src/gopkg.in/src-d/go-git.v4/worktree_status.go:265 +0x2d1
main.main()
/usr/henesy/prg/go/git/commit.go:35 +0x12c
If you copy the linux worktree file as follows in go-git and change the header to // +build plan9
, the compiler catches the error:
cp worktree_linux.go worktree_plan9.go
sav-cpu% go install
# gopkg.in/src-d/go-git.v4
./worktree_plan9.go:14:22: undefined: syscall.Stat_t
What did you expect to see?
A compiler error pointing out that syscall.Stat_t
is not present on Plan 9.
What did you see instead?
No errors at build time. Running the program results in a crash with an error.