Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: benchmark panic #884

Open
lucasmenendez opened this issue Apr 12, 2023 · 0 comments
Open

bug: benchmark panic #884

lucasmenendez opened this issue Apr 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@lucasmenendez
Copy link
Contributor

Describe the bug
Panic error initializing MockVochainNode on benchmarks

To Reproduce (please complete the following information)

Go to benchmark/ folder run, for example, the following prompt:

go test -v -run=- -bench=BenchmarkVochainSingleProof

Current behavior
Panic caused by invalid memory address or nil pointer dereference trying to update the vochain configuration struct data directory (config.VochainCfg.DataDir) with the testing temporal directory (testing.TB.TempDir()):

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

goroutine 23 [running]:
go.vocdoni.io/dvote/test/testcommon.NewMockVochainNode({0x3e15a50, 0xc0005c0000}, 0x0, 0x6?)
        /home/lucasmenendez/workspace/vocdoni-node/test/testcommon/vochain.go:193 +0x5d
go.vocdoni.io/dvote/test/testcommon.(*DvoteAPIServer).Start(0xc0001d3560, {0x3e15a50, 0xc0005c0000}, {0xc002a4fee8, 0x3, 0x116c65e?})
        /home/lucasmenendez/workspace/vocdoni-node/test/testcommon/rpc.go:102 +0x777
go.vocdoni.io/dvote/benchmark.BenchmarkVochainSingleProof(0xc0005c0000)
        /home/lucasmenendez/workspace/vocdoni-node/benchmark/vochain_benchmark_test.go:90 +0x119
testing.(*B).runN(0xc0005c0000, 0x1)
        /usr/local/go/src/testing/benchmark.go:193 +0x102
testing.(*B).run1.func1()
        /usr/local/go/src/testing/benchmark.go:233 +0x59
created by testing.(*B).run1
        /usr/local/go/src/testing/benchmark.go:226 +0x9c
exit status 2
FAIL    go.vocdoni.io/dvote/benchmark   0.918s

Expected behavior
I assume that the expected behaviour of this benchmark is to run successfully.

System (please complete the following information):

  • OS: Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
  • Software version: go version go1.20.3 linux/amd64
  • Commit hash: c9425c1
@lucasmenendez lucasmenendez added the bug Something isn't working label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant