zond / god

A Go database
Other
531 stars 38 forks source link

newb Issue #2

Closed ai10 closed 11 years ago

ai10 commented 11 years ago

chuck:server$ go run server.go

github.com/zond/god/murmur

/usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:27:23: warning: always_inline function might not be inlinable [-Wattributes] /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:19:23: warning: always_inline function might not be inlinable [-Wattributes] /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c: In function ‘MurmurHash3_x64_128’: /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:19:23: error: inlining failed in call to always_inline ‘getblock’: function body can be overwritten at link time /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:59:14: error: called from here /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:19:23: error: inlining failed in call to always_inline ‘getblock’: function body can be overwritten at link time /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:60:14: error: called from here /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:27:23: error: inlining failed in call to always_inline ‘fmix’: function body can be overwritten at link time /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:109:6: error: called from here /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:27:23: error: inlining failed in call to always_inline ‘fmix’: function body can be overwritten at link time /usr/lib/go/src/pkg/github.com/zond/god/murmur/murmur.c:110:6: error: called from here

zond commented 11 years ago

Oh, weird, I thought go used the same compiler on all platforms.

What os, go version etc do you use? (I don't get any of these warnings...)

zond commented 11 years ago

You could try to remove all the FORCE_INLINE stuff in murmur.c, and see if that helps, but the root cause (why your compiler doesn't like the code my compiler likes) is perhaps more interesting...

ai10 commented 11 years ago

I'm using

Ubuntu 12.10 go1.0.2

I think I have simple build-essentials installed, gcc but not sure about C compiler the Go invokes.

I removed the FORCE_INLINE -

chuck:server$ go run server.go  panic: C.word64 is not 8 bytes long!

goroutine 1 [running]: github.com/zond/god/murmur.init·1() /tmp/go-build070819190/github.com/zond/god/murmur/_obj/murmur.cgo1.go:18 +0x44 github.com/zond/god/murmur.init() /tmp/go-build070819190/github.com/zond/god/murmur/_obj/murmur.cgo1.go:127 +0x50 github.com/zond/god/radix.init() /usr/lib/go/src/pkg/github.com/zond/god/radix/tree.go:1304 +0x50 github.com/zond/god/dhash.init() /usr/lib/go/src/pkg/github.com/zond/god/dhash/time_server.go:13 +0x7e main.init() /usr/share/go/src/pkg/github.com/zond/god/server/server.go:43 +0x47

goroutine 2 [syscall]: created by runtime.main /build/buildd/golang-1.0.2/src/pkg/runtime/proc.c:221 exit status 2

chuck:server$ go env GOROOT="/usr/lib/go" GOBIN="" GOARCH="386" GOCHAR="8" GOOS="linux" GOEXE="" GOHOSTARCH="386" GOHOSTOS="linux" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_386" GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread" CGO_ENABLED="1"

i'm running on intel core2 duo, which I think is 64 bit, and maybe I'm setup for 32 bit. Yeah,

I just set this ubuntu up with the wrong image.

Which setup are you using?

zond commented 11 years ago

I am using OS X 10.8.2 and go1.0.3. I figure the C compiler is clang, since that is what is included in OS X?

I guess your compiler doesn't like the __attribute__((always_inline)) stuff, so I removed it from the source now, my benchmark didn't get affected anyway, so it didn't help anyway.

And the 64 bit issue is this: I only wrapped the x64 version of murmur3, since I was in a hurry and I figured it covered most users.

Any patches for making murmur work in 32 bit environments (even if go seems to be a bit shady in that area now anyway) are welcome..

ai10 commented 11 years ago

Rebuilding my setup as 64 bit has everything working. Sorry I've neglected to work the 32 bit solution.

zond commented 11 years ago

Oh, excellent.

Well, making it work in a 32 bit environment is not my priority either, so I understand :smile:

I will let this be closed until someone finds it their priority enough to either talk me into looking into it, or fixes it themselves...