Comments (11)
This was really odd.
The line of code breaking is
atomic.StoreInt64(&result.lastReroute, time.Now().UnixNano())
which doesn't even use Mutexes.
Your Go version seems broken? What version are you running?
from god.
I am on tip (currently go1.1rc2).
Problem is consistent with 32-bit build of Go on Win7.
With 64-bit build of Go there is no issue.
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" ?
from god.
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
from god.
Tried with go1.0.3 (32bit), there is no crash. Seems to be a go1.1 issue. I will post on go-nuts list.
from god.
With latest go1.1rc3 the panic stack is as below:
D:\sources\gopath\bin>god_server.exe
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x4a924b]
goroutine 1 [running]:
sync/atomic.StoreUint64()
D:/sources/golang/src/pkg/sync/atomic/asm_386.s:147 +0xb
github.com/zond/god/common.(_TimeLock).Lock(0x12b83900)
D:/sources/gopath/src/github.com/zond/god/common/time_lock.go:28 +0xba
github.com/zond/god/radix.(_Tree).Put(0x12b6ddb0, 0x12b6be20, 0xa, 0xa, 0x12b6be30, ...)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:591 +0x53
github.com/zond/god/radix.func-+006(0x12b6be20, 0xa, 0xa, 0x0, 0x0, ...)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:240 +0xd2
github.com/zond/god/persistence.(_logfile).play(0x12c2c3c0, 0x2716d4)
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:90 +0x10b
github.com/zond/god/persistence.(_Logger).Play(0x12c1f030, 0x2716d4)
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:237 +0xe6
github.com/zond/god/radix.(*Tree).Restore(0x12b6ddb0, 0x12b6b200)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:259 +0x59
github.com/zond/god/dhash.NewNodeDir(0x12b6b210, 0xe, 0x12b6b230, 0xe, 0x12b6b200, ...)
D:/sources/gopath/src/github.com/zond/god/dhash/dhash.go:110 +0x26b
main.main()
D:/sources/gopath/src/github.com/zond/god/god_server/god_server.go:29 +0x29d
from god.
Great!
On Fri, May 10, 2013 at 5:13 AM, sgn [email protected] wrote:
Tried with go1.0.3 (32bit), there is no crash. Seems to be a go1.1 issue.
I will post on go-nuts list.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-17702273
.
from god.
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
can't be un-initialized). Therefore, how can it ever be nil?
The fact that this does not panic at all in 1.0.3 also indicates a bug in
Go 1.1. Would you post that bug as well to the go-nuts list?
On Fri, May 10, 2013 at 5:23 AM, sgn [email protected] wrote:
With latest go1.1rc3 the panic stack is as below:
D:\sources\gopath\bin>god_server.exe
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x4a924b]goroutine 1 [running]:
sync/atomic.StoreUint64()
D:/sources/golang/src/pkg/sync/atomic/asm_386.s:147 +0xb
github.com/zond/god/common.(_TimeLock).Lock(0x12b83900)
D:/sources/gopath/src/github.com/zond/god/common/time_lock.go:28 +0xba
github.com/zond/god/radix.(_Tree).Put(0x12b6ddb0, 0x12b6be20, 0xa, 0xa,
0x12b6be30, ...)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:591 +0x53
github.com/zond/god/radix.func-+006(0x12b6be20, 0xa, 0xa, 0x0, 0x0, ...)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:240 +0xd2
github.com/zond/god/persistence.(_logfile).play(0x12c2c3c0, 0x2716d4)
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:90+0x10b
github.com/zond/god/persistence.(_Logger).Play(0x12c1f030, 0x2716d4)
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:237+0xe6
github.com/zond/god/radix.(*Tree).Restore(0x12b6ddb0, 0x12b6b200)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:259 +0x59
github.com/zond/god/dhash.NewNodeDir(0x12b6b210, 0xe, 0x12b6b230, 0xe,
0x12b6b200, ...)
D:/sources/gopath/src/github.com/zond/god/dhash/dhash.go:110 +0x26b
main.main()
D:/sources/gopath/src/github.com/zond/god/god_server/god_server.go:29+0x29d—
Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-17702483
.
from god.
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 [email protected] 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 can't be un-initialized). Therefore, how can it ever be nil?The fact that this does not panic at all in 1.0.3 also indicates a bug in
Go 1.1. Would you post that bug as well to the go-nuts list?On Fri, May 10, 2013 at 5:23 AM, sgn [email protected] wrote:
With latest go1.1rc3 the panic stack is as below:
D:\sources\gopath\bin>god_server.exe
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x4a924b]goroutine 1 [running]:
sync/atomic.StoreUint64()
D:/sources/golang/src/pkg/sync/atomic/asm_386.s:147 +0xb
github.com/zond/god/common.(_TimeLock).Lock(0x12b83900)
D:/sources/gopath/src/github.com/zond/god/common/time_lock.go:28 +0xba
github.com/zond/god/radix.(_Tree).Put(0x12b6ddb0, 0x12b6be20, 0xa, 0xa,
0x12b6be30, ...)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:591 +0x53
github.com/zond/god/radix.func-+006(0x12b6be20, 0xa, 0xa, 0x0, 0x0, ...)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:240 +0xd2
github.com/zond/god/persistence.(_logfile).play(0x12c2c3c0, 0x2716d4)
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:90+0x10b
github.com/zond/god/persistence.(_Logger).Play(0x12c1f030, 0x2716d4)
D:/sources/gopath/src/github.com/zond/god/persistence/persistence.go:237+0xe6
github.com/zond/god/radix.(*Tree).Restore(0x12b6ddb0, 0x12b6b200)
D:/sources/gopath/src/github.com/zond/god/radix/tree.go:259 +0x59
github.com/zond/god/dhash.NewNodeDir(0x12b6b210, 0xe, 0x12b6b230, 0xe,
0x12b6b200, ...)
D:/sources/gopath/src/github.com/zond/god/dhash/dhash.go:110 +0x26b
main.main()
D:/sources/gopath/src/github.com/zond/god/god_server/god_server.go:29+0x29d—
Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-17702483
.
from god.
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.
from god.
Yes, works with this change.
from god.
Perfect :)
from god.
Related Issues (17)
- "../web/web.go:4:2: no Go source files in" god/templates HOT 1
- panic HOT 3
- god_server fails to start on windows due to mkdir of invalid directory
- Docs not updated? HOT 2
- Question about latency/garbage collection HOT 1
- Warning / Error? HOT 9
- Detailed explanation for SetExpression and Operations? HOT 10
- newb Issue HOT 6
- Test test
- DB is not progress? HOT 1
- how to maintain a radix tree in god? HOT 7
- stoped the development? HOT 1
- Your code is not worthy of being called "God" HOT 1
- Set Intersection Theoretical Question. HOT 16
- License? HOT 3
- Support different bind and announce IPs HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from god.