Skip to content

Instantly share code, notes, and snippets.

@tsg
Created April 18, 2016 20:27
Show Gist options
  • Save tsg/fbfdac8ea8a0b1f74f17e4a7c4715dee to your computer and use it in GitHub Desktop.
Save tsg/fbfdac8ea8a0b1f74f17e4a7c4715dee to your computer and use it in GitHub Desktop.
fatal error: concurrent map read and map write
goroutine 12 [running]:
runtime.throw(0x71d580, 0x21)
/usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:530 +0x90 fp=0xc820038750 sp=0xc820038738
runtime.mapaccess2(0x649bc0, 0xc820d12720, 0xc820230060, 0x4, 0x14b37e)
/usr/local/Cellar/go/1.6/libexec/src/runtime/hashmap.go:343 +0x5a fp=0xc820038798 sp=0xc820038750
reflect.mapaccess(0x649bc0, 0xc820d12720, 0xc820230060, 0xc820d12720)
/usr/local/Cellar/go/1.6/libexec/src/runtime/hashmap.go:993 +0x35 fp=0xc8200387c8 sp=0xc820038798
reflect.Value.MapIndex(0x649bc0, 0xc820d12720, 0x15, 0x4bfea0, 0xc820230060, 0x98, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.6/libexec/src/reflect/value.go:1041 +0x14a fp=0xc820038850 sp=0xc8200387c8
encoding/json.(*mapEncoder).encode(0xc820d3c880, 0xc821061760, 0x649bc0, 0xc820d12720, 0x15, 0x0)
/usr/local/Cellar/go/1.6/libexec/src/encoding/json/encode.go:622 +0x2ec fp=0xc820038940 sp=0xc820038850
encoding/json.(*mapEncoder).(encoding/json.encode)-fm(0xc821061760, 0x649bc0, 0xc820d12720, 0x15, 0xc820d12700)
/usr/local/Cellar/go/1.6/libexec/src/encoding/json/encode.go:632 +0x51 fp=0xc820038978 sp=0xc820038940
encoding/json.(*encodeState).reflectValue(0xc821061760, 0x649bc0, 0xc820d12720, 0x15)
/usr/local/Cellar/go/1.6/libexec/src/encoding/json/encode.go:301 +0x6b fp=0xc8200389a8 sp=0xc820038978
encoding/json.(*encodeState).marshal(0xc821061760, 0x649bc0, 0xc820d12720, 0x0, 0x0)
/usr/local/Cellar/go/1.6/libexec/src/encoding/json/encode.go:274 +0xa9 fp=0xc8200389f0 sp=0xc8200389a8
encoding/json.Marshal(0x649bc0, 0xc820d12720, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.6/libexec/src/encoding/json/encode.go:139 +0x84 fp=0xc820038a28 sp=0xc8200389f0
github.com/elastic/beats/libbeat/outputs/fileout.(*fileOutput).PublishEvent(0xc820012b80, 0x23e18e0, 0xc8211701c0, 0x1, 0xc820d12720, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/libbeat/outputs/fileout/file.go:76 +0x65 fp=0xc820038b00 sp=0xc820038a28
github.com/elastic/beats/libbeat/outputs.(*bulkOutputAdapter).BulkPublish(0xc820011e60, 0x23e18e0, 0xc8211701c0, 0x1, 0xc820b04000, 0x800, 0x800, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/libbeat/outputs/outputs.go:109 +0x140 fp=0xc820038bd0 sp=0xc820038b00
github.com/elastic/beats/libbeat/publisher.(*outputWorker).sendBulk(0xc82000abe0, 0xc820038d50, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/output.go:110 +0x190 fp=0xc820038c88 sp=0xc820038bd0
github.com/elastic/beats/libbeat/publisher.(*outputWorker).onBulk(0xc82000abe0, 0xc820038d50, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/output.go:86 +0x39d fp=0xc820038d18 sp=0xc820038c88
github.com/elastic/beats/libbeat/publisher.(*outputWorker).onMessage(0xc82000abe0, 0xffffffffffff0101, 0x23e18e0, 0xc821170160, 0x0, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/output.go:69 +0x79 fp=0xc820038d48 sp=0xc820038d18
github.com/elastic/beats/libbeat/publisher.(*messageWorker).onEvent(0xc82000abe0, 0xc820010101, 0x23e18e0, 0xc821170160, 0x0, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/worker.go:74 +0xb2 fp=0xc820038da0 sp=0xc820038d48
github.com/elastic/beats/libbeat/publisher.(*messageWorker).run(0xc82000abe0)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/worker.go:60 +0x34c fp=0xc820038fa8 sp=0xc820038da0
runtime.goexit()
/usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc820038fb0 sp=0xc820038fa8
created by github.com/elastic/beats/libbeat/publisher.(*messageWorker).init
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/worker.go:48 +0x126
goroutine 1 [chan receive]:
github.com/elastic/beats/filebeat/beater.(*Filebeat).Run(0xc82012a630, 0xc82011e300, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/filebeat.go:101 +0x6cf
github.com/elastic/beats/libbeat/beat.(*instance).run(0xc820134520, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/libbeat/beat/beat.go:257 +0x120
github.com/elastic/beats/libbeat/beat.(*instance).launch(0xc820134520, 0x1, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/libbeat/beat/beat.go:295 +0x1f1
github.com/elastic/beats/libbeat/beat.Run(0x697cb0, 0x8, 0x0, 0x0, 0x2200580, 0xc82012a630, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/libbeat/beat/beat.go:117 +0x72
main.main()
/Users/tsg/src/github.com/elastic/beats/filebeat/main.go:22 +0x99
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:1998 +0x1
goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
/usr/local/Cellar/go/1.6/libexec/src/runtime/sigqueue.go:116 +0x132
os/signal.loop()
/usr/local/Cellar/go/1.6/libexec/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
/usr/local/Cellar/go/1.6/libexec/src/os/signal/signal_unix.go:28 +0x37
goroutine 11 [runnable]:
github.com/elastic/beats/libbeat/outputs/logstash.(*logstash).BulkPublish(0xc820135820, 0x23e18e0, 0xc821170160, 0x1, 0xc820b04000, 0x800, 0x800, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/libbeat/outputs/logstash/logstash.go:121 +0x14f
github.com/elastic/beats/libbeat/publisher.(*outputWorker).sendBulk(0xc82000ab40, 0xc82003bd50, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/output.go:110 +0x190
github.com/elastic/beats/libbeat/publisher.(*outputWorker).onBulk(0xc82000ab40, 0xc82003bd50, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/output.go:86 +0x39d
github.com/elastic/beats/libbeat/publisher.(*outputWorker).onMessage(0xc82000ab40, 0xffffffffffff0101, 0x23e18e0, 0xc821170160, 0x0, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/output.go:69 +0x79
github.com/elastic/beats/libbeat/publisher.(*messageWorker).onEvent(0xc82000ab40, 0xc820010101, 0x23e18e0, 0xc821170160, 0x0, 0xc820b04000, 0x800, 0x800)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/worker.go:74 +0xb2
github.com/elastic/beats/libbeat/publisher.(*messageWorker).run(0xc82000ab40)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/worker.go:60 +0x34c
created by github.com/elastic/beats/libbeat/publisher.(*messageWorker).init
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/worker.go:48 +0x126
goroutine 13 [select]:
github.com/elastic/beats/libbeat/publisher.(*bulkWorker).run(0xc82013a000)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/bulk.go:60 +0x36e
created by github.com/elastic/beats/libbeat/publisher.newBulkWorker
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/bulk.go:42 +0x20d
goroutine 14 [select, locked to thread]:
runtime.gopark(0x7a1d38, 0xc820023f28, 0x688b40, 0x6, 0x18, 0x2)
/usr/local/Cellar/go/1.6/libexec/src/runtime/proc.go:262 +0x163
runtime.selectgoImpl(0xc820023f28, 0x0, 0x18)
/usr/local/Cellar/go/1.6/libexec/src/runtime/select.go:392 +0xa67
runtime.selectgo(0xc820023f28)
/usr/local/Cellar/go/1.6/libexec/src/runtime/select.go:215 +0x12
runtime.ensureSigM.func1()
/usr/local/Cellar/go/1.6/libexec/src/runtime/signal1_unix.go:279 +0x32c
runtime.goexit()
/usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:1998 +0x1
goroutine 15 [chan receive]:
github.com/elastic/beats/libbeat/service.HandleSignals.func1(0xc820136240, 0xc8201880a0, 0xc82000e360)
/Users/tsg/src/github.com/elastic/beats/libbeat/service/service.go:29 +0x3a
created by github.com/elastic/beats/libbeat/service.HandleSignals
/Users/tsg/src/github.com/elastic/beats/libbeat/service/service.go:32 +0x21e
goroutine 21 [sleep]:
time.Sleep(0x2540be400)
/usr/local/Cellar/go/1.6/libexec/src/runtime/time.go:59 +0xf9
github.com/elastic/beats/filebeat/harvester.(*logFileReader).wait(0xc820056070)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/reader.go:149 +0x25
github.com/elastic/beats/filebeat/harvester.(*logFileReader).Read(0xc820056070, 0xc8204dc000, 0x4000, 0x4000, 0x4000, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/reader.go:143 +0xe2a
github.com/elastic/beats/filebeat/harvester/encoding.(*LineReader).advance(0xc8200560e0, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/encoding/reader.go:118 +0x43e
github.com/elastic/beats/filebeat/harvester/encoding.(*LineReader).Next(0xc8200560e0, 0x0, 0x0, 0x0, 0xbf, 0x0, 0x0)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/encoding/reader.go:67 +0x5c
github.com/elastic/beats/filebeat/harvester/processor.LineSource.Next(0xc8200560e0, 0x0, 0xc800000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/processor.go:73 +0x75
github.com/elastic/beats/filebeat/harvester/processor.(*timeoutProcessor).Next.func1(0xc82012c940)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/timeout.go:52 +0x4f
created by github.com/elastic/beats/filebeat/harvester/processor.(*timeoutProcessor).Next
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/timeout.go:58 +0xae
goroutine 34 [chan send]:
github.com/elastic/beats/filebeat/beater.(*Spooler).flush(0xc82013a070)
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/spooler.go:148 +0x128
github.com/elastic/beats/filebeat/beater.(*Spooler).queue(0xc82013a070, 0xc820a68460)
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/spooler.go:124 +0x148
github.com/elastic/beats/filebeat/beater.(*Spooler).run(0xc82013a070)
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/spooler.go:85 +0x393
created by github.com/elastic/beats/filebeat/beater.(*Spooler).Start
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/spooler.go:64 +0x58
goroutine 35 [select]:
github.com/elastic/beats/filebeat/crawler.(*Registrar).Run(0xc820498180)
/Users/tsg/src/github.com/elastic/beats/filebeat/crawler/registrar.go:88 +0x4d0
created by github.com/elastic/beats/filebeat/beater.(*Filebeat).Run
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/filebeat.go:87 +0x44a
goroutine 36 [select]:
github.com/elastic/beats/filebeat/harvester/processor.(*timeoutProcessor).Next(0xc82012c940, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/timeout.go:61 +0x2bd
github.com/elastic/beats/filebeat/harvester/processor.(*MultiLine).readFirst(0xc820016280, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/multiline.go:121 +0xa5
github.com/elastic/beats/filebeat/harvester/processor.(*MultiLine).Next(0xc820016280, 0x0, 0xc800000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/multiline.go:116 +0x76
github.com/elastic/beats/filebeat/harvester/processor.(*StripNewline).Next(0xc820128280, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/processor.go:84 +0x9f
github.com/elastic/beats/filebeat/harvester.readLine(0xbc15f8, 0xc820128280, 0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, 0x0, 0x0, ...)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/util.go:16 +0x76
github.com/elastic/beats/filebeat/harvester.(*Harvester).Harvest(0xc82049a180)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/log.go:115 +0x67d
created by github.com/elastic/beats/filebeat/harvester.(*Harvester).Start
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/harvester.go:72 +0x35
goroutine 37 [chan send]:
github.com/elastic/beats/filebeat/harvester.(*Harvester).Harvest(0xc82049a200)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/log.go:150 +0xd3c
created by github.com/elastic/beats/filebeat/harvester.(*Harvester).Start
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/harvester.go:72 +0x35
goroutine 38 [chan send]:
github.com/elastic/beats/filebeat/harvester/processor.(*timeoutProcessor).Next.func1(0xc8204983c0)
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/timeout.go:53 +0x15a
created by github.com/elastic/beats/filebeat/harvester/processor.(*timeoutProcessor).Next
/Users/tsg/src/github.com/elastic/beats/filebeat/harvester/processor/timeout.go:58 +0xae
goroutine 50 [sleep]:
time.Sleep(0x12a05f200)
/usr/local/Cellar/go/1.6/libexec/src/runtime/time.go:59 +0xf9
github.com/elastic/beats/filebeat/crawler.(*ProspectorLog).Run(0xc82014e1e0)
/Users/tsg/src/github.com/elastic/beats/filebeat/crawler/prospector_log.go:59 +0x1e5
github.com/elastic/beats/filebeat/crawler.(*Prospector).Run(0xc82010c000, 0xc8200143e0)
/Users/tsg/src/github.com/elastic/beats/filebeat/crawler/prospector.go:95 +0x1b3
created by github.com/elastic/beats/filebeat/crawler.(*Crawler).Start
/Users/tsg/src/github.com/elastic/beats/filebeat/crawler/crawler.go:56 +0x6cd
goroutine 51 [chan receive]:
github.com/elastic/beats/libbeat/publisher.(*syncPublisher).send(0xc820130010, 0xc821250101, 0x23e18e0, 0xc821170160, 0x0, 0xc820b04000, 0x800, 0x800, 0xc820130010)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/sync.go:51 +0x2f5
github.com/elastic/beats/libbeat/publisher.(*syncPublisher).PublishEvents(0xc820130010, 0x101, 0x0, 0x0, 0xc820b04000, 0x800, 0x800, 0x23e1880)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/sync.go:29 +0xbb
github.com/elastic/beats/libbeat/publisher.(*client).PublishEvents(0xc8204980c0, 0xc820b04000, 0x800, 0x800, 0xc821252050, 0x2, 0x2, 0x1)
/Users/tsg/src/github.com/elastic/beats/libbeat/publisher/client.go:147 +0x29e
github.com/elastic/beats/filebeat/beater.(*syncLogPublisher).Start.func1(0xc820012380)
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/publish.go:103 +0x3bb
created by github.com/elastic/beats/filebeat/beater.(*syncLogPublisher).Start
/Users/tsg/src/github.com/elastic/beats/filebeat/beater/publish.go:113 +0x58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment