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

K6_BLACKLIST_IPS parsing is broken #1257

Open
imiric opened this issue Nov 27, 2019 · 5 comments
Open

K6_BLACKLIST_IPS parsing is broken #1257

imiric opened this issue Nov 27, 2019 · 5 comments

Comments

@imiric
Copy link
Contributor

imiric commented Nov 27, 2019

Current behavior on master (a2e1c6f4e6207d69461a1b0f24c3aa2c72233101):

$ K6_BLACKLIST_IPS="10.0.0.0/8" go run main.go run samples/thresholds.js

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

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

goroutine 1 [running]:
github.com/loadimpact/k6/lib.(*IPNet).UnmarshalText(0x0, 0xc0027240f0, 0xa, 0x10, 0xa, 0x10)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/lib/options.go:173 +0x7d
github.com/loadimpact/k6/vendor/github.com/kelseyhightower/envconfig.processField(0xc000036511, 0xa, 0xd6a700, 0xc00309d260, 0x196, 0xc00309d260, 0x196)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/vendor/github.com/kelseyhightower/envconfig/envconfig.go:251 +0x1415
github.com/loadimpact/k6/vendor/github.com/kelseyhightower/envconfig.processField(0xc000036511, 0xa, 0xcff020, 0xc00092d638, 0x197, 0x0, 0x0)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/vendor/github.com/kelseyhightower/envconfig/envconfig.go:312 +0x10f7
github.com/loadimpact/k6/vendor/github.com/kelseyhightower/envconfig.Process(0x0, 0x0, 0xd7d220, 0xc00092d500, 0x494dbd, 0x10a8bc0)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/vendor/github.com/kelseyhightower/envconfig/envconfig.go:215 +0x5aa
github.com/loadimpact/k6/cmd.readEnvConfig(0x10c6b20, 0x1982838, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/cmd/config.go:188 +0x69
github.com/loadimpact/k6/cmd.getConsolidatedConfig(0x10c6b20, 0x1982838, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/cmd/config.go:311 +0x8f7
github.com/loadimpact/k6/cmd.glob..func11(0x1957f00, 0xc0002c45f0, 0x1, 0x1, 0x0, 0x0)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/cmd/run.go:139 +0x817
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).execute(0x1957f00, 0xc0002c45c0, 0x1, 0x1, 0x1957f00, 0xc0002c45c0)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:762 +0x460
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1957580, 0xc0003aa100, 0xc000038ba0, 0xe9535d)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:852 +0x2ea
github.com/loadimpact/k6/vendor/github.com/spf13/cobra.(*Command).Execute(...)
        /home/ivan/.local/go/src/github.com/loadimpact/k6/vendor/github.com/spf13/cobra/command.go:800
github.com/loadimpact/k6/cmd.Execute()
        /home/ivan/.local/go/src/github.com/loadimpact/k6/cmd/root.go:89 +0x3f
main.main()
        /home/ivan/.local/go/src/github.com/loadimpact/k6/main.go:28 +0x20
exit status 2

Passing it via CLI works fine (go run main.go run --blacklist-ip '10.0.0.0/8' samples/thresholds.js).

@na-- na-- added the bug label Nov 27, 2019
@cuonglm
Copy link
Contributor

cuonglm commented Nov 27, 2019

I think it's not us but the envconfig.

I raised an issue and made the PR to fix it kelseyhightower/envconfig#157

@codebien
Copy link
Contributor

envconfig seems to be unmaintained and the PR is no getting reviews. The suggestion here is to add a specific code on k6 side for fixing this specific issue then add a comment mentioning the PR. In the comment a mention to #883, which probably will provide the optimal solution, should be added.

@mstoykov
Copy link
Contributor

given that we no longer use hte orignal envconfig but a fork ... we might want to merge this PR there - if that mkaes more sense.

But IMO more testing is needed.

@codebien
Copy link
Contributor

Oh, I forgot about the fork! Sure, we can merge the PR there + more tests and then we need to bump the dependency here in k6.

@fatelei
Copy link
Contributor

fatelei commented Dec 18, 2024

Image

the new version this bug has been fixed

@inancgumus inancgumus removed their assignment Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants