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

[jsonschema] Getting error: "runtime error: invalid memory address or nil pointer dereference" #144

Closed
alex-rozlyvanov opened this issue Jul 27, 2022 · 3 comments
Labels
🐛 Bug Something isn't working

Comments

@alex-rozlyvanov
Copy link

👋
I am trying learn k6 tool but am not able to run an example test_jsonschema_with_schema_registry.js.
Could you please help me? Is it something wrong in my setup or there is a bug in "k6/x/kafka" extention? Thank you in advance

My setup local setup:

And the result is:


          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

  execution: local
     script: -
     output: -

  scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
           * default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)

time="2022-07-27T13:17:58Z" level=error msg="panic: runtime error: invalid memory address or nil pointer dereference\ngoroutine 30 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngo.k6.io/k6/js/common.RunWithPanicCatching.func1()\n\tgo.k6.io/[email protected]/js/common/util.go:102 +0x191\npanic({0x10bfa60, 0x1f43d00})\n\truntime/panic.go:838 +0x207\ngithub.com/dop251/goja.AssertFunction.func1.1()\n\tgithub.com/dop251/[email protected]/runtime.go:2333 +0x6e\npanic({0x10bfa60, 0x1f43d00})\n\truntime/panic.go:838 +0x207\ngithub.com/dop251/goja.(*vm).try.func1()\n\tgithub.com/dop251/[email protected]/vm.go:537 +0x635\npanic({0x10bfa60, 0x1f43d00})\n\truntime/panic.go:838 +0x207\ngithub.com/linkedin/goavro/v2.(*Codec).NativeFromTextual(0xc0030820a0?, {0xc0012bc260, 0xe, 0x10})\n\tgithub.com/linkedin/goavro/[email protected]/codec.go:413 +0x23\ngithub.com/mostafa/xk6-kafka.SerializeJSON({{{0xc002180a00, 0x3f}, {0xc002180a40, 0x3f}, {0x0, 0x0}, 0x0}, {{0xc002180a80, 0x3d}, {0xc002180ac0, ...}, ...}, ...}, ...)\n\tgithub.com/mostafa/[email protected]/jsonschema.go:75 +0x42a\ngithub.com/mostafa/xk6-kafka.(*Kafka).produce(0xc0002c5b80, 0x364?, 0xc002f7afc0)\n\tgithub.com/mostafa/[email protected]/producer.go:265 +0x943\ngithub.com/mostafa/xk6-kafka.(*Kafka).writerClass.func1({{0x15745c8, 0xc002f4fef0}, {0xc002f66380, 0x1, 0x10}})\n\tgithub.com/mostafa/[email protected]/producer.go:138 +0x145\ngithub.com/dop251/goja.(*vm)._nativeCall(0xc0006b6300, 0xc002f492c0, 0x1)\n\tgithub.com/dop251/[email protected]/vm.go:2737 +0x217\ngithub.com/dop251/goja.call.exec(0xb?, 0xc0006b6300)\n\tgithub.com/dop251/[email protected]/vm.go:2709 +0x95b\ngithub.com/dop251/goja.(*vm).run(0xc0006b6300)\n\tgithub.com/dop251/[email protected]/vm.go:408 +0x8b\ngithub.com/dop251/goja.(*baseJsFuncObject)._call(0xc000ae8370, {{0x1574e18, 0x1f95a00}, {0xc002f6ac40, 0x1, 0x1}}, {0x0?, 0x0}, {0x1574e18, 0x1f95a00})\n\tgithub.com/dop251/[email protected]/func.go:193 +0x3ff\ngithub.com/dop251/goja.(*baseJsFuncObject).call(...)\n\tgithub.com/dop251/[email protected]/func.go:203\ngithub.com/dop251/goja.(*baseJsFuncObject).Call(0xc0016d7440?, {{0x1574e18, 0x1f95a00}, {0xc002f6ac40, 0x1, 0x1}})\n\tgithub.com/dop251/[email protected]/func.go:156 +0xc7\ngithub.com/dop251/goja.AssertFunction.func1.2()\n\tgithub.com/dop251/[email protected]/runtime.go:2338 +0x74\ngithub.com/dop251/goja.(*vm).try(0xc00062f638?, 0x40d325?)\n\tgithub.com/dop251/[email protected]/vm.go:545 +0x176\ngithub.com/dop251/goja.AssertFunction.func1({0x1574e18?, 0x1f95a00?}, {0xc002f6ac40?, 0x1?, 0x1?})\n\tgithub.com/dop251/[email protected]/runtime.go:2337 +0x10c\ngo.k6.io/k6/js.(*VU).runFn.func1.1()\n\tgo.k6.io/[email protected]/js/runner.go:800 +0x43\ngo.k6.io/k6/js/eventloop.(*EventLoop).Start(0xc000af4460, 0xc002f75050)\n\tgo.k6.io/[email protected]/js/eventloop/eventloop.go:112 +0x177\ngo.k6.io/k6/js.(*VU).runFn.func1()\n\tgo.k6.io/[email protected]/js/runner.go:799 +0xee\ngo.k6.io/k6/js/common.RunWithPanicCatching({0x1575be0?, 0xc000323030?}, 0x8?, 0x90?)\n\tgo.k6.io/[email protected]/js/common/util.go:106 +0x87\ngo.k6.io/k6/js.(*VU).runFn(0xc000d40780, {0x156c120, 0xc000ff2400}, 0x60?, 0xc0001c8f60, 0xc002f6ac30, {0xc002f6ac40, 0x1, 0x1})\n\tgo.k6.io/[email protected]/js/runner.go:798 +0x2a5\ngo.k6.io/k6/js.(*ActiveVU).RunOnce(0xc000ff23c0)\n\tgo.k6.io/[email protected]/js/runner.go:750 +0x3f3\ngo.k6.io/k6/lib/executor.getIterationRunner.func1({0x156c1c8, 0xc002f74cf0}, {0x1562960?, 0xc000ff23c0?})\n\tgo.k6.io/[email protected]/lib/executor/helpers.go:144 +0x64\ngo.k6.io/k6/lib/executor.PerVUIterations.Run.func5({0x1567c70, 0xc000d40780})\n\tgo.k6.io/[email protected]/lib/executor/per_vu_iterations.go:243 +0x40a\ncreated by go.k6.io/k6/lib/executor.PerVUIterations.Run\n\tgo.k6.io/[email protected]/lib/executor/per_vu_iterations.go:256 +0xc27\n\nGoja stack:\nnative"

