Skip to content

concurrent map iteration and map write: ElementHandle.typ #4565

@inancgumus

Description

@inancgumus

Summary

Test run ID: 3395610 (Browser version: 1.8.5)
fatal error: concurrent map writes

goroutine 392040 [running]:
github.com/grafana/xk6-browser/common.(*Keyboard).up(0xc001366d70, {0xc00112fa4c, 0x1})
github.com/grafana/xk6-browser@v1.8.5/common/keyboard.go:144 +0x145
github.com/grafana/xk6-browser/common.(*Keyboard).press(0xc001366d70, {0xc00112fa4c, 0x1}, 0x1?)
github.com/grafana/xk6-browser@v1.8.5/common/keyboard.go:297 +0xac
github.com/grafana/xk6-browser/common.(*Keyboard).typ(0xc001366d70, {0xc0004f4500, 0x20}, 0xc002a71ce8)
github.com/grafana/xk6-browser@v1.8.5/common/keyboard.go:310 +0x11e
github.com/grafana/xk6-browser/common.(*ElementHandle).typ(0xc0023a6e60, {0x1f19698?, 0xc00758f570?}, {0xc0004f4500, 0x20}, 0xc002a71ce8)
github.com/grafana/xk6-browser@v1.8.5/common/element_handle.go:619 +0x65
github.com/grafana/xk6-browser/common.(*Frame).typ.func1({0x1f19698?, 0xc00758f570?}, 0xc00758f570?)
github.com/grafana/xk6-browser@v1.8.5/common/frame.go:1749 +0x4f
github.com/grafana/xk6-browser/common.(*ElementHandle).newAction.func1({0x1f19698, 0xc00758f570})
github.com/grafana/xk6-browser@v1.8.5/common/element_handle.go:1545 +0x19e
github.com/grafana/xk6-browser/common.(*ElementHandle).newAction.func2({0x1f19698, 0xc00758f570}, 0xc008df28c0, 0xc008df2a10)
github.com/grafana/xk6-browser@v1.8.5/common/element_handle.go:1560 +0x4f
github.com/grafana/xk6-browser/common.(*Frame).typ.(*Frame).newAction.func2({0x1f19698, 0xc00758f570}, 0xc008df28c0, 0xc008df2a10)
github.com/grafana/xk6-browser@v1.8.5/common/frame.go:2148 +0x178
created by github.com/grafana/xk6-browser/common.call in goroutine 392027
github.com/grafana/xk6-browser@v1.8.5/common/helpers.go:103 +0x14c

goroutine 1 [chan receive, 2 minutes]:
go.k6.io/k6/execution.(*Scheduler).Run(0xc00037f880, {0x1f19628, 0xc0000a9900}, {0x1f195f0, 0xc0004df350}, 0xc000290380)
go.k6.io/k6/execution/scheduler.go:508 +0xcb4
go.k6.io/k6/cmd.(*cmdRun).run(0xc000037040, 0xc00039a008, {0xc00003fc08, 0x1, 0x3b})
go.k6.io/k6/cmd/run.go:397 +0x1545
github.com/spf13/cobra.(*Command).execute(0xc00039a008, {0xc00003f808, 0x3b, 0x3f})
github.com/spf13/cobra@v1.4.0/command.go:856 +0x68a
github.com/spf13/cobra.(*Command).ExecuteC(0xc00027f608)
github.com/spf13/cobra@v1.4.0/command.go:974 +0x38d
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.4.0/command.go:902
go.k6.io/k6/cmd.(*rootCommand).execute(0xc0000e1f20)
go.k6.io/k6/cmd/root.go:108 +0xfb
go.k6.io/k6/cmd.Execute()
go.k6.io/k6/cmd/root.go:130 +0x2f
main.main()
go.k6.io/k6/main.go:9 +0xf

goroutine 21 [chan receive]:
go.k6.io/k6/log.(*lokiHook).Listen.func2()
go.k6.io/k6/log/loki.go:168 +0x10f
created by go.k6.io/k6/log.(*lokiHook).Listen in goroutine 7
go.k6.io/k6/log/loki.go:165 +0x2f9

goroutine 7 [select]:
go.k6.io/k6/log.(*lokiHook).Listen(0xc00026ec30, {0x1f19628, 0xc0000a98b0})
go.k6.io/k6/log/loki.go:220 +0x3dc
go.k6.io/k6/cmd.(*rootCommand).setLoggerHook.func1()
go.k6.io/k6/cmd/root.go:287 +0x2d
created by go.k6.io/k6/cmd.(*rootCommand).setLoggerHook in goroutine 1
go.k6.io/k6/cmd/root.go:286 +0xb0

goroutine 8 [select, 2 minutes]:
io.(*pipe).read(0xc00009bc80, {0xc00045a000, 0x10000, 0xc000524e00?})
io/pipe.go:57 +0xa5
io.(*PipeReader).Read(0xc000071690?, {0xc00045a000?, 0x0?, 0x10000?})
io/pipe.go:134 +0x1a
bufio.(*Scanner).Scan(0xc000455f28)
bufio/scan.go:219 +0x81e
github.com/sirupsen/logrus.(*Entry).writerScanner(0xc000272620, 0xc00009bc80, 0xc00049d640)
github.com/sirupsen/logrus@v1.9.3/writer.go:86 +0x11d
created by github.com/sirupsen/logrus.(*Entry).WriterLevel in goroutine 1
github.com/sirupsen/logrus@v1.9.3/writer.go:57 +0x31f

goroutine 9 [chan receive, 2 minutes]:
go.k6.io/k6/cmd.(*rootCommand).setupLoggers.func2()
go.k6.io/k6/cmd/root.go:276 +0x34
created by go.k6.io/k6/cmd.(*rootCommand).setupLoggers in goroutine 1
go.k6.io/k6/cmd/root.go:275 +0x637

goroutine 71 [chan receive]:
github.com/grafana/xk6-browser/browser.(*browserRegistry).handleIterEvents(0xc000143260, {0x1f19438, 0x2f0e320}, 0xc00029ee70, 0xc000417950)
github.com/grafana/xk6-browser@v1.8.5/browser/registry.go:264 +0x85
created by github.com/grafana/xk6-browser/browser.newBrowserRegistry in goroutine 27
github.com/grafana/xk6-browser@v1.8.5/browser/registry.go:251 +0x336

goroutine 11 [chan receive, 2 minutes]:
github.com/grafana/xk6-browser/browser.(*browserRegistry).handleExitEvent(0xc0001c73e0, 0x0?, 0x0?)
github.com/grafana/xk6-browser@v1.8.5/browser/registry.go:333 +0x45
created by github.com/grafana/xk6-browser/browser.newBrowserRegistry in goroutine 1
github.com/grafana/xk6-browser@v1.8.5/browser/registry.go:250 +0x2b2

goroutine 12 [chan receive, 2 minutes]:
github.com/grafana/xk6-browser/browser.(*browserRegistry).handleIterEvents(0xc0001c73e0, {0x1f19438, 0x2f0e320}, 0xc000273810, 0xc00031b080)
github.com/grafana/xk6-browser@v1.8.5/browser/registry.go:264 +0x85
created by github.com/grafana/xk6-browser/browser.newBrowserRegistry in goroutine 1
github.com/grafana/xk6-browser@v1.8.5/browser/registry.go:251 +0x336

goroutine 13 [select]:
go.opentelemetry.io/otel/sdk/trace.(*batchSpanProcessor).processQueue(0xc0003fba40)
go.openteleme

k6 version

v0.57

Fixes

These two fixes can help solving this issue 🤞

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions