k6对高山产生恐慌和节段违规

时间:2019-01-13 13:39:32

标签: k6

使用下载的二进制文件运行k6 run github.com/loadimpact/k6/samples/http_get.js以获得高山产量

          /\      |‾‾|  /‾‾/  /‾/
     /\  /  \     |  |_/  /  / /
    /  \/    \    |      |  /  ‾‾\
   /          \   |  |‾\  \ | (_) |
  / __________ \  |__|  \__\ \___/ .io

panic: runtime error: invalid memory address or nil pointer dereference engine
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x804931b]

goroutine 1 [running]:
sync/atomic.LoadUint64(0x1a99e594, 0x1b42c554, 0x1)
    /usr/lib/golang/src/sync/atomic/asm_386.s:159 +0xb
github.com/loadimpact/k6/core/local.(*Executor).SetVUsMax(0x1a99e540, 0x1, 0x0, 0x0, 0x0)
    /home/user/go/src/github.com/loadimpact/k6/core/local/local.go:501 +0x125
github.com/loadimpact/k6/core.NewEngine(0x89705e0, 0x1a99e540, 0x0, 0x1, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, ...)
    /home/user/go/src/github.com/loadimpact/k6/core/engine.go:86 +0x124
github.com/loadimpact/k6/cmd.glob..func11(0x8f0a940, 0x1997d9a8, 0x1, 0x1, 0x0, 0x0)
    /home/user/go/src/github.com/loadimpact/k6/cmd/run.go:182 +0x971
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).execute(0x8f0a940, 0x1997d990, 0x1, 0x1, 0x8f0a940, 0x1997d990)
    /home/user/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:762 +0x353
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x8f0a800, 0x1997a030, 0x0, 0x1)
    /home/user/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:852 +0x28a
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).Execute(0x8f0a800, 0x0, 0x0)
    /home/user/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:800 +0x21
github.com/loadimpact/k6/cmd.Execute()
    /home/user/go/src/github.com/loadimpact/k6/cmd/root.go:87 +0x27
main.main()
    /home/user/go/src/github.com/loadimpact/k6/main.go:28 +0x17

Dockerfile

FROM alpine

RUN apk add curl

RUN curl -L https://github.com/loadimpact/k6/releases/download/v0.23.0/k6-v0.23.0-linux32.tar.gz | tar xvz
ENV PATH="/k6-v0.23.0-linux32:${PATH}"

ENTRYPOINT ["k6"]

我是在做错什么,还是不应该在高山上运行?

1 个答案:

答案 0 :(得分:1)

我认为这是因为Alpine Linux不使用glibc,如果我没记错的话,它使用的是musl libc。因此,编译k6之类的Go程序可能应该使用CGO_ENABLED=0完成,就像我们在官方k6 Dockerfile中进行的操作:https://github.com/loadimpact/k6/blob/master/Dockerfile#L5