running (00m00.0s), 0/1 VUs, 0 complete and 1 interrupted iterations
default ✗ [ 100% ] 1 VUs  00m00.0s/10m0s  1/1 iters, 1 per VU
time="2022-07-27T13:17:58Z" level=warning msg="No script iterations finished, consider making the test duration longer"

     █ teardown

     data_received........: 0 B 0 B/s
     data_sent............: 0 B 0 B/s
     iteration_duration...: avg=16.77ms min=14.8ms med=16.77ms max=18.75ms p(90)=18.36ms p(95)=18.56ms
     iterations...........: 1   22.550355/s

time="2022-07-27T13:17:59Z" level=error msg="a panic occurred during JS execution: runtime error: invalid memory address or nil pointer dereference"

Formatted Stacktrace:

goroutine 30 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x65
go.k6.io/k6/js/common.RunWithPanicCatching.func1()
go.k6.io/[email protected]/js/common/util.go:102 +0x191
panic({0x10bfa60, 0x1f43d00})
runtime/panic.go:838 +0x207
github.com/dop251/goja.AssertFunction.func1.1()
github.com/dop251/[email protected]/runtime.go:2333 +0x6e
panic({0x10bfa60, 0x1f43d00})
runtime/panic.go:838 +0x207
github.com/dop251/goja.(*vm).try.func1()
github.com/dop251/[email protected]/vm.go:537 +0x635
panic({0x10bfa60, 0x1f43d00})
runtime/panic.go:838 +0x207
github.com/linkedin/goavro/v2.(*Codec).NativeFromTextual(0xc0030820a0?, {0xc0012bc260, 0xe, 0x10})
github.com/linkedin/goavro/[email protected]/codec.go:413 +0x23
github.com/mostafa/xk6-kafka.SerializeJSON({{{0xc002180a00, 0x3f}, {0xc002180a40, 0x3f}, {0x0, 0x0}, 0x0}, {{0xc002180a80, 0x3d}, {0xc002180ac0, ...}, ...}, ...}, ...)
github.com/mostafa/[email protected]/jsonschema.go:75 +0x42a
github.com/mostafa/xk6-kafka.(*Kafka).produce(0xc0002c5b80, 0x364?, 0xc002f7afc0)
github.com/mostafa/[email protected]/producer.go:265 +0x943
github.com/mostafa/xk6-kafka.(*Kafka).writerClass.func1({{0x15745c8, 0xc002f4fef0}, {0xc002f66380, 0x1, 0x10}})
github.com/mostafa/[email protected]/producer.go:138 +0x145
github.com/dop251/goja.(*vm)._nativeCall(0xc0006b6300, 0xc002f492c0, 0x1)
github.com/dop251/[email protected]/vm.go:2737 +0x217
github.com/dop251/goja.call.exec(0xb?, 0xc0006b6300)
github.com/dop251/[email protected]/vm.go:2709 +0x95b
github.com/dop251/goja.(*vm).run(0xc0006b6300)
github.com/dop251/[email protected]/vm.go:408 +0x8b
github.com/dop251/goja.(*baseJsFuncObject)._call(0xc000ae8370, {{0x1574e18, 0x1f95a00}, {0xc002f6ac40, 0x1, 0x1}}, {0x0?, 0x0}, {0x1574e18, 0x1f95a00})
github.com/dop251/[email protected]/func.go:193 +0x3ff
github.com/dop251/goja.(*baseJsFuncObject).call(...)
github.com/dop251/[email protected]/func.go:203
github.com/dop251/goja.(*baseJsFuncObject).Call(0xc0016d7440?, {{0x1574e18, 0x1f95a00}, {0xc002f6ac40, 0x1, 0x1}})
github.com/dop251/[email protected]/func.go:156 +0xc7
github.com/dop251/goja.AssertFunction.func1.2()
github.com/dop251/[email protected]/runtime.go:2338 +0x74
github.com/dop251/goja.(*vm).try(0xc00062f638?, 0x40d325?)
github.com/dop251/[email protected]/vm.go:545 +0x176
github.com/dop251/goja.AssertFunction.func1({0x1574e18?, 0x1f95a00?}, {0xc002f6ac40?, 0x1?, 0x1?})
github.com/dop251/[email protected]/runtime.go:2337 +0x10c
go.k6.io/k6/js.(*VU).runFn.func1.1()
go.k6.io/[email protected]/js/runner.go:800 +0x43
go.k6.io/k6/js/eventloop.(*EventLoop).Start(0xc000af4460, 0xc002f75050)
go.k6.io/[email protected]/js/eventloop/eventloop.go:112 +0x177
go.k6.io/k6/js.(*VU).runFn.func1()
go.k6.io/[email protected]/js/runner.go:799 +0xee
go.k6.io/k6/js/common.RunWithPanicCatching({0x1575be0?, 0xc000323030?}, 0x8?, 0x90?)
go.k6.io/[email protected]/js/common/util.go:106 +0x87
go.k6.io/k6/js.(*VU).runFn(0xc000d40780, {0x156c120, 0xc000ff2400}, 0x60?, 0xc0001c8f60, 0xc002f6ac30, {0xc002f6ac40, 0x1, 0x1})
go.k6.io/[email protected]/js/runner.go:798 +0x2a5
go.k6.io/k6/js.(*ActiveVU).RunOnce(0xc000ff23c0)
go.k6.io/[email protected]/js/runner.go:750 +0x3f3
go.k6.io/k6/lib/executor.getIterationRunner.func1({0x156c1c8, 0xc002f74cf0}, {0x1562960?, 0xc000ff23c0?})
go.k6.io/[email protected]/lib/executor/helpers.go:144 +0x64
go.k6.io/k6/lib/executor.PerVUIterations.Run.func5({0x1567c70, 0xc000d40780})
go.k6.io/[email protected]/lib/executor/per_vu_iterations.go:243 +0x40a
created by go.k6.io/k6/lib/executor.PerVUIterations.Run
go.k6.io/[email protected]/lib/executor/per_vu_iterations.go:256 +0xc27

Goja stack:
native
@alex-rozlyvanov alex-rozlyvanov changed the title Getting error: "runtime error: invalid memory address or nil pointer dereference" [jsonschema] Getting error: "runtime error: invalid memory address or nil pointer dereference" Jul 27, 2022
@mostafa
Copy link
Owner

mostafa commented Aug 4, 2022

@alex-rozlyvanov
I am investigating it.

@mostafa mostafa added the 🐛 Bug Something isn't working label Aug 4, 2022
@mostafa
Copy link
Owner

mostafa commented Aug 4, 2022

@alex-rozlyvanov
This was a regression and I fixed it. I'll release a patch version soon.

@mostafa
Copy link
Owner

mostafa commented Aug 4, 2022

Released v0.13.1.

@mostafa mostafa closed this as completed Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
Status: Release
Development

No branches or pull requests

2 participants