The Wayback Machine - http://web.archive.org/web/20240522014217/https://github.com/go-task/task/issues/338
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

task 2.8.1 panic with empty task #338

Closed

marco-m opened this issue Jun 5, 2020 · 5 comments
Closed

task 2.8.1 panic with empty task #338

marco-m opened this issue Jun 5, 2020 · 5 comments
Labels
good first issue Issues that are good for first-time contributors to pick up. type: bug Something not working as intended.

Comments

@marco-m
Copy link
Contributor

marco-m commented Jun 5, 2020

Both these Taskfiles cause task to panic:

version: '2'

tasks:
  foo:

and (so default is not a special case)

version: '2'

tasks:
  default:

Panic is:

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

goroutine 1 [running]:
github.com/go-task/task/v2/internal/taskfile/read.Taskfile(0x0, 0x0, 0x139e0cb, 0xc, 0xc000060460, 0x5, 0x5)
        /home/runner/work/task/task/internal/taskfile/read/taskfile.go:64 +0x5c1
github.com/go-task/task/v2.(*Executor).Setup(0xc00007c2c0, 0xc00007c2c0, 0x0)
        /home/runner/work/task/task/task.go:109 +0x89
main.main()
        /home/runner/work/task/task/cmd/task/task.go:135 +0x989

Happening with task 2.8.1 on macOS.

@andreynering andreynering added the type: bug Something not working as intended. label Jun 11, 2020
@andreynering
Copy link
Member

andreynering commented Jun 11, 2020

I'm not sure why someone would write an empty task.

Seems worth fixing it though, since it'd be pretty easy.

@marco-m
Copy link
Contributor Author

marco-m commented Jun 12, 2020

I'm not sure why someone would write an empty task.

By mistake :-)

I had a partially commented-out task, which resulted in the equivalent of the reproduction case I added in the issue.

To me, any crash, especially with a so simple input, deserves an attempt to be fixed :-)

@andreynering andreynering added the good first issue Issues that are good for first-time contributors to pick up. label Aug 17, 2020
@bharathshetty4
Copy link
Contributor

bharathshetty4 commented Aug 21, 2020

I can work on this :)

@andreynering
Copy link
Member

andreynering commented Oct 13, 2020

Fixed on d78f78b

@marco-m
Copy link
Contributor Author

marco-m commented Oct 13, 2020

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are good for first-time contributors to pick up. type: bug Something not working as intended.
Projects
None yet
Development

No branches or pull requests

3 participants