sqshq / sampler

Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.

Home Page:https://sampler.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux invalid memory addres or nil pointer deference on strart

nikto-b opened this issue · comments

Have crash at start after nothing changed (working config, open in vim, close vim, restart, not working config)
ArchLinux, linux 5.2.0, sampler v 1.0.2
Error:

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

goroutine 8 [running]:
main.verifyLicense(0xc000013c20, 0xc000013aa0)
	main.go:146 +0x2d
created by main.main
	main.go:107 +0x983

Config:

variables:
  sshconnection: ssh -C -i ~/.ssh/rsa_weak user@ip
runcharts:
  - title: Search engine response time
    init: $sshconnection
    pty: true
    position: [[0, 7], [40, 24]]
    rate-ms: 500
    legend:
        enabled: true
        details: false
    scale: 2
    items:
      - label: GOOGLE
        color: 178
        sample: curl -o /dev/null -s -w '%{time_total}'  https://www.google.com
      - label: YAHOO
        sample: curl -o /dev/null -s -w '%{time_total}'  https://search.yahoo.com
      - label: BING
        sample: curl -o /dev/null -s -w '%{time_total}'  https://www.bing.com
sparklines:
  - title: CPU usage
    position: [[40, 7], [40, 24]]
    rate-ms: 200
    scale: 0
    sample: ps -A -o %cpu | awk '{s+=$1} END {print s}'
  - title: Free memory pages
    position: [[0, 0], [80, 8]]
    rate-ms: 200
    scale: 0
    sample: free | rg 'Mem' | awk '{print $3}'

Fix:

rm -r ~/.config/Sampler

Any news on this?
The fix does not work for me.
See the same error on mac os big sur

Looks like it is because of an outdated dependency to github.com/kr/pty. This moved to https://github.com/creack/pty. And the bug was fixed with creack/pty#96
Is there a possibility that you update all dependencies and release a new version @sqshq ?