Describe the bug
fatal error: concurrent map iteration and map write
To Reproduce
Steps to reproduce the behavior:
run this a couple of times on a logfile with no issues:
tail /var/log/httpd/domains/example.com.log | ./teler -c teler.yml
result
fatal error: concurrent map iteration and map write
goroutine 27 [running]:
runtime.throw(0x86a1c18, 0x26)
/opt/hostedtoolcache/go/1.14.15/x64/src/runtime/panic.go:1116 +0x6a fp=0xa4b8c74 sp=0xa4b8c60 pc=0x807821a
runtime.mapiternext(0xa4b8edc)
/opt/hostedtoolcache/go/1.14.15/x64/src/runtime/map.go:853 +0x481 fp=0xa4b8cbc sp=0xa4b8c74 pc=0x80550b1
runtime.mapiterinit(0x85dc6a0, 0xa5084a0, 0xa4b8edc)
/opt/hostedtoolcache/go/1.14.15/x64/src/runtime/map.go:843 +0x189 fp=0xa4b8cc8 sp=0xa4b8cbc pc=0x8054b49
ktbs.dev/teler/pkg/teler.Analyze(0xa50f440, 0xa40e120, 0x0, 0x8050ebf)
/home/runner/work/teler/teler/pkg/teler/teler.go:32 +0x2c0 fp=0xa4b8f10 sp=0xa4b8cc8 pc=0x8547fd0
ktbs.dev/teler/internal/runner.New.func3.1(0xa5800a0, 0xa50f440, 0x0, 0xa502158, 0xa40e120)
/home/runner/work/teler/teler/internal/runner/runner.go:72 +0x72 fp=0xa4b8fd8 sp=0xa4b8f10 pc=0x8551652
runtime.goexit()
/opt/hostedtoolcache/go/1.14.15/x64/src/runtime/asm_386.s:1337 +0x1 fp=0xa4b8fdc sp=0xa4b8fd8 pc=0x80a40b1
created by ktbs.dev/teler/internal/runner.New.func3
/home/runner/work/teler/teler/internal/runner/runner.go:69 +0x93
goroutine 1 [chan receive]:
github.com/satyrius/gonx.(*Reader).Read(0xa48df84, 0xa48df40, 0x0, 0x0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/reader.go:41 +0x3f
ktbs.dev/teler/internal/runner.New(0xa50f440)
/home/runner/work/teler/teler/internal/runner/runner.go:126 +0x3fc
main.main()
/home/runner/work/teler/teler/cmd/teler/main.go:20 +0x1f
goroutine 35 [syscall]:
os/signal.signal_recv(0x0)
/opt/hostedtoolcache/go/1.14.15/x64/src/runtime/sigqueue.go:147 +0x12f
os/signal.loop()
/opt/hostedtoolcache/go/1.14.15/x64/src/os/signal/signal_unix.go:23 +0x1a
created by os/signal.Notify.func1
/opt/hostedtoolcache/go/1.14.15/x64/src/os/signal/signal.go:127 +0x33
goroutine 22 [chan receive]:
ktbs.dev/teler/internal/runner.New.func2(0xa5ae080, 0xa50c200, 0xa49c01c)
/home/runner/work/teler/teler/internal/runner/runner.go:57 +0x2d
created by ktbs.dev/teler/internal/runner.New
/home/runner/work/teler/teler/internal/runner/runner.go:56 +0x246
goroutine 23 [chan receive]:
ktbs.dev/teler/internal/runner.New.func3(0xa50c200, 0xa5800a0, 0xa50f440, 0x0, 0xa502158)
/home/runner/work/teler/teler/internal/runner/runner.go:67 +0xa7
created by ktbs.dev/teler/internal/runner.New
/home/runner/work/teler/teler/internal/runner/runner.go:66 +0x312
goroutine 24 [semacquire]:
sync.runtime_Semacquire(0xa42a0a8)
/opt/hostedtoolcache/go/1.14.15/x64/src/runtime/sema.go:56 +0x36
sync.(*WaitGroup).Wait(0xa42a0a0)
/opt/hostedtoolcache/go/1.14.15/x64/src/sync/waitgroup.go:130 +0x7c
github.com/satyrius/gonx.MapReduce.func1(0xa432180, 0x8775d10, 0xa40c090, 0xa5055c0, 0xa)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:67 +0x104
created by github.com/satyrius/gonx.MapReduce
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:26 +0x96
goroutine 25 [chan receive]:
github.com/satyrius/gonx.(*ReadAll).Reduce(0x8bc038c, 0xa5055c0, 0xa4321c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/reducer.go:23 +0x57
created by github.com/satyrius/gonx.MapReduce
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:73 +0xe1
goroutine 38 [runnable]:
regexp/syntax.(*compiler).inst(...)
/opt/hostedtoolcache/go/1.14.15/x64/src/regexp/syntax/compile.go:173
regexp/syntax.Compile(0xa5ae400, 0xa5ae400, 0x2, 0x2)
/opt/hostedtoolcache/go/1.14.15/x64/src/regexp/syntax/compile.go:84 +0x186
regexp.compile(0x868de83, 0x9, 0x80000d4, 0x85dc7e0, 0xa5086e0, 0x868d034)
/opt/hostedtoolcache/go/1.14.15/x64/src/regexp/regexp.go:178 +0x9f
regexp.Compile(...)
/opt/hostedtoolcache/go/1.14.15/x64/src/regexp/regexp.go:133
regexp.MustCompile(0x868de83, 0x9, 0xa5120e0)
/opt/hostedtoolcache/go/1.14.15/x64/src/regexp/regexp.go:309 +0x39
ktbs.dev/teler/pkg/matchers.IsMatch(0x868de83, 0x9, 0xa5fc2ae, 0x3, 0xa550200)
/home/runner/work/teler/teler/pkg/matchers/regex.go:10 +0x4b
ktbs.dev/teler/pkg/teler.Analyze(0xa50f440, 0xa502180, 0x1, 0x8050ebf)
/home/runner/work/teler/teler/pkg/teler/teler.go:212 +0x1ae1
ktbs.dev/teler/internal/runner.New.func3.1(0xa5800a0, 0xa50f440, 0x0, 0xa502158, 0xa502180)
/home/runner/work/teler/teler/internal/runner/runner.go:72 +0x72
created by ktbs.dev/teler/internal/runner.New.func3
/home/runner/work/teler/teler/internal/runner/runner.go:69 +0x93
goroutine 7 [runnable]:
github.com/satyrius/gonx.MapReduce.func1.1(0xa42a0a0, 0xa432180, 0xa546000, 0x8775d10, 0xa40c090, 0xa5055c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:46 +0x66
created by github.com/satyrius/gonx.MapReduce.func1
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:43 +0xd6
goroutine 8 [runnable]:
github.com/satyrius/gonx.MapReduce.func1.1(0xa42a0a0, 0xa432180, 0xa546000, 0x8775d10, 0xa40c090, 0xa5055c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:46 +0x66
created by github.com/satyrius/gonx.MapReduce.func1
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:43 +0xd6
goroutine 9 [runnable]:
github.com/satyrius/gonx.MapReduce.func1.1(0xa42a0a0, 0xa432180, 0xa546000, 0x8775d10, 0xa40c090, 0xa5055c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:46 +0x66
created by github.com/satyrius/gonx.MapReduce.func1
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:43 +0xd6
goroutine 10 [runnable]:
github.com/satyrius/gonx.(*Entry).SetField(...)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/entry.go:50
github.com/satyrius/gonx.(*Parser).ParseString(0xa40c090, 0xa5fc6c0, 0x115, 0x0, 0x0, 0x0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/parser.go:46 +0xf7
github.com/satyrius/gonx.MapReduce.func1.1(0xa42a0a0, 0xa432180, 0xa546000, 0x8775d10, 0xa40c090, 0xa5055c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:53 +0x97
created by github.com/satyrius/gonx.MapReduce.func1
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:43 +0xd6
goroutine 11 [runnable]:
github.com/satyrius/gonx.MapReduce.func1.1(0xa42a0a0, 0xa432180, 0xa546000, 0x8775d10, 0xa40c090, 0xa5055c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:46 +0x66
created by github.com/satyrius/gonx.MapReduce.func1
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:43 +0xd6
goroutine 12 [runnable]:
github.com/satyrius/gonx.MapReduce.func1.1(0xa42a0a0, 0xa432180, 0xa546000, 0x8775d10, 0xa40c090, 0xa5055c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:46 +0x66
created by github.com/satyrius/gonx.MapReduce.func1
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:43 +0xd6
goroutine 13 [runnable]:
github.com/satyrius/gonx.MapReduce.func1.1(0xa42a0a0, 0xa432180, 0xa546000, 0x8775d10, 0xa40c090, 0xa5055c0)
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:46 +0x66
created by github.com/satyrius/gonx.MapReduce.func1
/home/runner/go/pkg/mod/github.com/satyrius/[email protected]/mapreduce.go:43 +0xd6
goroutine 16 [runnable]:
reflect.(*structType).FieldByName(0x85fa060, 0x868ca05, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/opt/hostedtoolcache/go/1.14.15/x64/src/reflect/type.go:1343 +0x23c
reflect.(*rtype).FieldByName(0x85fa060, 0x868ca05, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/opt/hostedtoolcache/go/1.14.15/x64/src/reflect/type.go:936 +0x6f
reflect.Value.FieldByName(0x85fa060, 0xa47e000, 0x199, 0x868ca05, 0x6, 0x199, 0x8050d14, 0xa)
/opt/hostedtoolcache/go/1.14.15/x64/src/reflect/value.go:888 +0x66
ktbs.dev/teler/pkg/teler.Analyze(0xa50f440, 0xa47e000, 0x0, 0x8050ebf)
/home/runner/work/teler/teler/pkg/teler/teler.go:23 +0xdb
ktbs.dev/teler/internal/runner.New.func3.1(0xa5800a0, 0xa50f440, 0x0, 0xa502158, 0xa47e000)
/home/runner/work/teler/teler/internal/runner/runner.go:72 +0x72
created by ktbs.dev/teler/internal/runner.New.func3
/home/runner/work/teler/teler/internal/runner/runner.go:69 +0x93
Type: Bug Status: On Hold