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

[BUG] Panic - Invalid Memory Address due to MaxResults #2853

Closed
2 of 3 tasks
iocron opened this issue Oct 28, 2024 · 3 comments
Closed
2 of 3 tasks

[BUG] Panic - Invalid Memory Address due to MaxResults #2853

iocron opened this issue Oct 28, 2024 · 3 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@iocron
Copy link

iocron commented Oct 28, 2024

Acknowledgements

Describe the bug

Using MaxResults works only up to a value of 100, otherwise it throws a panic panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100dd9200]

Code to reproduce:

	identityStoreId := "d-xxxxxxxxxx"
	ctx := context.Background()
	cfg, err := config.LoadDefaultConfig(context.TODO())
	if err != nil {
		log.Fatal(err)
	}

	client := identitystore.NewFromConfig(cfg)
	result, err := client.ListUsers(ctx, &identitystore.ListUsersInput{
		IdentityStoreId: &identityStoreId,
		MaxResults:      aws.Int32(101),
	})

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Should not crash with a hard panic and inform the user about the hard limit.

Current Behavior

Crashes with a hard segmentation violation panic error.

Reproduction Steps

Execute the mentioned code above.

package main

import (
	"context"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/identitystore"
	"log"
)

func main() {
	identityStoreId := "d-xxxxxxxxxx"
	ctx := context.Background()
	cfg, err := config.LoadDefaultConfig(context.TODO())
	if err != nil {
		log.Fatal(err)
	}

	client := identitystore.NewFromConfig(cfg)
	result, err := client.ListUsers(ctx, &identitystore.ListUsersInput{
		IdentityStoreId: &identityStoreId,
		MaxResults:      aws.Int32(101),
	})
}

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

aws-identitycenter-groupsync github.com/aws/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/internal/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/internal/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/service/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/service/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/service/[email protected]
aws-identitycenter-groupsync github.com/aws/aws-sdk-go-v2/service/[email protected]
aws-identitycenter-groupsync github.com/aws/[email protected]
aws-identitycenter-groupsync [email protected]
github.com/aws/[email protected] github.com/aws/[email protected]
github.com/aws/[email protected] github.com/jmespath/[email protected]
github.com/aws/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
github.com/aws/aws-sdk-go-v2/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/feature/ec2/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/internal/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/internal/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/internal/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/internal/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/internal/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/internal/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] [email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/internal/endpoints/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/aws-sdk-go-v2/service/internal/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] github.com/aws/[email protected]
github.com/aws/aws-sdk-go-v2/service/[email protected] [email protected]
github.com/aws/[email protected] [email protected]
[email protected] [email protected]

Compiler and Version used

go version go1.23.2 darwin/arm64

Operating System and version

macOS 14.6.1

@iocron iocron added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2024
@RanVaknin RanVaknin self-assigned this Oct 28, 2024
@RanVaknin
Copy link
Contributor

Hi @iocron ,

I tried reproducing this issue, but Im not seeing a panic, instead I'm seeing a validation error. Is your code snippet incomplete and somehow references results at the 101th index that causes the nil pointer exception?

From the documentation: https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_ListUsers.html#singlesignon-ListUsers-request-MaxResults

Max results should be set between 1-100.

Thanks,
Ran~

@RanVaknin RanVaknin added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2024
Copy link

github-actions bot commented Nov 8, 2024

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 8, 2024
@iocron
Copy link
Author

iocron commented Nov 20, 2024

Hi @RanVaknin
I checked it with some other example and i am getting a validation error as well. I think the panic I mentioned might have been indirectly caused (can't find/reproduce the panic anymore). The validation error only says:

operation error identitystore: ListUsers, https response error StatusCode: 400, RequestID: ..., ValidationException: exit status 1

That information does not provide very much to the enduser. Would it make sense to define a generally intelligible error message for this instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants