I cause panic when I use test in a function with
telegraf.Accumulator.AddFields
it looks like atomic.addUint64 cause the panic
How can I fit it

vim-go: --- FAIL: TestPingGather (0.00s)
panic: runtime error: invalid memory address or nil pointer
dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0xae220]

goroutine 21 [running]:
panic(0x25f2f8, 0x10626008)
        /usr/local/go/src/runtime/panic.go:500 +0x33c
testing.tRunner.func1(0x10666680)
        /usr/local/go/src/testing/testing.go:579 +0x168
panic(0x25f2f8, 0x10626008)
        /usr/local/go/src/runtime/panic.go:458 +0x454
sync/atomic.addUint64(0x1066c614, 0x1, 0x0, 0x1, 0x0)
        /usr/local/go/src/sync/atomic/64bit_arm.go:31
+0x68github.com/influxdata/telegraf/testutil.(*Accumulator).AddFields(0x1066c600,
0x28a96f, 0x5, 0x106692c0, 0x106692a0, 0x106b5c20, 0x1, 0x1)
        
/workspace/go/src/github.com/influxdata/telegraf/testutil/accumulator.go:56
+0x64github.com/influxdata/telegraf/plugins/inputs/dht.(*Dht).Gather(0x10632f98,
0x35f010, 0x1066c600, 0x0, 0x0)
        
/workspace/go/src/github.com/influxdata/telegraf/plugins/inputs/dht/dht.go:52
+0x2fcgithub.com/influxdata/telegraf/plugins/inputs/dht.TestPingGather(0x10666680)
        
/workspace/go/src/github.com/influxdata/telegraf/plugins/inputs/dht/dht_test.go:20
+0xb4
testing.tRunner(0x10666680, 0x2b2e34)
        /usr/local/go/src/testing/testing.go:610 +0xa4
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:646 +0x304
exit status 2
FAIL    github.com/influxdata/telegraf/plugins/inputs/dht       0.020s
vim-go: [test] FAIL

System info:

Raspbian GNU/Linux 8.0 (jessie) 32bit OS
Raspberry pi3b
telegraf is git clone the source form master

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CAACkWBtEmc0LddMWzbUocLEvKTbu2AJDfRsnyaYkNV6bDSiTHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to