-
Notifications
You must be signed in to change notification settings - Fork 39
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
god_server panics due to invalid memory referencing on windows #15
Comments
This was really odd. The line of code breaking is
which doesn't even use Mutexes. Your Go version seems broken? What version are you running? |
I am on tip (currently go1.1rc2). Problem is consistent with 32-bit build of Go on Win7. I rebuilt Go and tried with same result. Am sure there is no issue with Go version. Stack trace showing Mutex is something I do not have an answer to right now. Does the sync/atomic achieve atomicity without "mutex" ? |
Have you tried it with 1.0.x? Really strange that it happens in 32 but not 64 bits. sync/atomic ought to work without mutexes, it should do its stuff using http://en.wikipedia.org/wiki/Compare-and-swap |
Tried with go1.0.3 (32bit), there is no crash. Seems to be a go1.1 issue. I will post on go-nuts list. |
With latest go1.1rc3 the panic stack is as below: D:\sources\gopath\bin>god_server.exe goroutine 1 [running]: |
Great! On Fri, May 10, 2013 at 5:13 AM, sgn notifications@github.com wrote:
|
This was very odd as well. The line in question 28 atomic.StoreInt64(&self.locktimes[self.index], time.Now().UnixNano()) is referencing the locktimes of self, which is an array (not a slice, so it The fact that this does not panic at all in 1.0.3 also indicates a bug in On Fri, May 10, 2013 at 5:23 AM, sgn notifications@github.com wrote:
|
Ah, I just read the lastest digest from go-nuts. I will see if I can create a patch that solves the alignment issue. On Fri, May 10, 2013 at 8:26 AM, Martin Bruse zondolfin@gmail.com wrote:
|
So, see if that helps. I just moved the arrays and ints in question to be at the very top of the struct they are part of. |
Yes, works with this change. |
Perfect :) |
After changing god server's dir name from ip:port to ip_port, the server panics as below:
D:\sources\gopath\src\github.com\zond\god\god_server>god_server
panic: runtime error: invalid memory address or nil pointer dereference
panic: sync: unlock of unlocked mutex
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x49ce6b]
goroutine 1 [running]:
sync.(_Mutex).Unlock(0x12c87f60)
D:/sources/golang/src/pkg/sync/mutex.go:91 +0x79
sync.(_RWMutex).Unlock(0x12c87f60)
D:/sources/golang/src/pkg/sync/rwmutex.go:113 +0x77
sync/atomic.StoreUint64()
D:/sources/golang/src/pkg/sync/atomic/asm_386.s:147 +0xb
github.com/zond/god/dhash.func-+016(0x12d0cc40, 0x12d0cc60)
D:/sources/gopath/src/github.com/zond/god/dhash/dhash.go:104 +0x9b
github.com/zond/god/common.(_Ring).sendChanges(0x12c87f40, 0x12c5bc00, 0x10, 0x10)
D:/sources/gopath/src/github.com/zond/god/common/ring.go:103 +0x141
github.com/zond/god/common.(_Ring).Add(0x12c87f40, 0x12c5bb80, 0x10, 0x10, 0x12c5b270, ...)
D:/sources/gopath/src/github.com/zond/god/common/ring.go:182 +0x49f
github.com/zond/god/discord.(_Node).Start(0x12c5cf40, 0x0, 0x0)
D:/sources/gopath/src/github.com/zond/god/discord/node.go:208 +0x36b
github.com/zond/god/dhash.(_Node).Start(0x12c61840, 0x0, 0x0)
D:/sources/gopath/src/github.com/zond/god/dhash/dhash.go:198 +0xcd
github.com/zond/god/dhash.(*Node).MustStart(0x12c61840, 0xe)
D:/sources/gopath/src/github.com/zond/god/dhash/dhash.go:393 +0x28
main.main()
D:/sources/gopath/src/github.com/zond/god/god_server/god_server.go:48 +0x333
goroutine 2 [syscall]:
goroutine 17 [select]:
github.com/zond/god/persistence.(_Logger).record(0x12c5e390, 0x12d0d240)
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:402 +0x414
created by github.com/zond/god/persistence.(_Logger).Record
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:382 +0x10d
goroutine 18 [syscall]:
syscall.Syscall6(0x7549d3ab, 0x5, 0xd0, 0x12c5bcb0, 0x12bf0a98, ...)
D:/sources/golang/src/pkg/runtime/zsyscall_windows_windows_386.c:97 +0x49
syscall.GetQueuedCompletionStatus(0xd0, 0x12c5bcb0, 0x12bf0a98, 0x12bf0a90, 0xffffffff, ...)
D:/sources/golang/src/pkg/syscall/zsyscall_windows_386.go:507 +0x7e
net.(*resultSrv).Run(0x12bf09a0)
D:/sources/golang/src/pkg/net/fd_windows.go:150 +0x11a
created by net.startServer
D:/sources/golang/src/pkg/net/fd_windows.go:285 +0xde
The text was updated successfully, but these errors were encountered: