wuzz icon indicating copy to clipboard operation
wuzz copied to clipboard

panic: invalid arguments

Open hackeryarn opened this issue 7 years ago • 15 comments

I am getting the below error when trying to run wuzz with no arguments. I am using ubuntu bash on windows to run this.

2017/03/12 21:15:06 invalid argument
panic: invalid argument


goroutine 1 [running]:
panic(0x6fed00, 0xc42000d3e0)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
log.Panicln(0xc420051e60, 0x1, 0x1)
        /usr/local/go/src/log/log.go:334 +0xc9
main.main()
        /home/achernyak/go/src/github.com/asciimoo/wuzz/wuzz.go:1594 +0xf8c

hackeryarn avatar Mar 13 '17 02:03 hackeryarn

@achernyak what's your Go version?

Benaiah avatar Mar 13 '17 02:03 Benaiah

I was originally on 1.7.4 then I tried upgrading to 1.8.0 and still the same exact error.

hackeryarn avatar Mar 13 '17 02:03 hackeryarn

@achernyak what is your operating system/terminal? Seems gocui cannot start in 256 color mode.

asciimoo avatar Mar 13 '17 09:03 asciimoo

@asciimoo I am on windows 10 running Bash on Ubuntu on Windows. It seems that they do have 256 color support and my terminal is identified as xterm-256color by default. I do believe this is a platform specific issue since it works everywhere else. So might be worth just putting in a note about support.

hackeryarn avatar Mar 13 '17 13:03 hackeryarn

@achernyak could you confirm that fa4c1e8 solves the problem?

asciimoo avatar Mar 14 '17 01:03 asciimoo

Thanks for the really quick work around on this. However, it looks like there is still an error further down the code. The error moved now.

panic: invalid argument


goroutine 1 [running]:
log.Panicln(0xc420055ec0, 0x1, 0x1)
        /usr/local/go/src/log/log.go:336 +0xc0
main.main()
        /home/achernyak/go/src/github.com/asciimoo/wuzz/wuzz.go:1624 +0xe13

hackeryarn avatar Mar 14 '17 03:03 hackeryarn

So the problem isn't the 256 color mode.. strange..

asciimoo avatar Mar 14 '17 03:03 asciimoo

@asciimoo It is still getting thrown in the same expression actually. OutputNormal seems to be throwing too. I was trying to set it to OutputGrayscale which seems to be supported by termbox which is used by gocui but gocui doesn't export it as an options.

hackeryarn avatar Mar 14 '17 03:03 hackeryarn

@achernyak does OutputGrayscale work in your terminal?

asciimoo avatar Mar 14 '17 03:03 asciimoo

@asciimoo no still no luck with it. I was not able to get it to set to OutputGrayscale looks like gocui only supports OutputNormal and Output256.

hackeryarn avatar Mar 14 '17 04:03 hackeryarn

@achernyak you can cast it to the correct type:

g, err = gocui.NewGui(gocui.OutputMode(termbox.OutputGrayscale))

asciimoo avatar Mar 14 '17 04:03 asciimoo

@achernyak could you test e6f5674 ?

asciimoo avatar Mar 14 '17 04:03 asciimoo

@asciimoo unfortunates it looks like I am still getting a panic there...

2017/03/14 06:49:12 invalid argument
panic: invalid argument


goroutine 1 [running]:
log.Panicln(0xc420055ec0, 0x1, 0x1)
        /usr/local/go/src/log/log.go:336 +0xc0
main.main()
        /home/achernyak/go/src/github.com/asciimoo/wuzz/wuzz.go:1630 +0x811

hackeryarn avatar Mar 14 '17 11:03 hackeryarn

Hmm, then, the problem isn't the color mode..

asciimoo avatar Mar 14 '17 12:03 asciimoo

I ran into a similar issue while working with gocui on WSL Bash on Windows. I think the root cause might be: https://github.com/Microsoft/BashOnWindows/issues/601

dimakogan avatar Oct 06 '17 01:10 dimakogan