influxdata / influxdata/influxdb1-client

Invalid memory address- Raspberry

Open
#33 2 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Go
Stars
192
Forks
109
PR merge metrics
No merged PRs in 30d

Description

I wrote some code with Influxdb client and it works fine on x64 but when I run the code on RaspberryPi 4 arm7 it fails to run with error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xc pc=0x1de378]

goroutine 1 [running]:
github.com/influxdata/influxdb1-client/v2.(*Response).Error(0x0, 0x1, 0x1)
/home/pi/go/pkg/mod/github.com/influxdata/influxdb1-client@v0.0.0-20191209144304-8bf82d3c094d/v2/client.go:477 +0x14

Tested on go version 1.11 and 1.14

I even made some simple code just getting number of points in measurement (code here is sanitized from some lines ):
```
queryString := fmt.Sprintf("SELECT Count(*) FROM %s", "location_dev")
q := client.NewQuery(queryString, "testdb", "")
if response, err := dbClient.Query(q); err == nil && response.Error() == nil {
if len(response.Results[0].Series) != 0 {
totalPoints, _ := response.Results[0].Series[0].Values[0][1].(json.Number).Int64()
} else
return
}
} else {
fmt.Println(err)
fmt.Println(response.Error())

}
}
```
And it still fails to run. What is strange is that there should be some points in db but it seems that the code go to last line fmt.Println(response.Error()) like there has been some error.
It always panics in 477 line of client.go

Has any one got the same error, do you have any solution?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Query call and the nil receiver panic at v2/client.go:477, then reproduce the sanitized SELECT Count(*) example on a Raspberry Pi 4 arm7 environment. Compare the response and error paths on ARM and x64; done means the reported query no longer panics and its failure or result is handled predictably.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.