Skip to content
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

Broken build on 386/arm architecture #7

Closed
msoap opened this issue Nov 28, 2015 · 4 comments
Closed

Broken build on 386/arm architecture #7

msoap opened this issue Nov 28, 2015 · 4 comments

Comments

@msoap
Copy link

msoap commented Nov 28, 2015

$ go get -v github.com/valyala/fasthttp
github.com/valyala/fasthttp
# github.com/valyala/fasthttp
../../valyala/fasthttp/bytesconv.go:19: constant 18446744073709551615 overflows uint
../../valyala/fasthttp/bytesconv.go:32: constant 18446744073709551615 overflows uint

I'm fixed bytesconv.go: https://github.com/msoap/fasthttp/commit/1d5c402cdc457aa9c08671d84bbe2b0c9df1873b

but another test has fallen (client_test.go:505):

$ go version
go version go1.5 linux/arm

$ go test
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x4 pc=0x140998]

goroutine 26 [running]:
sync/atomic.storeUint64(0x1076e0fc, 0x56596ced, 0x0)
    /home/msa/var/src/go/src/sync/atomic/64bit_arm.go:20 +0x40
github.com/msoap/fasthttp.(*HostClient).do(0x1076e0b0, 0x1078c180, 0x1077e100, 0x10727600, 0x673c8, 0x0, 0x0)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:728 +0x100
github.com/msoap/fasthttp.(*HostClient).Do(0x1076e0b0, 0x1078c180, 0x1077e100, 0x0, 0x0)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:716 +0x40
github.com/msoap/fasthttp.(*Client).Do(0x4f62e0, 0x1078c180, 0x1077e100, 0x0, 0x0)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:270 +0x4d4
github.com/msoap/fasthttp.doRequest(0x1078c180, 0x0, 0x0, 0x0, 0x107147e0, 0x24, 0xb63f35d0, 0x4f62e0, 0x0, 0x0, ...)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:568 +0x200
github.com/msoap/fasthttp.clientGetURLTimeoutFreeConn.func1(0x1078c180, 0x0, 0x0, 0x0, 0x107147e0, 0x24, 0xb63f35d0, 0x4f62e0, 0x10718ac0)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:512 +0x54
created by github.com/msoap/fasthttp.clientGetURLTimeoutFreeConn
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:518 +0x110

goroutine 1 [chan receive]:
testing.RunTests(0x402600, 0x4f4aa0, 0x6c, 0x6c, 0x4f5b01)
    /home/msa/var/src/go/src/testing/testing.go:562 +0x618
testing.(*M).Run(0x10747f74, 0x12380)
    /home/msa/var/src/go/src/testing/testing.go:494 +0x6c
main.main()
    github.com/msoap/fasthttp/_test/_testmain.go:376 +0x118

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /home/msa/var/src/go/src/runtime/asm_arm.s:1036 +0x4

goroutine 5 [sleep]:
time.Sleep(0x3b9aca00, 0x0)
    /home/msa/var/src/go/src/runtime/time.go:59 +0x104
github.com/msoap/fasthttp.init.1.func1()
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/header.go:897 +0x24
created by github.com/msoap/fasthttp.init.1
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/header.go:900 +0x28

goroutine 10 [runnable]:
testing.tRunner.func1(0x10710600)
    /home/msa/var/src/go/src/testing/testing.go:452 +0x174
testing.tRunner(0x10710600, 0x4f4ad0)
    /home/msa/var/src/go/src/testing/testing.go:458 +0xb8
created by testing.RunTests
    /home/msa/var/src/go/src/testing/testing.go:561 +0x5ec

goroutine 24 [select]:
github.com/msoap/fasthttp.clientGetURLTimeoutFreeConn(0x0, 0x0, 0x0, 0x107147e0, 0x24, 0x3b9aca00, 0x0, 0xb63f35d0, 0x4f62e0, 0x0, ...)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:530 +0x300
github.com/msoap/fasthttp.clientGetURLTimeout(0x0, 0x0, 0x0, 0x107147e0, 0x24, 0x3b9aca00, 0x0, 0xb63f35d0, 0x4f62e0, 0x10752090, ...)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:468 +0x24c
github.com/msoap/fasthttp.(*Client).GetTimeout(0x4f62e0, 0x0, 0x0, 0x0, 0x107147e0, 0x24, 0x3b9aca00, 0x0, 0x20, 0x0, ...)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:168 +0xc8
github.com/msoap/fasthttp.testClientGetTimeoutSuccess(0x10710fc0, 0x4f62e0, 0x10713360, 0x16, 0x64)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client_test.go:381 +0x1ac
github.com/msoap/fasthttp.TestClientGetTimeoutSuccess(0x10710fc0)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client_test.go:21 +0xd4
testing.tRunner(0x10710fc0, 0x4f4b60)
    /home/msa/var/src/go/src/testing/testing.go:456 +0xa8
created by testing.RunTests
    /home/msa/var/src/go/src/testing/testing.go:561 +0x5ec

goroutine 25 [runnable]:
github.com/msoap/fasthttp.startEchoServerExt.func2(0x107523f0, 0xb63f2580, 0x1070a548, 0x10710fc0, 0x10718a80)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client_test.go:505
created by github.com/msoap/fasthttp.startEchoServerExt
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client_test.go:511 +0x460

goroutine 27 [runnable]:
github.com/msoap/fasthttp.(*Client).mCleaner(0x4f62e0, 0x107133e0)
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:273
created by github.com/msoap/fasthttp.(*Client).Do
    /home/msa/var/lib/go/src/github.com/msoap/fasthttp/client.go:267 +0x4b8
exit status 2
FAIL    github.com/msoap/fasthttp   0.194s
@valyala
Copy link
Owner

valyala commented Nov 28, 2015

The second error seems to be related to the known bug in the atomic package:

On both ARM and x86-32, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically

@valyala
Copy link
Owner

valyala commented Nov 28, 2015

@msoap, verify whether patches above fix arm build. I have no access to arm at the moment, so cannot test it.

@msoap
Copy link
Author

msoap commented Nov 28, 2015

Thanks! works fine on arm.

If interested - benchmarks on RaspberryPi:

  • net/http - 248rps
  • fasthttp - 343rps
  • nginx - 351rps

@msoap msoap closed this as completed Nov 28, 2015
@valyala
Copy link
Owner

valyala commented Nov 28, 2015

Glad to see that fasthttp is close to nginx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants