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

Panic after upgrade #718

Closed
JiDai opened this issue Oct 23, 2019 · 8 comments · Fixed by #738 or #740
Closed

Panic after upgrade #718

JiDai opened this issue Oct 23, 2019 · 8 comments · Fixed by #738 or #740
Labels
🐛 bug "Houston, we've had a problem."

Comments

@JiDai
Copy link

JiDai commented Oct 23, 2019

What's broken?

I have just change my Mac so I reinstall wtf (with brew) at its last version but I don't know the previous installed version, I could tell this evening.

When I run the wtf with the config located in the default place, I have this error :

panic: runtime error: slice bounds out of range [-1:]

goroutine 1 [running]:
github.com/wtfutil/wtf/utils.CalculateDimensions(0xc000596520, 0xc0005963c0, 0x8, 0xc000673268)
	/private/tmp/wtfutil-20191012-32990-9vzwg7/utils/utils.go:169 +0x3f9
github.com/wtfutil/wtf/modules/cmdrunner.NewSettingsFromYAML(0xc0005841c4, 0x9, 0xc000596520, 0xc0005963c0, 0x0)
	/private/tmp/wtfutil-20191012-32990-9vzwg7/modules/cmdrunner/settings.go:40 +0x2d1
github.com/wtfutil/wtf/app.MakeWidget(0xc000538280, 0xc0000bd2f0, 0xc0005841c4, 0x9, 0xc0005963c0, 0x0, 0x26762f32837c)
	/private/tmp/wtfutil-20191012-32990-9vzwg7/app/widget_maker.go:114 +0x1f42
github.com/wtfutil/wtf/app.MakeWidgets(0xc000538280, 0xc0000bd2f0, 0xc0005963c0, 0xc000673d20, 0x1, 0x1)
	/private/tmp/wtfutil-20191012-32990-9vzwg7/app/widget_maker.go:266 +0x12a
github.com/wtfutil/wtf/app.NewWtfApp(0xc000538280, 0xc0005963c0, 0xc0003ff050, 0x24, 0x1)
	/private/tmp/wtfutil-20191012-32990-9vzwg7/app/wtf_app.go:47 +0x2e7
main.main()
	/private/tmp/wtfutil-20191012-32990-9vzwg7/main.go:69 +0x278

Here is my config :

wtf:
  # Will fail if `colors` not present:
  colors:
  refreshInterval: 5
  mods:
    cmdrunner:
      enabled: true
      type: cmdrunner
      refreshInterval: 10
      title: 'Dev Status'
      cmd: "node"
      args: ["run.js"]
      position:
        top: 0
        left: 0
        height: 1
        width: 1

I tried with this example config :

wtf:
 # Will fail if `colors` not present:
 colors:
 refreshInterval: 5
 mods:
   feedreader:
     enabled: true
     feeds:
     - https://news.ycombinator.com/rss
     feedLimit: 10
     focusable: false
     position:
       top: 2
       left: 2
       width: 1
       height: 1
     title: "Hacker News"
     updateInterval: 14400

and it worked.
I have no idea what I am doing wrong.

$ wtfutil --version
dev 
@senorprogrammer senorprogrammer added the 🐛 bug "Houston, we've had a problem." label Oct 23, 2019
@senorprogrammer
Copy link
Collaborator

Thanks, I'll take a look

@ptxmac
Copy link

ptxmac commented Oct 30, 2019

This is most likely related to #730

@JiDai
Copy link
Author

JiDai commented Nov 3, 2019

Is there a way to workaround the problem ?

@ptxmac
Copy link

ptxmac commented Nov 5, 2019

Is there a way to workaround the problem ?

setting rows and columns explicitly will work

@ptxmac
Copy link

ptxmac commented Nov 9, 2019

Closed by mistake - this is still an open issue

@senorprogrammer
Copy link
Collaborator

senorprogrammer commented Nov 9, 2019

Are you sure you've pulled the latest master? Per the other issue, this config https://github.com/wtfutil/wtf/blob/master/_sample_configs/dynamic_sizing.yml was added that has no color key or grid key. Could you give it a try and see if it works locally?

    go run . --config=_sample_configs/dynamic_sizing.yml

Also, could you post the top part of your config, from wtf: to modules:? Nothing in that section should be sensitive. If there is sensitive data, remove it first.

senorprogrammer added a commit that referenced this issue Nov 9, 2019
Closes #718 and closes #730.

Signed-off-by: Chris Cummer <chriscummer@me.com>
@senorprogrammer
Copy link
Collaborator

I'm able to replicate the issue.

@ptxmac
Copy link

ptxmac commented Nov 9, 2019

I think this should just be merged with #730 (or reverse)

senorprogrammer added a commit that referenced this issue Nov 9, 2019
Closes #718 and closes #730.

Signed-off-by: Chris Cummer <chriscummer@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug "Houston, we've had a problem."
3 participants