[GH-ISSUE #438] Segmentation fault when omitting the GitHub repo revision #304

Closed
opened 2026-03-01 21:42:13 +03:00 by kerem · 3 comments
Owner

Originally created by @carlobeltrame on GitHub (Dec 8, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/438

When writing an (invalid) workflow YAML like this (note the missing revision @master after OskarStark/php-cs-fixer-ga):

name: Continuous integration

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  check:
    runs-on: ubuntu-latest
    steps:

      - uses: actions/checkout@v2

      - uses: OskarStark/php-cs-fixer-ga

act will run into a segmentation fault:

[Continuous integration/check] ⭐  Run OskarStark/php-cs-fixer-ga
[Continuous integration/check]   ☁  git clone 'https://github.com/OskarStark/php-cs-fixer-ga' # ref=
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x898d7f]

goroutine 34 [running]:
github.com/go-git/go-git/v5.(*Repository).ResolveRevision(0xc0005bc480, 0x0, 0x0, 0x2d, 0x0, 0x0)
	/home/runner/go/pkg/mod/github.com/go-git/go-git/v5@v5.1.0/repository.go:1520 +0x33f
github.com/nektos/act/pkg/common.NewGitCloneExecutor.func1(0xe2c1e0, 0xc00043a9f0, 0x0, 0x0)
	/home/runner/work/act/act/pkg/common/git.go:239 +0x430
github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0x23, 0xbbede0)
	/home/runner/work/act/act/pkg/common/executor.go:133 +0x4c
github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0xb, 0xc000399fe0)
	/home/runner/work/act/act/pkg/common/executor.go:133 +0x4c
github.com/nektos/act/pkg/runner.(*RunContext).newStepExecutor.func1(0xe2c1e0, 0xc00043a9f0, 0x0, 0x0)
	/home/runner/work/act/act/pkg/runner/run_context.go:209 +0x386
github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0xbbede0, 0xe369a0)
	/home/runner/work/act/act/pkg/common/executor.go:146 +0x17a
github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0x1, 0x138fd90)
	/home/runner/work/act/act/pkg/common/executor.go:133 +0x4c
github.com/nektos/act/pkg/common.Executor.If.func1(0xe2c1e0, 0xc00043a9f0, 0xc0003b9b40, 0x1c)
	/home/runner/work/act/act/pkg/common/executor.go:154 +0x6a
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1(0xe2c1e0, 0xc0003a09c0, 0xc00044c0c0, 0xc000390f70)
	/home/runner/work/act/act/pkg/runner/runner.go:78 +0x24b
github.com/nektos/act/pkg/common.Executor.ChannelError.func1(0xe2c1e0, 0xc0003a09c0, 0xc00044c0c0, 0x0)
	/home/runner/work/act/act/pkg/common/executor.go:125 +0x45
github.com/nektos/act/pkg/common.NewParallelExecutor.func1.1(0xc00044c080, 0xc0003d6120, 0xe2c1e0, 0xc0003a09c0)
	/home/runner/work/act/act/pkg/common/executor.go:101 +0x56
created by github.com/nektos/act/pkg/common.NewParallelExecutor.func1
	/home/runner/work/act/act/pkg/common/executor.go:100 +0xb7

GitHub actions will instead display a sensible error message:

