Closed jinie closed 8 years ago
Confirm.
It is probably related to Go 1.6 "rules for sharing Go pointers with C code".
Temporary solution:
GODEBUG=cgocheck=0
Try last commit.
It seems to work here. The Update function is called, and nothing crashes.
22:29:46.177 func1 ▶ DEBUG TOPIC: /surveillance/temperature/28-0314565062ff/fenrir
22:29:46.177 func1 ▶ DEBUG MSG: {"reading":{"host":"fenrir","reading":2.625,"sensor":"28-0314565062ff","timestamp":"2016-02-22 22:29:46.070171"}}
22:29:46.177 GetRRDFile ▶ DEBUG RRDFile: rrd/fenrir_28-0314565062ff.rrd
22:29:46.177 UpdateRRD ▶ DEBUG Updating RRDFile: rrd/fenrir_28-0314565062ff.rrd , with values { fenrir , 28-0314565062ff , 2.625 , 2016-02-22 22:29:46.070171 }
Ok. So close this issue.
I'm not entirely sure this is an issue, or my wrong understanding on how to use the library. When i call Update(time.Now(),1234) i get a panic: panic: runtime error: cgo argument has Go pointer to Go pointer
Here's a snippet of my code:
I've verified that the filename used to initialize the call to NewUpdater is in fact a string (and correct), and the types of the parameters in the call are time.Time and float64.
it appears to happen in the following code (src/github.com/ziutek/rrd/rrd_c.go:69 +0x100 github.com/ziutek/rrd.(*Updater).Update(0xc820129c38, 0x0, 0x0, 0x0, 0x0, 0x0))