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

"lawsg groups" command gives runtime error #6

Open
bostondom opened this issue May 25, 2023 · 4 comments
Open

"lawsg groups" command gives runtime error #6

bostondom opened this issue May 25, 2023 · 4 comments

Comments

@bostondom
Copy link

bostondom commented May 25, 2023

Installed v0.4.0 on M2 Mac via brew.
Running
lawsg groups
gives this error:

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

goroutine 1 [running]:
github.com/mmcquillan/lawsg/fetch.ListGroups(0x0, 0x0, 0x0, 0x0, 0x18853fefd80, 0x18854082540, 0x0, 0x2710, 0x0, 0x0, ...)
	/Users/matt/code/lawsg/fetch/groups.go:76 +0x230
github.com/mmcquillan/lawsg/fetch.Groups(0x0, 0x0, 0x0, 0x0, 0x18853fefd80, 0x18854082540, 0x0, 0x2710, 0x0, 0x0, ...)
	/Users/matt/code/lawsg/fetch/groups.go:18 +0x55
main.main()
	/Users/matt/code/lawsg/lawsg.go:21 +0x2cb

I uninstalled and complied from the go code and get same error.
get, stream, help, version all work fine

@bostondom bostondom changed the title "lawsg" groups command gives runtime error "lawsg groups" command gives runtime error May 25, 2023
@bostondom
Copy link
Author

I just noticed that my AWS account had exactly 50 log groups.
I added a new empty one, and the command succeeded.
I am guessing line 75 in fetch/groups.go should be
if count > block {

@mmcquillan
Copy link
Owner

Glad you are using this! I'll take a look, but may need some help validating as it's been a while since I've written and don't currently have access to a good grouping of logs. 😄

@mmcquillan
Copy link
Owner

@bostondom I've pushed the PR, what architecture are you?

@bostondom
Copy link
Author

MacOS M2
this bug actually would have occurred if number of log groups is any even multiple of 50, but this commit fixes it for base case, so everything should be good. Will test it tomorrow morning and will add a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants