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: runtime error: invalid memory address or nil pointer dereference #208

Closed
sergeyklay opened this issue Dec 15, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@sergeyklay
Copy link

sergeyklay commented Dec 15, 2022

Hi,

I just caught a runtime error and can reproduce it.

version: 0.0.43 | compiled: 2022-12-08T12:58:30Z

vacuum generate-ruleset recommended
vacuum lint -r ruleset-recommended.yaml example.yml

example.yml as follows:

openapi: 3.0.3

info:
  version: 1.0.0
  title: Example

tags:
  - name: my-tag
    description: A description for My Tag

servers:
  - url: 'http://127.0.0.1:8080'

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

paths:
  /v1/users:
    get:
      summary: Some summary
      operationId: users.get
      responses:
        '204':
          description: No content

    head:
      summary: Some summary
      operationId: users.head
      responses:
        '204':
          description: No content

    post:
      summary: Some summary
      operationId: users.post
      responses:
        '204':
          description: No content

    patch:
      summary: Some summary
      # operationId: users.patch
      responses:
        '204':
          description: No content

Let me know if I can provide more information that would be helpful.


panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x90 pc=0x102f75340]

goroutine 72 [running]:
regexp.(*Regexp).doExecute(0x1037d3840?, {0x0?, 0x0?}, {0x0?, 0x1400079bba0?, 0x140004b1bd0?}, {0x140002c6078?, 0x0?}, 0x1037d33c0?, 0x140007931d0?, ...)
	/opt/hostedtoolcache/go/1.19.3/x64/src/regexp/exec.go:527 +0x50
regexp.(*Regexp).doMatch(...)
	/opt/hostedtoolcache/go/1.19.3/x64/src/regexp/exec.go:514
regexp.(*Regexp).MatchString(...)
	/opt/hostedtoolcache/go/1.19.3/x64/src/regexp/regexp.go:533
github.com/daveshanley/vacuum/functions/openapi.NoEvalInDescriptions.RunRule({}, {0x14000716030?, 0x8?, 0x103d413e0?}, {0x14000712180, 0x140007cd760, {0x1037a7a60, 0x1400079bb50}, {0x1037d33c0, 0x140007931d0}, ...})
	/home/runner/work/vacuum/vacuum/functions/openapi/no_eval_descriptions.go:41 +0x1d0
github.com/daveshanley/vacuum/motor.buildResults({0x140007cd760, 0x140001400a0, {0x10386b348, 0x140003f48e0}, 0x140007b85a0, 0x140006104d0, 0x1400058c180, 0x14000159000, 0x140001401e0, 0x0}, ...)
	/home/runner/work/vacuum/vacuum/motor/rule_applicator.go:387 +0x568
github.com/daveshanley/vacuum/motor.runRule({0x140007cd760, 0x140001400a0, {0x10386b348, 0x140003f48e0}, 0x140007b85a0, 0x140006104d0, 0x1400058c180, 0x14000159000, 0x140001401e0, 0x0})
	/home/runner/work/vacuum/vacuum/motor/rule_applicator.go:314 +0x304
created by github.com/daveshanley/vacuum/motor.ApplyRulesToRuleSet
	/home/runner/work/vacuum/vacuum/motor/rule_applicator.go:157 +0x628
@daveshanley
Copy link
Owner

Nice find! I'll look into this asap.

@daveshanley daveshanley self-assigned this Dec 15, 2022
@daveshanley daveshanley added the bug Something isn't working label Dec 15, 2022
daveshanley added a commit that referenced this issue Dec 16, 2022
After generating a ruleset and reading it back in, some values were not properly re-serialized correctly. This fixes #208
@daveshanley daveshanley reopened this Dec 16, 2022
@daveshanley
Copy link
Owner

This should be fixed in v0.0.44

@sergeyklay
Copy link
Author

Thank you!

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