The workflow is not valid. .github/workflows/continuous-integration.yml (Line: 16, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual 'OskarStark/php-cs-fixer-ga' Input string was not in a correct format.

This was the problem behind #213, and a proper error message could have prevented that issue.

Originally created by @carlobeltrame on GitHub (Dec 8, 2020). Original GitHub issue: https://github.com/nektos/act/issues/438 When writing an (invalid) workflow YAML like this (note the missing revision `@master` after `OskarStark/php-cs-fixer-ga`): ```yml name: Continuous integration on: push: pull_request: workflow_dispatch: jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: OskarStark/php-cs-fixer-ga ``` act will run into a segmentation fault: ``` [Continuous integration/check] ⭐ Run OskarStark/php-cs-fixer-ga [Continuous integration/check] ☁ git clone 'https://github.com/OskarStark/php-cs-fixer-ga' # ref= panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x898d7f] goroutine 34 [running]: github.com/go-git/go-git/v5.(*Repository).ResolveRevision(0xc0005bc480, 0x0, 0x0, 0x2d, 0x0, 0x0) /home/runner/go/pkg/mod/github.com/go-git/go-git/v5@v5.1.0/repository.go:1520 +0x33f github.com/nektos/act/pkg/common.NewGitCloneExecutor.func1(0xe2c1e0, 0xc00043a9f0, 0x0, 0x0) /home/runner/work/act/act/pkg/common/git.go:239 +0x430 github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0x23, 0xbbede0) /home/runner/work/act/act/pkg/common/executor.go:133 +0x4c github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0xb, 0xc000399fe0) /home/runner/work/act/act/pkg/common/executor.go:133 +0x4c github.com/nektos/act/pkg/runner.(*RunContext).newStepExecutor.func1(0xe2c1e0, 0xc00043a9f0, 0x0, 0x0) /home/runner/work/act/act/pkg/runner/run_context.go:209 +0x386 github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0xbbede0, 0xe369a0) /home/runner/work/act/act/pkg/common/executor.go:146 +0x17a github.com/nektos/act/pkg/common.Executor.Then.func1(0xe2c1e0, 0xc00043a9f0, 0x1, 0x138fd90) /home/runner/work/act/act/pkg/common/executor.go:133 +0x4c github.com/nektos/act/pkg/common.Executor.If.func1(0xe2c1e0, 0xc00043a9f0, 0xc0003b9b40, 0x1c) /home/runner/work/act/act/pkg/common/executor.go:154 +0x6a github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1(0xe2c1e0, 0xc0003a09c0, 0xc00044c0c0, 0xc000390f70) /home/runner/work/act/act/pkg/runner/runner.go:78 +0x24b github.com/nektos/act/pkg/common.Executor.ChannelError.func1(0xe2c1e0, 0xc0003a09c0, 0xc00044c0c0, 0x0) /home/runner/work/act/act/pkg/common/executor.go:125 +0x45 github.com/nektos/act/pkg/common.NewParallelExecutor.func1.1(0xc00044c080, 0xc0003d6120, 0xe2c1e0, 0xc0003a09c0) /home/runner/work/act/act/pkg/common/executor.go:101 +0x56 created by github.com/nektos/act/pkg/common.NewParallelExecutor.func1 /home/runner/work/act/act/pkg/common/executor.go:100 +0xb7 ``` GitHub actions will instead display a sensible error message: > The workflow is not valid. .github/workflows/continuous-integration.yml (Line: 16, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual 'OskarStark/php-cs-fixer-ga' Input string was not in a correct format. This was the problem behind #213, and a proper error message could have prevented that issue.
kerem closed this issue 2026-03-01 21:42:13 +03:00
Author
Owner

@lufia commented on GitHub (Jan 15, 2021):

@carlobeltrame Though I tried to reproduce that panic, I don't reproduce it yet. Instead I got an error "reference not found". Hmm.

This issue's goal is to exit act with appropriate an error message. right?

<!-- gh-comment-id:761259291 --> @lufia commented on GitHub (Jan 15, 2021): @carlobeltrame Though I tried to reproduce that panic, I don't reproduce it yet. Instead I got an error **"reference not found"**. Hmm. This issue's goal is to exit *act* with appropriate an error message. right?
Author
Owner

@carlobeltrame commented on GitHub (Jan 16, 2021):

Strange, I can still reproduce it including the segmentation fault on my end. If it is of any concern, I am currently using the act-environments-ubuntu image, although I think at the time I opened this issue I was using the stock image of act.

Anyway, yes, if act were to output a sensible error message, I would consider this issue as fixed.

<!-- gh-comment-id:761616928 --> @carlobeltrame commented on GitHub (Jan 16, 2021): Strange, I can still reproduce it including the segmentation fault on my end. If it is of any concern, I am currently using the act-environments-ubuntu image, although I think at the time I opened this issue I was using the stock image of act. Anyway, yes, if act were to output a sensible error message, I would consider this issue as fixed.
Author
Owner

@lufia commented on GitHub (Jan 21, 2021):

I became to be able to reproduce this panic. This panic is occurred on e47a239, but on e6fcfed, "reference not found" is occurred when run with above workflow.

Though I'm not sure what is the cause of this difference, I will try to add a log message.

<!-- gh-comment-id:764315521 --> @lufia commented on GitHub (Jan 21, 2021): I became to be able to reproduce this panic. This panic is occurred on e47a239, but on e6fcfed, "reference not found" is occurred when run with above workflow. Though I'm not sure what is the cause of this difference, I will try to add a log message.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#304
No description provided.