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

Method getOutlineStep panics because of a seg fault #141

Closed
phramos07 opened this issue Jun 28, 2022 · 5 comments
Closed

Method getOutlineStep panics because of a seg fault #141

phramos07 opened this issue Jun 28, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@phramos07
Copy link

phramos07 commented Jun 28, 2022

Current version: v.1.1.3

In line 353 of gobdd.go file we have (inside the method getOutlineStep :

if len(stepsList) == 0 {
    return newSteps
}

However in line 360 we have

newSteps = append(newSteps, stepsList[si][ci])

So, whenever stepsList comes with a "nil" inside first position, like stepsList = [nil], this will result in a seg fault. I'm just facing it while trying to parse this feature file step:

Given The setup with <param1> and <param2> :
    Examples:
      | param1  | param2 |
      | False       |    True   |

With this gobdd code:

func getSetup_outlinetest(t gobdd.StepTest, ctx gobdd.Context) {}

func TestScenarios(t *testing.T) {
	suite := gobdd.NewSuite(t, gobdd.WithFeaturesPath(PATH))
	suite.AddStep(`The setup with <param1> and <param2> :`, getSetup_outlinetest)
	suite.Run()

Running this test is resulting in a seg fault / panic.

@phramos07 phramos07 added the bug Something isn't working label Jun 28, 2022
@github-actions
Copy link

Thanks for creating your first issue! We are thankful for your help

@bkielbasa
Copy link
Collaborator

thanks for the bug report! I'll investigate the issue and prepare a fix soon.

@bkielbasa
Copy link
Collaborator

Hi, I created a test in the draft PR #142 for this issue but I cannot reproduce it. Could you help me with it a bit?

@phramos07
Copy link
Author

@bkielbasa I'm sorry for the late reply. I'll post a step-by-step to reproduce it as soon as possible.

@bkielbasa
Copy link
Collaborator

I cannot reproduce it. Pls reopen the ticket when you have the problem again and give me steps to reproduce it. Closing for now.

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

Successfully merging a pull request may close this issue.

2 participants