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

Vale crashing on Windows after 2.3.4 release when invalid StylesPath #267

Closed
nschonni opened this issue Nov 11, 2020 · 6 comments
Closed

Comments

@nschonni
Copy link

  • OS: Windows 10 202H x64
  • Install method: direct download from GitHub releases
  • Vale version: 2.6.1, but tested all the versions going back to 2.3.4 where it worked again

Running the version command works, but running a glob pattern like vale "**/*.md" crashes out

In Git Bash

$ vale "**/*.md"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x99fb70]

goroutine 1 [running]:
github.com/errata-ai/vale/v2/core.NewE201(0xc0000d5ec0, 0x34, 0xc00058ae21, 0x16, 0xc0004bf980, 0x9, 0xe5ba18, 0xc0000d5ec0, 0xc000641930)
        /home/travis/gopath/src/github.com/errata-ai/vale/core/error.go:130 +0x160
github.com/errata-ai/vale/v2/core.NewE201FromTarget(0xc0000d5ec0, 0x34, 0xc00058ae21, 0x16, 0xc0004bf980, 0x9, 0x34, 0xc00058afe0)
        /home/travis/gopath/src/github.com/errata-ai/vale/core/error.go:157 +0x77
github.com/errata-ai/vale/v2/source.glob..func11(0xc0005e55e0, 0xc0003e8600, 0xc000564ce0, 0x2, 0x2, 0x1, 0xa)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:109 +0x2cc
github.com/errata-ai/vale/v2/source.processConfig(0xc000394540, 0xc0003e8600, 0xc000564ce0, 0x2, 0x2, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:289 +0xd89
github.com/errata-ai/vale/v2/source.loadINI(0xc0003e8600, 0x1719320, 0x1)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:219 +0x387
github.com/errata-ai/vale/v2/source.From(0xd758ab, 0x3, 0xc0003e8600, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/source.go:16 +0x107
main.main.func2(0xc0003c71e0, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/main.go:156 +0x96
github.com/urfave/cli.HandleAction(0xcac220, 0xc000564660, 0xc0003c71e0, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:526 +0xc5
github.com/urfave/cli.(*App).Run(0xc0008a0540, 0xc0000b4440, 0x2, 0x2, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:288 +0x5ff
main.main()
        /home/travis/gopath/src/github.com/errata-ai/vale/main.go:193 +0xd94

In PowerShell

PS Z:\cspell\packages\cspell-tools> vale --version
vale version 2.6.1
PS Z:\cspell\packages\cspell-tools> vale "**/*.md"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x99fb70]

goroutine 1 [running]:
github.com/errata-ai/vale/v2/core.NewE201(0xc00065c200, 0x34, 0xc0004ea7e1, 0x16, 0xc0006c65f0, 0x9, 0xe5ba18, 0xc00065c200, 0xc0005152b0)
        /home/travis/gopath/src/github.com/errata-ai/vale/core/error.go:130 +0x160
github.com/errata-ai/vale/v2/core.NewE201FromTarget(0xc00065c200, 0x34, 0xc0004ea7e1, 0x16, 0xc0006c65f0, 0x9, 0x34, 0xc0004ea9a0)
        /home/travis/gopath/src/github.com/errata-ai/vale/core/error.go:157 +0x77
github.com/errata-ai/vale/v2/source.glob..func11(0xc0005067e0, 0xc00020dc00, 0xc000277de0, 0x2, 0x2, 0x1, 0xa)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:109 +0x2cc
github.com/errata-ai/vale/v2/source.processConfig(0xc000370540, 0xc00020dc00, 0xc000277de0, 0x2, 0x2, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:289 +0xd89
github.com/errata-ai/vale/v2/source.loadINI(0xc00020dc00, 0x1719320, 0x1)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:219 +0x387
github.com/errata-ai/vale/v2/source.From(0xd758ab, 0x3, 0xc00020dc00, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/source.go:16 +0x107
main.main.func2(0xc000510dc0, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/main.go:156 +0x96
github.com/urfave/cli.HandleAction(0xcac220, 0xc0002778a0, 0xc000510dc0, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:526 +0xc5
github.com/urfave/cli.(*App).Run(0xc0000d2380, 0xc0000044a0, 0x2, 0x2, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:288 +0x5ff
main.main()
        /home/travis/gopath/src/github.com/errata-ai/vale/main.go:193 +0xd94
@nschonni nschonni changed the title Windows crashing after 2.3.4 Vale crashing on Windows after 2.3.4 release when running with a glob Nov 11, 2020
@jdkato
Copy link
Member

jdkato commented Nov 12, 2020

I'm not completely understanding what's happening here:

  1. I can't reproduce the crash on v2.6.1 (the only version I've tried so far).

  2. vale "**/*.md" isn't supported syntax. It shouldn't crash, but the glob pattern isn't going to be evaluated in any version of Vale.

  3. What results do you get with v2.3.4?

@nschonni
Copy link
Author

nick_@DESKTOP-OKIMI68 MINGW64 /z/cspell (master)
$ vale --version
vale version 2.3.4

nick_@DESKTOP-OKIMI68 MINGW64 /z/cspell (remove-parallel-coveralls)
$ vale "**/*.md"
✔ ←[31m0 errors←[0m, ←[33m0 warnings←[0m and ←[34m0 suggestions←[0m in stdin.

I'll go back and try the old . instead for both to see

@nschonni
Copy link
Author

First run is with 2.3.4, the second with the crash is renaming 2.6.1 exe again

nick_@DESKTOP-OKIMI68 MINGW64 /z/cspell (remove-parallel-coveralls)
$ vale .
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
No XSLT transform provided!
✔ ←[31m0 errors←[0m, ←[33m0 warnings←[0m and ←[34m0 suggestions←[0m in 50292 files.

nick_@DESKTOP-OKIMI68 MINGW64 /z/cspell (remove-parallel-coveralls)
$ vale .
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x99fb70]

goroutine 1 [running]:
github.com/errata-ai/vale/v2/core.NewE201(0xc00001fd00, 0x34, 0xc00065aa81, 0x16, 0xc000516670, 0x9, 0xe5ba18, 0xc00001fd00, 0xc000713c70)
        /home/travis/gopath/src/github.com/errata-ai/vale/core/error.go:130 +0x160
github.com/errata-ai/vale/v2/core.NewE201FromTarget(0xc00001fd00, 0x34, 0xc00065aa81, 0x16, 0xc000516670, 0x9, 0x34, 0xc00065ac40)
        /home/travis/gopath/src/github.com/errata-ai/vale/core/error.go:157 +0x77
github.com/errata-ai/vale/v2/source.glob..func11(0xc000689dc0, 0xc000461c00, 0xc000292020, 0x2, 0x2, 0x1, 0xa)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:109 +0x2cc
github.com/errata-ai/vale/v2/source.processConfig(0xc000394540, 0xc000461c00, 0xc000292020, 0x2, 0x2, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:289 +0xd89
github.com/errata-ai/vale/v2/source.loadINI(0xc000461c00, 0x1719320, 0x1)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/ini.go:219 +0x387
github.com/errata-ai/vale/v2/source.From(0xd758ab, 0x3, 0xc000461c00, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/source/source.go:16 +0x107
main.main.func2(0xc0003da840, 0x0, 0x0)
        /home/travis/gopath/src/github.com/errata-ai/vale/main.go:156 +0x96
github.com/urfave/cli.HandleAction(0xcac220, 0xc00038dae0, 0xc0003da840, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:526 +0xc5
github.com/urfave/cli.(*App).Run(0xc0008bc540, 0xc0000b4440, 0x2, 0x2, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/urfave/cli@v1.22.4/app.go:288 +0x5ff
main.main()
        /home/travis/gopath/src/github.com/errata-ai/vale/main.go:193 +0xd94

Here is my .vale which may also be outdated in some formatting

# This goes in a file named either `.vale.ini` or `_vale.ini`.

StylesPath = path/to/some/directory
MinAlertLevel = error # suggestion, warning or error
[node_modules/*]
vale = NO

# Only Markdown and .txt files; change to whatever you're using.
[*.{md,txt,ts,js,xml,html,cs,vb,json}]
# List of styles to load.
BasedOnStyles = vale
# Style.Rule = {YES, NO, suggestion, warning, error} to
# enable/disable a rule or change its level.
vale.Uncomparables = NO
vale.Redundancy = NO

@nschonni
Copy link
Author

OK, looks like it is this line that is crashing it out StylesPath = path/to/some/directory. If I comment it out, the crash goes away

@nschonni nschonni changed the title Vale crashing on Windows after 2.3.4 release when running with a glob Vale crashing on Windows after 2.3.4 release when invalid StylesPath Nov 16, 2020
@nschonni
Copy link
Author

@jdkato updated the title since it appears to be related to the path reading in the config rather than anything to do with globbing

@jdkato
Copy link
Member

jdkato commented Nov 16, 2020

Thanks for the update. I've found the issue and it'll be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants