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 When Using Glob #77

Closed
nsmryan opened this issue May 6, 2019 · 2 comments
Closed

Panic When Using Glob #77

nsmryan opened this issue May 6, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nsmryan
Copy link

nsmryan commented May 6, 2019

I got a panic when running scc on the command line in Windows 10.

The command was:

scc */*.cpp 

when run on a directory with no sub-directories (I forgot which directory I was in and ran this by accident). The same command works fine when there are sub-directories to enter.

The error message was:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0x52ad92]

goroutine 4 [running]:
github.com/boyter/scc/processor.walkDirectoryParallel(0x1140a080, 0x7, 0x11482140)
        /home/bboyter/Go/src/github.com/boyter/scc/processor/file.go:84 +0xf2
github.com/boyter/scc/processor.Process.func1.1(0x1140a080, 0x7, 0x11482140, 0x1140a070)
        /home/bboyter/Go/src/github.com/boyter/scc/processor/processor.go:344 +0x31
created by github.com/boyter/scc/processor.Process.func1
        /home/bboyter/Go/src/github.com/boyter/scc/processor/processor.go:343 +0xa5

Not a big issue, since the glob doesn't match any files anyway, but an error message would be nicer than a panic.

@boyter boyter self-assigned this May 6, 2019
@boyter boyter added the bug Something isn't working label May 6, 2019
@boyter
Copy link
Owner

boyter commented May 6, 2019

Fix sitting in PR #78 which I will merge once it ensures the build works as expected.

Thanks for reporting this. I could only trigger it on Windows but it is now resolved,

C:\Users\bboyter\Documents\Go\src\github.com\boyter\scc>go run main.go */*.cpp
ERROR 2019-05-06T22:18:07Z: GetFileAttributesEx *\*.cpp: The filename, directory name, or volume label syntax is incorrect.exit status 1

@boyter
Copy link
Owner

boyter commented May 6, 2019

Merged into master. Will be rolled into the next release. If you need a fix now then please build from master.

Once again thanks for reporting this!

@boyter boyter closed this as completed May 6, 2019
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

2 participants